Python is an interpreted, general-purpose high-level programming language whose design philosophy emphasizes code readability.

learn more… | top users | synonyms

-3
votes
0answers
15 views

Removing intermediate line breaks in muliple columns except the last new line character [on hold]

Suppose If I have the data like this Col1|Col2|Col3 <br\> 123|abc\n<br\> xyz\n<br\> |abc\n<br\> def\n<br\> other rows<br\> <br\> In the above newline ...
1
vote
1answer
2k views

Trouble installing lxml with custom install location for libxml2/libxslt

I am attempting to install a python module called lxml to my account on a supercomputer running RHEL. I do NOT have root access or super user status. lxml requires the dev/devel versions of libxml2 ...
4
votes
2answers
5k views

Installing python modules for python2.6

On my CentOS 5.8 system (el5 , 64bit), I had python2.4 after OS install and I installed python2.6 now. Now I want to install python modules using yum. But whenever I install a new python module it ...
42
votes
3answers
15k views

How does /usr/bin/env know which program to use?

When I use the shebang #!/usr/bin/env python to run a script, how does the system know which python to use? if I look for a python bin path in the environment variables I find nothing. env | grep -i ...
0
votes
0answers
15 views

Equivalent to OS X's py2app and Windows's py2exe?

I'm writing an application in Python. I don't expect my end users to be particularly tech-savvy, so I'd like to package it up like a familiar native executable. For OS X, that means running it ...
1
vote
0answers
14 views

Build xpra on local directory without root priviledges

I am trying to build xpra on local directory without root priviledges. The xpra official site says: https://www.xpra.org/trac/wiki/Building Building with distutils For installing into a local ...
1
vote
0answers
13 views

Can I copy output from sage to my clipboard?

I run sage from the terminal. One nice feature of sage is that it can automatically latex-ify results. I would like to be able to pipe these results to my clipboard (I run Ubuntu 14.04). I have ...
0
votes
0answers
16 views

Testing by Change variables [closed]

I am trying to write a shell script for testing. Goal: I need to be able to change the variables (automatically) after the test (by changing the variables to anything) to compare both results. The ...
0
votes
1answer
691 views

Django can not connect to MySQL database over ubuntu 10.04

I am newbie in Django. I got a simple Django 1.3.* project, i would like to run it over my localhost. I installed all necessary modules like: python-mysqldb, rptz etc... I have ubuntu 10.04 ...
1
vote
0answers
17 views

Can I change owner of a tunnel after creating it?

I've been trying to finagle pytun to do my bidding in creating persistent ssh tunnels, but I very much do not want these to be owned by root and unless I modify the python package myself (which as a ...
0
votes
1answer
1k views

Debian Stable (“wheezy”): was trying to build Python 3.4, and I ran sudo make install — am I in trouble now?

So, I wanted to run Python 3.4.x inside a virtualenv virtual environment. I learned that the first step should be to build Python 3.4.x. I was doing so in /usr/bin/Python3.4.x (a folder I created), ...
1
vote
2answers
2k views

“except (IOError, OSError), e: SyntaxError: invalid syntax” when configuring python-lockfile

I am having trouble installing any new packages in Ubuntu because of python. I tried sudo apt-get install python3 python3-dev but I am getting the following output :: dpkg: error processing ...
0
votes
0answers
48 views

FreeBSD Selenium PhantomJS - Can not connect to the Service

i am stuck to run PhantomJS with selenium. So i have prepared a FreeBSD Jail and installed phantomjs via ports. whereis phantomjs > phantomjs: /usr/local/bin/phantomjs /usr/ports/lang/phantomjs ...
0
votes
2answers
64 views

Script for ssh automatic login to a specific port

So currently, the "traditional" way to connect through SSH is the following one: ssh USERNAME@HOST -p PORT I would like to create a script in which I will include all the appropriate information ...
11
votes
1answer
124 views

How do I activate Xorg record module on Raspbian?

I'm trying to automate some tests on my RaspberryPi and I'm using python's pymouse to perform some emulated clicks. On my Debian it works fine, but when it comes to Raspbian it keeps failing with this ...
3
votes
1answer
66 views

Bulk downloading PDFs

