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

learn more… | top users | synonyms

1
vote
1answer
172 views

How to copy rows of different files and paste column-wise?

I want to create a new file by copying rows of each file and pasting columnwise according to their file name orders. Here is the sample input and required output files below. file1.txt 1234 5678 ...
2
votes
3answers
673 views

Distributions that only ships Python 3.X

Is it possible currently? I tried to remove python in Fedora 19 but yum depends on it.
0
votes
1answer
29 views

Python output in XML format

I have a python script which compare IP list with IP Database and gives output of matching criteria. (I got the script from this forum). convert.py #!/usr/bin/python import socket,struct ...
1
vote
1answer
526 views

How to install the pylzma python library on Linux?

The pylzma library is a requirement for another tool that I would like to use. I am new to python and programming and have a few questions: I have already followed the procedure to download and ...
1
vote
1answer
598 views

How can i fix the following gmp library dependency error while trying to install Charm?

I am trying to install Charm crypto python framework in ubuntu 11.04 with python 2.7. Requirements say that i should have gmp installed 5.*. I have successfully installed gmp lib and i have run all ...
1
vote
1answer
1k 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 ...
0
votes
1answer
60 views

apt-get without sudo?

I am trying to install YouCompleteMe (YCM) on my user account on a Debian machine. The installation guide says we need python-dev for YCM to work: sudo apt-get install python-dev My question is: ...
1
vote
0answers
24 views

CentOs7 Python 3.4 Install Method

This post relates to this question where I was asked to explain how I installed python3 on my system. I was attempting to install python3 on my system for development purposes. Something went wrong ...
1
vote
1answer
41 views

CentOs 7 Python Issue “-bash: python: command not found”

I asked this at stackoverflow, but just realized it might be best here. If I need to delete it over there or should not have posted here, please let me know. I am still new to this site. Thanks in ...
0
votes
1answer
26 views

get values which only ocurre once in the vector

there is a vector of numbers I have which ascend (it is called t8_) 2 7 8 9 11 15 34 91 91 92 94 the problem is that some number happen two times - I don't want to remove them but they have to ...
1
vote
2answers
59 views

How do I get the output of a program already running?

I have a python program that outputs to stdout and a log file. However, the person I am making this for wants to know if I can set it up so that he can see the output of the file, while it is ...
1
vote
1answer
309 views

Failed installation 32-bit python on 64-bit Linux Mint

I basically have two questions: How do you install 32-bit Python alongside 64-bit Python on linux? How do I fix my broken system from the failed attempt below? I just tried to install a 32-bit ...
1
vote
2answers
49 views

How do I program Python so that it outputs to all terminals in Linux

I am programming a python program for the raspberry pi. Is there a way for me so that when the raspberry pi outputs text, it will show up on all terminals that are currently remotely logged in via ...
-1
votes
0answers
26 views

Sum max and min int from a list [closed]

