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

learn more… | top users | synonyms

2
votes
2answers
149 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
150 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
118 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
49 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
42 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
79 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
302 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
61 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
4answers
2k 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
516 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
205 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
60 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
42 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
110 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
219 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
341 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
239 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
140 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
319 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
144 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
180 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
66 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
2k 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
298 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
130 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
53 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
343 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 ...
1
vote
1answer
105 views

Python processes appearing and disappearing in top

I concurrently launched around 12 Python scripts on a 24-core server (Ubuntu 14.04 LTS x64). Each of Python script takes around one hour to complete. I see in top that they appear quite sporadically, ...
2
votes
1answer
71 views

Restrict user script execution

I have a game engine running on a Debian server. The game involves bots, which are coded in Python by the players. A player write a bot in Python Upon validation, the code is sent to the server A ...
0
votes
0answers
39 views

I want to recompile a package with python3

I need to recompile a package on slackware using python3 instead python2.7 I have tried to set a link python3->python but doesn't work. This is the slackbuild wich i use
0
votes
2answers
297 views

pexpect fails to match command is grater than 65 characters

Issue with pexpect, python module. Pexpect fails to do expected behavior if the length of the command is greater than 65. #!/usr/bin/python import pexpect sshCmd='ssh root@15.186.22.105' ...
0
votes
0answers
144 views

Install previous version of iceweasel (raspberry Pi)

I am trying to get selenium (python) working on the raspberry pi. I am using Iceweasel for lack of another browser, but there is some bug that I am not sure about in the current version that stops ...
0
votes
0answers
47 views

Zenoss pythonThresholdException error

Zenoss query here, first things first: I have a CentOS 5.6 virtual server hosting Zenoss 4.2.5 and I am experienced no compatibility issues with this so far - it does everything I need. The problem ...
1
vote
1answer
103 views

Running python script, error appears

https://github.com/g-oikonomou/sensniff/blob/master/host/sensniff.py The link above refers to a python script that is to be run on Ubuntu. When I run the script, the following error appears on the ...
0
votes
1answer
131 views

How do I make a python daemon run at bootup?

I am writing a Python program that will act as a custom converter for a hardware application for me on the raspberry pi. I have written python code to act as a daemon, but how do I go about making it ...
0
votes
0answers
47 views

LSF bsub implimentation of LUT

We have an implementation of LSF (bsub) on our HPC system. I want to run a model several times with various input parameters. I will have a table either csv or other format with the required ...
4
votes
1answer
4k views

Help me repair my python - I think dpkg has to be reset (very tricky issue)

first question in Unix & Linux - I really hope, someone can help... Summary (TL;DR) On my Kubuntu 14.4 (which has python 2.7.6 as standard) my python is broken after I tried to install python ...
1
vote
1answer
186 views

Warnings when opening programs via Python subprocess calls

I am attempting to open an image and a text file that my Python (3.3.2) program is creating (the files are created without issue). The last two lines of the program are: subprocess.call(['leafpad', ...
5
votes
1answer
200 views

Running Deamon Involving GPIO on Pi

I have a daemon that monitors various things using the GPIO ports. I have used python to write the code for this using the RPi.GPIO module. I would like to ensure that the daemon is always running, ...
1
vote
1answer
113 views

Can I execute a script before every login

I am planning to have a program that will need to connect to a server. I'd like to be able to send a encrypted password to my server. The thing is, I need my decrypting script to be executed ...
0
votes
2answers
479 views

Python 2.7.10 on centos 6.6 but no IDLE

I installed Python 2.7.10 on my Centos 6.6 32 bit laptop but when I type IDLE at the prompt I get this [sinux1@horriblehost ~]$ idle ** IDLE can't import Tkinter. Your Python may not be configured ...
0
votes
1answer
136 views

Why won't MOTD display output from a Python script it calls outside of /etc/update-motd.d/ unless it's in this directory?

The Situation We're running a headless Ubuntu 14.10 Server to fulfill various needs and tests. I was experimenting with changing the MOTD for SSH sessions via /etc/update-motd.d/ so as to display ...
0
votes
1answer
186 views

syntax error while trying to execute python program in bash shell

I'm trying to use python to read in data from a text file but I keep getting "syntax" errors when I execute the program. Python Code: Test.py import os import numpy as np Ye,Eb,Tb = ...
0
votes
1answer
91 views

Python feature disabled vim-nox

I have installed vim-nox version 7.4 package in my Debian Wheezy machine from backports. I am confused that the python feature still does not work as shown from vim --version command as -python as ...
-3
votes
2answers
1k views

Installing python on CentOS

I am unable to digest the fact that Linux CentOS requires users to do so much just for installing Python. It was so easy installing python on Ubuntu. Also since CentOS comes with python2.5 it leads ...
2
votes
0answers
45 views

One liner to enable some SCLs and a python virtual environment?

I'm writing a python 3.4 app on a centos box. Normally, when I have to reset my tmux session, such as after a reboot I do the following: [zippy@localhost ~]$ scl enable rh-python34 httpd24 bash ...
0
votes
1answer
47 views

How do I make a Make, Make Install, and deb file for a python program?

I recently wrote a python program. Now the question: how do I go about making an installation script for it? From my understanding, you need to create a make file, I believe that a make file is made ...
-1
votes
1answer
30 views

Stat with Python about line count of 2-bits [closed]

Pseudocode to get amount of lines for 2-bit system (2*30=60): python -c "from math import ceil; print ceil(`stat --printf="%s/30"`/500.0)"; but I would like to really run similar stat command ...
0
votes
1answer
82 views

python && unix permissions (gitlab) [closed]

I have directory /home/git/repositories with rights 770 and uid=git,gid=git user1@gitserver:~$ ls -la /home/git/ | grep repo drwxrws--- 42 git git 4096 Jun 30 17:02 repositories I have user ...
1
vote
2answers
237 views

how to replace a sed/perl expression (change and print only matched line) with a python expression?

I have asked this question to learn how perl could replace sed. Now I want to know how the following commands (which do the same thing) would look like for python: sed -n ...