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

learn more… | top users | synonyms

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 ...
1
vote
1answer
64 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
65 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
34 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
192 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
105 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
37 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
62 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
107 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
30 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 ...
3
votes
1answer
2k 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
149 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
121 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
104 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
340 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
0answers
93 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
156 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
51 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 ...
-2
votes
2answers
681 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
36 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
44 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
69 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
160 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 ...
1
vote
1answer
64 views

How do I prevent the Keyboard Interrupt from being sent through the Screen program

I am making a python program, whose output (not input) can be viewed via the screen program. However, the problem is that doing this allows the user to turn off the program via the Keyboard Interrupt ...
3
votes
4answers
788 views

How can I make a bash script that determines if a program is already running

There is a python program I am making, and I am planning to have it launch via a bash script. However the program acts badly when the computer tries to launch it twice. Since I really only need this ...
0
votes
0answers
56 views

How to automate HP 3PAR in CentOS using Python?

I have worked out in Windows to start 3PAR using python but I am not able to login into 3PAR in CentOS. Additionally I need to know how to view system, hosts, provisioning Tab(list Volumes, Virtual ...
0
votes
2answers
292 views

root access on new chromeos lenovo n21 for python dev

We've purchased several new Lenovo N21 chrombooks to run Python workshops for inmates in the local jail. Trying to install Crouton, Debian, and Anaconda to prepare. All require developer mode and ...
1
vote
1answer
119 views

Compiling Python 2.7.10 Error

I want to add Python 2.7 to my Unix. I downloaded the sources to the VirtualBox on which the Unix is installed and run ./configure --prefix=/usr \ --enable-shared \ ...
0
votes
0answers
48 views

RewriteRule ^/(.*) http://127.0.0.1:5050/$1 [L,P]

What is the full meaning of following line - RewriteRule ^/(.*) http://127.0.0.1:5050/$1 [L,P] There are three application both running by python on ubuntu 14.4. they are visible as below link ...
0
votes
1answer
59 views

Unable to start Terminator in Fedora

I'm not a Unix-friendly user, so my question could be very dummy. I installed Terminator using this command: sudo dnf install terminator After some days of using without problem, for some reason, ...
0
votes
0answers
82 views

ImportError: No module named gtkmozembed (Fedora)

I am trying to run this python script https://github.com/coderholic/PyWebShot but I am using Fedora (20) and I do not know how to get module gtkmozembed. Yum provides and yum search do not help me. ...
0
votes
3answers
417 views

Python3.4 package for Debian Wheezy

I'm looking for a way to get python3.4 for debian wheezy. I've been looking on repos but all I could find is 3.2 version. Does anybody know where I can find 3.4 package? (Or maybe does anybody know ...
1
vote
0answers
106 views

Make PyCrust use Python 3

I make successfully python 3.2.3 by opening it through terminal, I make it by alias python="python3" But when I open the PyCrust IDE, it opens up with Python 2.7.3, not 3.2.3. How can I make ...
0
votes
1answer
99 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 ...
0
votes
1answer
232 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
1k 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
491 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
2answers
88 views

get values which only occur once in a vector

There is a vector of numbers I have which are in ascending order (it is called t8_) 2 7 8 9 11 15 34 91 91 92 94 The problem is that some numbers happen two times. I don't want to remove them, but ...
1
vote
2answers
148 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
2answers
110 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 ...
0
votes
2answers
437 views

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

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

OpenDNS automatic diagnostics

I've contacted OpenDNS support because advertising is not filtered on this site http://www.backpackerboard.co.nz/ They asked me to read these manual instructions OpenDNS Diagnostic Tool: What to ...
1
vote
1answer
204 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 ...
1
vote
0answers
466 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 ...
1
vote
1answer
27 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 ...
2
votes
1answer
170 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 ...
1
vote
1answer
74 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
1answer
60 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', ...