I want to create a function that can sum min and max int in a list for me without using max and min (Because the requirement is the function only go through entire list once to find min and max ...
0
votes
1answer
17 views

How to monitor the screen lock/unlock in the Ubuntu 14.04

I need to implement a function that monitor the screen lock/unlock. I referred the following article: Run script on screen lock/unlock My python script code works fine in the Ubuntu 12.04, but ...
-1
votes
2answers
16 views

OpenDNS automatic diagnostic

I've contacted OpenDNS support because advertising are not filtered on this site http://www.backpackerboard.co.nz/ They asked me to read this manual instructions ...
0
votes
0answers
99 views

Receiving “Unable to correct problems, you have held broken packages.” after trying to install python -setuptools and python-pip

I ran "sudo apt-get install python-setuptools python-pip" but I received: Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be ...
5
votes
1answer
4k views

How to display the name of the current Virtualenv?

I'm using virtualenv, virtualenvwrapper, zsh, oh-my-zsh, terminator, on Crunchbang. I'm trying to display the name of the current virtualenv like so workon example (example)... I've tried many ...
2
votes
1answer
210 views

Virtualenv creation seems to do nothing

I have a problem setting up a Virtualenv on my web host server (to install python modules later on) So far I tried this (over SSH): wget ...
1
vote
1answer
20 views

How to append to an environment variable using an .env file?

Assuming the .env file is loaded before execution, how can you append to it without overriding it? DEBUG=True FOO=BAR PYTHONPATH="/Users/James/project/" The above file would (?) override it, and ...
3
votes
1answer
779 views

Python script run while screen is locked

I have a python script which seems to be failing to continue running its while True: ... sleep() loop my code is at http://github.com/xdaimon/xdaimonConky What happens is I autostart python on ...
-3
votes
0answers
37 views

How to save output of a python command to a file [closed]

I am writing a script and part of it is print "\nSOURCE CODE COMMAND: "+source_code_command print "\n" exec source_code_command outfile > output.txt Third line is throwing error. While ...
10
votes
5answers
11k views

Why is this python error message generated whenever I type a nonsense command?

Whenever I type any "nonsense" command, this python error message is generated. Normal commands work fine. Any idea how to debug this? $ somenonexistingcommand Traceback (most recent call last): ...
1
vote
1answer
20 views

calculate numbers on end and merge to one line

So in a file i have lines like these: thisdata:thisother:1337 thisdata:thisother:1800 thisdata:thisother:1500 thisdata:thisother:46984 I would like to output: thisdata:thisother:51621 for all ...
1
vote
1answer
14 views

Cron Job to Keep Daemon Running?

let us suppose I have a cron job like this: */15 * * * * /path/to/thedaemon The daemon (it being a python daemon via from daemon import runner) will not allow multiple instances of itself, which in ...
0
votes
2answers
5k views

How to setup and use yowsup-cli to to get Whatsapp authentication code?

I've tried following the same way mentioned everywhere, but something is wrong. sudo apt-get install python python-dateutil python-argparse sudo wget ...
1
vote
1answer
21 views

Ran into a problem running Bpython

I used the sudo apt-get install bpython command to install bpython. Now when I type bpython, I get an error: Traceback (most recent call last): File "/usr/bin/bpython", line 5, in <module> from ...
1
vote
2answers
1k 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 ...
1
vote
1answer
27 views

How the Python suffixes obtained by imp.get_suffixes() are set (in particular in Debian Jessie)?

The command python -c "import imp; print(imp.get_suffixes())" prints a list of tuples with suffixes used when importing modules (see the doc of imp.get_suffixes). Usually it is simply: [('.so', ...
1
vote
1answer
149 views

Setup SSH tunnel on existing connection from script

I want to establish an SSH tunnel on an existing connection. The tricky part is doing it from a script (a custom shell I need to allow users only some specific things, like setting up this tunnel). ...
1
vote
2answers
46 views

about executing a python program in a shell script which is scheduled on crontab

i have a problem with regards on crontab. I have a script named checker.sh and i want to schedule it that would run every minute: * * * * * sh /home/pi/checker.sh so i have the script here: the ...
-1
votes
0answers
13 views

How to fix Python ValueError:bad marshal data? [migrated]

Running flexget Python script in Ubuntu, I get an error: $ flexget series forget "Orange is the new black" s03e01 Traceback (most recent call last): File "/usr/local/bin/flexget", line 7, in ...
0
votes
1answer
28 views

Error installing scipy

I'm on Manjaro trying to install scipy in virtualenv using pip. I get this error. How to fix it?
0
votes
0answers
19 views

invoking python program for each path in makefile vapth

I have a makefile as follows: VPATH = ../../HWP \ ../../hwsv/server \ ../hwpf PROC_INPUT_FILES = abc.c \ def.c \ xyz.c MEM_INPUT_FILES = ...
0
votes
1answer
746 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
46 views

How to activate Virtualenv when a Python script starts?

I want to schedule a python script to run using cron on certain dates, the problem is that in order for example.py to work, example-env has to be activated, is there a way to make example.py activate ...
3
votes
5answers
9k views

parse json using python

I have a JSON file members.json as below. { "took": 670, "timed_out": false, "_shards": { "total": 8, "successful": 8, "failed": 0 }, "hits": { "total": 74, ...
3
votes
2answers
38 views

How to locally install .deb without apt-get, dpkg or root access?

I'm using python on a Linux cluster (without root access) and want to use the numpy module. After downloading numpy from Numerical Python, extracting and trying to install it with: python setup.py ...
1
vote
2answers
43 views

Invoke python script through make command

I have a tool with 5 python scripts say A.py, B.py, C.py, D.py and E.py. I have to run this program in Linux. A.py is the one program I run which imports other files and uses them. For running A.py, I ...
0
votes
1answer
96 views

Process Being Killed due to low swap

I'm running a python (2.7) script on mac osx yosemite. The script is fairly computationally intensive, certainly bumping up against my machine's RAM limitations. The computer crashes and restarts ...
0
votes
1answer
52 views

How to catch first line of stdout from bash process substitution?

I am working with the following block of bash and it is not printing out the first line of expected output: exec 3< <(python3 -m http.server) while true; do read -t 2 line ...
2
votes
3answers
880 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 ...
5
votes
0answers
18 views

How do I activate Xorg record module on Raspian?

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 Raspian it keeps failing with this ...
0
votes
1answer
953 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), ...
0
votes
0answers
49 views

python install on linux RHEL5 - GCC 4.1.2-52

I used the following guide from the Beyond Linux From Scratch SVN Book, not knowing that my distribution was actually RPM Based (see comments), and now I am getting the following error during python ...
6
votes
4answers
4k views

Using jq to extract values and format in CSV

I have the below JSON file: { "data": [ { "displayName": "First Name", "rank": 1, "value": "VALUE" }, { "displayName": "Last Name", "rank": 2, ...
2
votes
1answer
25 views

preventing dpkg-buildpackage using /usr/bin as installation destination

Briefly, I am building a Debian package. Everything works fine with packaging except the point, that after packaging my application is always in the /usr/bin folder. It's actually a Python ...
0
votes
0answers
33 views

Running lpr through command line and through python different outcome

When I run lpr <filename>.jpg the file prints out boderless (this is what I want). When I run subprocess.call("/usr/bin/lpr " + tmp.name, shell=True) from a Python program, it prints out with ...
1
vote
2answers
74 views

Installing VIM with Python support locally without sudo

I'm trying to install VIM with Python support on Linux without sudo, but for some reason VIM always gets installed without python ( -python in vim --version ) I first installed Python locally by ...
1
vote
1answer
92 views

Installing DevedeNG in kali linux, but missing python dependency it says is already installed

As you can see in the picture it says dependency is not satisfiable, but when I try to install the latest version of python3 the command prompt tells me i have the latest version installed.. Any ...