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

learn more… | top users | synonyms

1
vote
1answer
297 views

Running a python script 200,000 times in parallel using bash [duplicate]

I need to run my Python script 200,000 times. Is it possible to do parallel execution using bash? Since it's 200,000 times I would like to use at least 10 threads simultaneously
0
votes
3answers
382 views

Copy and get files from one machine which is connected via ssh to another one

I read a lot of answers to questions very similar to this one, but I couldn't find something that really fits my problem. Here's the situation. I have a machine whose address is "machine1@address", ...
1
vote
2answers
50 views

If I want to create a GUI which displays exactly the same data as TOP command does in LINUX, where do I get the data from?

I found out that I can get the PID(first column) from the /proc/[pid]/stat file, first column. I am not sure where can I find the rest of the attributes. And my guess is we need to calculate the %CPU ...
0
votes
1answer
56 views

How do I clean up vi and reinstall it completely? [closed]

Basically when I try to run vi, I have the following error (and after open it, there are a lot of errors): Error detected while processing function UltiSnips#bootstrap#Bootstrap: line 35: Traceback ...
0
votes
1answer
187 views

How to fix “cannot find -lxml2” error while installing 'igraph' for python?

On Ubuntu 15.04 I am trying to install 'igraph' using the following command: pip install python-igraph in order to, well, use the igraph package in python to work with graphs and stuff. However, ...
2
votes
1answer
748 views

PIL install error: SyntaxError: Missing parentheses in call to 'print'

I am trying to install PIL (the Python Imaging Library) using the command: pip install PIL --allow-unverified PIL --allow-all-external seeing the following errors: gkhan@Gkan ~ $ pip install PIL ...
1
vote
2answers
211 views

How can I switch between Python 2.7 and 3.4 that are installed on Debian 8 (Jessie)?

I'm using Debian 8.2 (Jessie), and have both Python 2.7 and 3.4 installed. Python 2.7 is the default and that's what is used when I run a Python script or interactively in the Terminal. How can I ...
1
vote
1answer
187 views

Run a Python script in the background on boot

I recently installed the Google App Engine Development server on my FreeBSD home server to be able to test my GAE app remotely. What I can't figure out is how to run the Python development server as a ...
4
votes
1answer
90 views

Where is the default device name (e.g. /dev/ttyUSBx) specified?

I'm investigating dynamic device name mapping via udev. The goal: On a multi user system, each user can allocate and free devices like usb-serial converters or PCIe cards (FPGAs). If an user ...
0
votes
1answer
61 views

How to import self made modules in Python on Ubuntu 15.04

I just moved from windows 8 to Ubuntu 15.04. I do some programming in python3, and some programs rely on imports from self made modules. In windows all I had to do was add the directory which contains ...
1
vote
0answers
20 views

The first click on Linux Mint menu does not open it

I noticed that the first click on the menu after rebooting or turning my computer on does not open it, I must click again to actually show it. I use LMDE with MATE. I have followed the instructions I ...
1
vote
0answers
52 views

Why is denyhosts not banning *some* brute force root SSH login attempts?

I recently noticed in my logwatch emails from a couple of servers that although denyhosts was doing its job for some brute force root ssh login attempts others seem to be ignored and continue to ...
1
vote
1answer
303 views

LD_LIBRARY_PATH ignored by Python 2.7

I'm trying to install Theano on a box for which I have no root access and it looks like that LD_LIBRARY_PATH is ignored by my installation of Python 2.7. Since I can't install packages at the system ...
1
vote
1answer
20 views

How is python invocation different when launched by Nagios nrpe?

When invoked with python2 after importing os and sys, the following function runs successfully but acts incorrectly when invoked by Nagios nrpe: def get_proc1_open_files(): # Set proc1_children ...
0
votes
1answer
69 views

Why are the bytes I'm receiving not the bytes I sent?

I've been working my way through a security games site, trying to automate what I'm doing using pwntools. I've come across a problem somewhere in my process, however. When I try to run the vulnerable ...
1
vote
0answers
78 views

How do I use the Python module “keyboardleds” to determine Caps Lock state?

I want my system to ascertain the state of Caps Lock (is it on or off) by inspecting the keyboard DIRECTLY. After much searching, I understand that this can be done in Python by using the module ...
0
votes
0answers
79 views