This may/may not be possible using bash happy for a suggestion in Python if there is one. But I would like to download all the PDFs/ePubs from the following link https://mises.org/library/books ...
0
votes
0answers
26 views

wget changes downloaded file size

I'm using wget to download Excel file with xlsx extension. The thing is that when I want to deal with the file using openpyxl, I get the following error: "BadZipfile: File is not a zip file" But when ...
0
votes
1answer
54 views

How do I print the data received on a serial port?

Below is the python code I have written : import serial,time #initialization and open the port ser = serial.Serial() ser.port = "/dev/ttyUSB0" ser.baudrate = 1152000 ser.bytesize = serial.EIGHTBITS ...
0
votes
0answers
38 views

Email generated with Python stuck in mailq, times out (Debian)

I want to send emails out, originating from my Debian computer. I do NOT want the emails to originate from my gmail account, like in most Python smtplib examples. I called my ISP regarding port 25, ...
0
votes
0answers
39 views

Cronjob python script

I have a python script that parses some html and then writes it to output file. I want that cronjob would execute that python script. When I run this script from command line it works fine (python ...
0
votes
1answer
18 views

OPENSSL_1.0.0 not found when running PyPy 4.0.1 on Amazon Linux (AWS EC2)

I want to run PyPy 4.0.1 on Amazon Linux (AWS EC2), and then downloaded and unzipped the tar.bz file. Also, I created the symbolic links to fix problems, such as pypy: error while loading shared ...
1
vote
0answers
229 views

Run git pull from a shell start-up script

I have Raspberry Pi that loads a shell script on start up. This script runs a python script, boot_camera.py, which is found in a repository. I Have a server which sends the Raspberry Pi a command ...
3
votes
0answers
29 views

What is wrong with my systemd unit file?

Here is my unit file: [Unit] Description=Backend Service After=mariadb.service Requires=mariadb.service [Service] Type=simple ExecStart=/var/www/html/pythonscripts/Backend.py [Install] Alias=BEd ...
0
votes
2answers
49 views

FreeBSD: using python3 in uwsgi instead of python2

I have a server with FreeBSD 10.1 installed. I want to deploy a Django site on it using uwsgi+nginx+python3 and got some problems. The site was written for python3, I installed python3.4 then python3 ...
1
vote
1answer
23 views

How to Load data to one table from Multiple excel files?

I have to load data from multiple excel file into one table , Please help me to achieve the solution. We are getting excel file from different retail shop which contain multiple column , each file is ...
0
votes
1answer
9 views

FreeBSD install python31 over python27

Hi I had installed python27 and after python31, I tried to deinstall python27 but it seems that this version is standing on host. How can I set python31 to become main python ?
1
vote
2answers
39 views

How to specify the python path for pip?

With pip installed, I am trying to install matplotlib in Ubuntu 12.04.4 LTS. I got the following error when executing "sudo pip install matplotlib" I guess this is because the python version is too ...
0
votes
1answer
1k views

qmake error when installing PyQt5

I'm trying to install PyQt5 for python3 from source files. I install SIP correctly. Then when I want to prepare the make file for installing PyQt, I get this error: #python3 configure.py Error: ...
1
vote
1answer
34 views

Building python with openssl support

I have the following directory structure: nchambers@nchambers-305E4A-305E5A-305E7A:~/mini-bin$ la 2to3 cpp-5.3.0 gcov-5.3.0 grmid-5.3.0 objcopy-2.25.1 ...
-1
votes
0answers
34 views

How to retrieve SSH remote data from a tty device via linux?

I have data coming from a device tty which is on a remote machine (via a SSH connection with IP:Port and a user:password to access it). Via PuTTy, I can log on to that IP and Port and put manually ...
0
votes
0answers
22 views

Building python with openssl support

I have the following directory structure: nchambers@nchambers-305E4A-305E5A-305E7A:~/mini-bin$ la 2to3 cpp-5.3.0 gcov-5.3.0 grmid-5.3.0 objcopy-2.25.1 ...
0
votes
1answer
31 views

Running a command on all servers using Fabric

I am not sure , whether i should i ask this question here or some other stack-exchange community , but i am trying some simple commands to run on a list of servers , using python fabric. The code ...
0
votes
1answer
43 views

Upgrading from Python to 2.7.10 to 2.7.11 on OSX

How can I upgrade Python from 2.7.10 to 2.7.11 on OSX (Yosemite)?
1
vote
2answers
37 views

How can I run this python script on all html files under a directory? [duplicate]

I have a python script $ cat ~/script.py import sys from lxml import etree from lxml.html import parse doc = parse(sys.argv[1]) title = doc.find('//title') title.text = span2.text.strip() print ...
1
vote
1answer
24 views

Install Python package in linux OpenSUSe

I am using this weird SuSE machine. I need to install a python package in my python 2.7. I downloaded it from the site and then untar it and cd to the directory.. Tried: cd /python-package_Pyxnat/ ...
0
votes
2answers
63 views

Make python 2.7 the default python in centos, making an alias didn't work

I am trying to install llvm on my centos 6.7. While running the configure file it says it throws the error checking for python >= 2.7... not found configure: error: found python 2.6.6 ...
1
vote
1answer
41 views

How to provoke a broken pipe

I try to debug a python script that interfaces MPD using python-mpd2. When the script tries to perform an action after being idle for a couple of hours, it terminates with an exception ...
0
votes
1answer
37 views

Using hex colors in Ranger file manager

I would like to change the colors in a ranger colorscheme to some custom hex colors I defined. However, in the python file the colors are set by their names, like "blue" or "red". I tried to swap them ...
4
votes
2answers
249 views

certificate errors trying to create a virtualenv on old Ubuntu

On an old Ubuntu 8.04 (cannot upgrade yet) I need to create a Python virtualenv, install some packages and then my software. I do get certificate errors: Could not fetch URL ...
0
votes
2answers
29 views

Shell script - blanks are not always recognized as such?

I'm confused on how bash interprets blanks while executing a script. In the end, I want a script that is fed by a csv file containing software used by an organisation and it should return the CVEs for ...
0
votes
0answers
26 views

Track command line with timestamps

I want to create a program that audits the command line I/O of a terminal session using its PID. I found out about script command which is pretty much the same to what I want, but the problem is that ...
2
votes
3answers
1k views

How can I replace bash with Python?

According to the accepted answer for this SO question: , Python can make a great bash replacement. My question then, is this: how do I go about seamlessly make the switch? I think the main thing to ...
2
votes
3answers
1k views

installing eric5 in CentOS 6.4

I am trying to install Eric Python IDE 5 in my CentOS 6.4. The problem here is even I have installed PyQT4 its again saying that module is missing. what I am supposed to do ? here is the terminal log ...
0
votes
1answer
12 views

Problems with terminal opening URL

I am using soundcloud API with python and I'm trying to open url of the song with my browser. I use this code client = soundcloud.Client(client_id=clientIdEntry.get()) track_url = urlEntry.get() if ...
0
votes
0answers
13 views

problem locating module in ubuntu, visible through Anaconda but not accesible

I have Ubuntu 12.04. I have installed Anaconda3 latest version. It has python3.5 which is default for the system now. Some of the programs require using python2.7 which I invoke as follows ...
0
votes
3answers
62 views

apt-get install bluez only installing documentation

I've been struggling for the past two days to get my Bluetooth keyboard to work with my Raspberry Pi 2, with Kali 2.0 installed (I have gotten Adafruit's PiTFT software from ...
0
votes
1answer
20 views

mysql error.log centralize logs

I'm developing a script where it will look into logs every 10 minutes and if there's any critical error it will send an e-mail to a certain adress. I have this problem i would like to solve more ...
-1
votes
1answer
42 views

Why are my emails generated with Python stuck in mail queue

I'm trying to send emails programmatically with Python. The emails stay in the mail queue (mailq). Details are below. My diagnosing abilities have reached their limit. Perhaps the issue is my ISP ...
0
votes
2answers
41 views

how to write python code to change display color

I want to change display color. I have a simple script: #!/bin/bash sleep 50 xrandr --output VGA1 --gamma 1.28:1:1.28 # for purple How can I write it in python?
0
votes
2answers
54 views

How to set up Python path?

I have uninstall anaconda2. but now when I run Python command in terminal it says "bash: /home/user/anaconda2/python: No such file or directory" now how can I set to Python when I have python 2.7 in ...