permission needed for Python to access USB drive?

I got this Python script that reads media files from USB stick. It used to run fine, today it keeps giving me OS Error: [Errno 13] Permission denied: media/myName/usbName when the script runs the ...
1
vote
1answer
56 views

How do I get the pid of the exact progarm launched

So I have a couple python programs say program A and program B, when using "pgrep python" to get the pid, it gives me the pid of both program A and program B. However, I am writing a program that need ...
2
votes
0answers
36 views

How can X11 shortkeys be captured by a Python program?

I want to have a little Python program running in the background that monitors for certain shortkey presses (e.g. Ctrl Alt direction key). The idea is that these shortkeys can trigger various actions. ...
0
votes
1answer
49 views

python gnupg cannot user keychain keys

I have an issue using the gnupg module in python in Ubuntu 14. My keychain is set up correctly. I can use gpg on the command line to decrypt files with having to enter my passphrase. I have also ...
0
votes
0answers
13 views

How to avoid the python script file output in the terminal? [duplicate]

I'm in my Macintosh Terminal. I was running a python proxy script at local and everything works fine except the python script keeps throwing out all kinds of logs in my terminal. How do I avoid them? ...
0
votes
0answers
89 views

Compiling 64bit Python on HP-UX (Itanium)

I'm trying to compile 64bit Python (2.7.10) on HP-UX (ia64), as per the Python readme, but can't seem to get it to work properly. This is what I'm using. I've also removed the "-O" from the OPT line ...
3
votes
0answers
159 views

ViM and Python says the encoding is ANSI_X3.4-1968

In ViM, the following command (using Python 3.4.3) outputs ANSI_X3.4-1968: :!python -c "import sys; print(sys.stdout.encoding)" However, I want UTF-8 everywhere. In .vimrc, I do have set ...
2
votes
2answers
80 views

Why is mail-utils / cron sending out so many emails?

I was trying to troubleshoot why my Raspberry Pi isn't sending emails with ssmtp / mail-utils, and so I opened up my gmail account that I use for the Pi. To my surprise, there were 15k unread emails ...
1
vote
1answer
83 views

Python script works from terminal, but fails in scheduler, to write to external drive

I am trying to use a Python script to read/write from an external disk in linux, which works fine. The problem comes when I use a job scheduler to execute the Python program. I am running all this on ...
0
votes
1answer
87 views

Need script to kill python process with low CPU usage

I've created a very large and complex python program and I now know it has a serious bug that I'm having a very hard time pinning down. I'm using this code in a production environment so I need a ...
1
vote
1answer
37 views

Tell Python to use alternative library

I am trying to use an alternative version of opencv (3.0) in my Python scripts. I compiled and installed this version to my home directory, and now I am trying to tell Python to use it. I have the ...
0
votes
0answers
36 views

How to steal keystrokes instead of just monitoring them?

I am writing a program that allows controlling the mouse through keyboard. The user is supposed to assign a hotkey to start the program, which runs in the background without GUI or CLI. The keyboard ...
6
votes
2answers
63 views

direct execution of python scripts

I have noticed that sometimes python scripts are not being started directly, ie /foo/bar.py, but rather from a shell script, which does nothing else than /usr/bin/python -O /foo/bar.py $@ One such ...
1
vote
1answer
164 views

python3.4 failed to import gi

I have tried many ways to install gi on my Mint17.02. zen@zen:~ > sudo pip3 install gi zen@zen:~ > sudo python3.4 -m pip install gi Requirement already satisfied (use --upgrade to upgrade): gi ...
2
votes
1answer
54 views

python Vs bash string slicing

My file a contains the text, bcd\\\\. With bash, i read the file and print characters from 4th to 8th position as, tmp=$(cat a) echo "${tmp:3:4}" It prints, \\\\ All happy. Now i use ...
1
vote
3answers
855 views

piping python variable value to bash script (inside python script)

After years of bash scripting I've been given the task of modifying a python script to have it call a shell script when certain conditions are met. That part wasn't too bad, but now I'm trying to ...
0
votes
0answers
362 views

Cannot install pyzmq

I'm trying to install pyzmq on my Elementary OS netbook as it is a dependency for ipython notebook. The full report is at github as exceeds the stackexchange character limit. Here are the last few ...
0
votes
0answers
150 views

How to sync Google Calendar gcalcli with Conky/Desktop?

Main Question: As the title says, I want to sync my Google Calendar with the Linux Mint 17.2 desktop; preferably through Conky. I'm aware of a method using Thunderbird but I'd rather have it set up as ...
1
vote
1answer
46 views

How to install cctrlapp on debian?

I try to install the cctrl command line client on a debian 8 machine. Following the install instructions, I installed python, pip and then (via pip) cctrl apt-get install python apt-get install ...
0
votes
1answer
40 views

How do I create a Debian package for a python progarm?

I created a python game that I want to distribute on my website via a Debian package. The game has a few dependencies that are usually not installed (such as pygame) on some Linux computers, but often ...
0
votes
0answers
85 views

Capture user input in SSH

Say you are at work, you ssh to your home PC and opened a python game.py. No VNC. Is it possible to press down and up, space, etc. inside the window of the game? No need to see the actual game ...
0
votes
0answers
175 views

Script won't run in cron but runs fine in root shell

My Problem: I have a python script that runs fine when run manually but does not complete when run using cron. My script fails in cron because it contains pexpect commands that require an interactive ...
0
votes
2answers
202 views

How to install PyX correctly for Scappy use? [closed]

When I try to run Scappy interactive shell I am faced with this: INFO: Can't import PyX. Won't be able to use psdump() or pdfdump() (The shell is working but of course I can not use the above ^ :( ...
0
votes
1answer
146 views

Offlineimap unknown SSL protocol error

I am using offlineimap to fetch mail from several IMAP servers. This used to work but today offlineimap has been unable to fetch mail, producing the following errors: *** Processing account example ...
0
votes
0answers
124 views

Upgrade python from 2.4 to 2.6 on RHEL 5.7

Currently We have 2.4.3-56.el5 version of python installed on RHEL 5.7. Need to install nodejs for which the python version should be upgraded to python26. I have downloaded the below rpms: ...
0
votes
0answers
264 views

How to execute python script on Visual studio / Other Editor with Linux environment

as all know it is impossible to write long python script directly on Linux machine with vi editor so we use (win editor) tools as visual studio / Pycharm and so on .... so my question is how to ...
0
votes
0answers
122 views

Continuum Anaconda Fedora 22 Linux path

After an update to Windows 10 I encounter problems in my dual boot system so I had to re-install Fedora 22. So, starting with a fresh system I re-installed my work environment. The one installation ...
0
votes
0answers
169 views

Continuum Anaconda Fedora 22 path

After an update to Windows 10 caused problems in my dual boot system I had to reinstall Fedora 22. So, starting with a fresh system I reinstalled my work environment. The one installation that has ...
1
vote
1answer
52 views

How to add entry for bootable external drive partition to internal bootloader?

I created a bootable partion on a Toshiba Canvio 2 for LinuxMint, leaving one other partition of same size for possibly another install in the future and the rest of the drive is for storage and back ...
3
votes
2answers
1k views

Using Python and Scapy to sniff for ARP on Pi

I'm trying to use a Raspberry Pi to find ARP requests from a specific wireless device on my network. It's one of those Amazon dash buttons. Someone used this code to listen to when the dash connects ...
0
votes
1answer
133 views

How to build openssl with clang(rather than gcc) on a FreeBSD machine?

I have a 64 bit FreeBSD build machine. I need to add https support in my python3 application code. For that it is advised to build/compile python with openssl support. I do not need any gcc dependency ...
1
vote
2answers
87 views

Using embedded python script in Makefile

I'm trying to run a Python snippet inside a Make target, but I'm having trouble trying to figure out how these things work in Make. Here is my attempt so far: define BROWSER_PYSCRIPT import os, ...
0
votes
0answers
36 views

How do I circumvent or gain root priviliges for pacman with PyDev?

I have downloaded and forked a project that I like to tinker with in Eclipse using PyDev. However, this project makes use of the package manager pacman that installs and uninstalls packages and needs ...
-1
votes
2answers
194 views

Loop over columns and store values to associative arrays

I've got a text file containing two columns, like so: 26 0.000342231 27 0.000342231 28 0.000684463 29 0.00136893 30 0.00102669 31 0.00308008 32 0.00308008 33 0.00444901 34 0.00718686 35 0.00718686 36 ...