0
votes
1answer
21 views

Python/Linux- Detect disc insertion and get media information

On a headless Ubunutu server, I want to detect when a CD/DVD/BD is inserted then do a look-up to get info like artist, album title, track numbers/names, genre, and year released (CDs) or movie title ...
0
votes
1answer
51 views

Ubuntu 12.04 How To Run Python 3.3.2 Program In Terminal

OK so for school I am having to set up a computer using Ubuntu 12.04 to run Python programs written in Python 3.3. I was aware that 12.04 came with Python 3.2, so I followed the procedure in the first ...
1
vote
0answers
25 views

Python - Syncing two remote programs relying on time only

I have two programs, S and D,written in Python 2.7, running on seperate machines, both linux. The goal is to pass a file (in other words, bits) from S to D, through third party server called T only, ...
0
votes
1answer
16 views

How do I run a subprocess using local librairies on a remote server using mounted file systems?

I am using a subprocess to run a program on another machine through a mounted network file system. For my first step in this project I have been using sshfs mount and wget: sys_process = ...
0
votes
2answers
30 views

Perl script invocation error from Python

When cmd is run manually it works with no issues, but when run from another program on linux it gives me an error in the logs. Any ideas would be greatly appreciated. thanks Comes up with this error ...
-1
votes
1answer
27 views

Can I pass a list to os.getenv()?

I'm cooking a new python script for our constant integration plateform based on Hudson/maven/nexus etc. To do so, I've to check some environnement variables before starting anything on my script, so ...
0
votes
2answers
21 views

kill a python process launched at start up

I am running a small websocket server python based. For pratical reason I launched it at startup via a small script in init.d: case "$1" in start) echo "Starting mosaicServer" # run application you ...
0
votes
2answers
16 views

Disk cache of Python packages from requirements.txt

Everyone who has used open-source software for long knows that bit-rot rates are pretty high. This is certainly true for Python packages, which seem to change their APIs with unsettling frequency. ...
1
vote
2answers
54 views

Python: os.read() blocking on fd- nothing I have tried works so far, see examples

Condensing previous questions that suffer from XY problem into this one with my code for clarity: I have a user-run process that runs "/bin/sh -i" via proc_open. The control process is basically a ...
0
votes
1answer
17 views

installing pygame with easy_install error

I tried to install pygame with easy_install but unfortunately it is not working... Here is the output of the shell: Searching for pygame Reading http://pypi.python.org/simple/pygame/ Reading ...
0
votes
3answers
88 views

Ubuntu 12.04 LTS: Update python 2.7.3 to 2.7.6 without breaking dependencies [on hold]

So, I recently reinstalled Precise after encountering some swap issues. A friend and I were discussing working on something in Python together, so I checked my version. However, 12.04 comes with ...
0
votes
1answer
19 views

Python CronTab IOError

I am using the python-crontab module to make sure my script is ran every day at 2 pm. But I am getting some IOErrors when executing the script Traceback: File "backup.py", line 87, in <module> ...
1
vote
2answers
39 views

Find an xterm window by title, enter one command and press return using python/bash

I have an xterm window with a custom title. The xterm was fired up the following way: xterm -T customTitle. I would like to enter a command (for example ls -l) into this xterm window from a ...
0
votes
1answer
26 views

Accessing SMART attributes in Linux with only Python?

Is there a way to do this without using smartmontools? I'd like to try to see how far I get with just Python if possible. A google search does not seem to yield too much.
2
votes
2answers
27 views

What is the use of the path /usr/share/pyshared in python?

I found that some applications developed with python drop their files in this path, what is the use of this path, and what files should I put in it ?
3
votes
2answers
45 views

How to emulate a socket connect timeout in Linux?

In MacOS, I used to go with the following solution: import socket import time server = socket.socket() server.bind(('127.0.0.1', 7777)) time.sleep(5) server.listen(1) If another socket tries ...
3
votes
0answers
60 views

Why is `poll.poll` faster than `epoll.poll`?

I thought epoll should be faster than poll, but when I do the following experiment, it turns out to be slower. First I set up 1 server socket with 10 client sockets connected. import socket server = ...
0
votes
1answer
35 views

wxPython: maximize Frame while disable resizing (Linux)

On Linux, how do you disable re-sizing, but at the same time maximize the interface to begin with? I have tried the following but it is not maximized: style = wx.DEFAULT_FRAME_STYLE & ...
0
votes
0answers
27 views

wxPython: Mouse left click (EVT_LEFT_DOWN) on SearchCtrl

I am creating a GUI with wxPython. I have created a wx.SearchCtrl, and I am trying to allow it to recognize single mouse left click so it will pop up a window. However, I have tried binding events ...
0
votes
2answers
27 views

Python as an executable program

when I use programs like gimp or so, there's always a file that I click on to execute the program. I'd like to know how to do that in Python. I'm using Linux and Tkinter but I'd like to run my ...
1
vote
1answer
33 views

How can I upgrade lxml for python2.6

I am receiving the following error when running a python script: Traceback (most recent call last): File "/var/scripts/SchoolClosureManager/SchoolClosureManager.py", line 210, in <module> ...
0
votes
2answers
50 views

How does symlinking work in linux [on hold]

I installed django framework and going through the documentation I was instructed to run the django-admin.py but threw an error: Command not found I was Instructed in the documentation to try ...
0
votes
0answers
30 views

Best GUI language for certain project on linux KDE [on hold]

I'm attempting to create a GUI, and am looking for a language that would be best to do this in. I started it in pyQT, but have ran into complications and am questioning if that language was best for ...
3
votes
2answers
45 views

How to assign IP address to interface in python?

I have python script that set the IP4 address for my wireless and wired interfaces. So far, I use subprocess command like : subprocess.call(["ip addr add local 192.168.1.2/24 broadcast 192.168.1.255 ...
1
vote
3answers
44 views

How can I determine if a given directory is `symlink`ed to in Python?

I am trying to remove a set of directories, excluding those that are in used and symlinked to elsewhere. What is the most effective way to determine if a given directory is symlinked to? I've tried ...
0
votes
1answer
28 views

Running a bash script from Python

I need to run a bash script from Python. I got it to work as follows: import os os.system("xterm -hold -e scipt.sh") That isn't exactly what I am doing but pretty much the idea. That works fine, a ...
0
votes
1answer
16 views

Python find most recent File and get the size

I am trying to get python to find the most recent file in a directory and get the file size. I have tried a couple different methods using "sorted" and "os.path" but nothing seems to work quite right. ...
0
votes
0answers
32 views

How to fix Python installation [closed]

I am a new user of Scientific Linux (in general pretty new to linux). My system came with Python 2.6.6 Package. I want to install Python 2.7.2 and make the newer one default, but it looks like ...
1
vote
1answer
32 views

python serial port code is working in windows but not in linux

i have wrote some python code that is working fine in windows but it is not working in linux (ubuntu 12.04). Im getting this message: File "mygui.py", line 50, in sendPacket returnpacket = ...
0
votes
2answers
35 views

mounting a partition inside a dd image with Python

I'm writing a Python program to mount a partition inside a dd image. I know that there is code elsewhere (f.ex. https://raw.github.com/ox-it/python-libmount/master/libmount/mounting.py ) to mount a ...
0
votes
0answers
11 views

Python app: Show name in tmux status line. Modify the Python app, not tmux

I notice that some application show their names in the tmux status line, but my Python applications just show "Python": [0] 0:python2- 1:mysql 2:vim* What are MySQL and VIM doing that I could do? ...
0
votes
1answer
31 views

Python overwrite to file in wrong order

When I run my program with ./program.py >temp.out I get all the unit test output first then the prints I am putting in in the python. Is there anyway I can get this to appear in this file the way it ...
0
votes
0answers
13 views

Node.js compile error on Linux

I'm currently running a heavily modified Synology DSM (x86 bromolow based) on my server (bootstrapped, etc.), and for some services, I would need node.js. And thus, I've been following the tutorials, ...
0
votes
0answers
26 views

Python script stops running in crontab after sometime

I have a code which runs i am running in crontab on startup in Raspberry pi(The code runs fine in python "idle"). It has an infinite while loop in it. After sometime the python script stops running. i ...
0
votes
3answers
60 views

How to add multiple files automatically in BASH?

I have a Python code that takes multiple input files and merges them into one single output file. I want to create a bash script that adds the input files automatically, without having me to manually ...
2
votes
2answers
42 views

Setting env variable from a Python script

In my build (I'm using Linux) I need to call a Python script and set some env variables. I need these variables to be set even after I exit the script. I am able to set it using os.environ within the ...
1
vote
5answers
32 views

Python to POST data to local PHP on linux

This may sound a bit strange but I need this to happen like this for a reason. I need python to be able to post data to a local PHP file on a linux server and then get a response from the PHP. I ...
3
votes
1answer
74 views

Bash - stdout text gets truncated when redirected to a file

When working in Bash on Linux (Ubuntu 12.04 LTS), text output is truncated at times. I'll explain what I mean. Suppose, you issue the "dpkg -l" command. dpkg then writes to its standard output a ...
0
votes
0answers
30 views

Python client to collect information [closed]

I am trying to create a python agent that will be responsible for collecting data over the network and sending it to the remote server. The agent will be responsible for collecting information from ...
0
votes
0answers
15 views

Calling PHP from Python: Defining max number of concurrent calls

Majority of my scripting experience has been with BASH and Linux system stuff so bare with me. Basically am creating a Python script to handle a file queue on a linux server which will run as a ...
1
vote
3answers
67 views

Split a variable table in python

After call lsof Im looking the generic way to split every row to get in a string each cell of the table, the problem came because each time the command is called the size of every column can change. ...
0
votes
3answers
28 views

outputting only if diff has something

I am writing a python script to do some stuff and then in the end i do a diff of two files and write it to a file. This is done for like 100 files, and i am getting 100 outputs and most of them are ...
0
votes
1answer
50 views

Different to get the output between?

Could be any different to get the output between the next commands: lsof_list = commands.getoutput('lsof | awk \'{print $1,$2,$5}\') or: lsof_list1 = commands.getoutput('lsof | awk \'{print ...
3
votes
0answers
52 views

Linux: Warn Python Script of Restart [closed]

I have a Raspberry Pi which uses a USB wireless adapter and wicd-curses. A Python script runs in the background which uses a WebSocket. When I call sudo reboot, my Python script gets the signal to ...
0
votes
2answers
35 views

pypokereval library configure script fails with “No python development environments found”

I'm trying to compile the pypoker-eval-138.0 library for python2.7 (default on mint linux): source tarball dir GNA pokersource site So when running the configure script via ./configure, I get ...
0
votes
4answers
31 views

How do I get input from linux command line into my Python script?

I am trying to execute a command on a file such as chmod in a python script. How can I get the file name from command line to the script? I want to execute the script like so ./addExecute.py blah ...
4
votes
3answers
56 views

How to kill a process been created by subprocess in python?

Under Linux Ubuntu operating system, I run the test.py scrip which contain a GObject loop using subprocess by: subprocess.call(["test.py"]) Now, this test.py will creat process. Is there a way to ...
2
votes
4answers
65 views

Mass transfer files using scp

I'm trying to transfer large quantities of data from one server to another. I've tried using scp <file> <address@server:/path/to/scp/to Which works, however it's quite slow for large ...
0
votes
0answers
53 views

Why does Python follow symlinks? How do I work around that?

This is my directory layout: projects/ +-projectA/ |---moduleA.py |---script.py -> ../projectB/script.py +-projectB/ |---script.py This is what script.py contains: import ...
2
votes
3answers
4k views

Installing Python 2.7 without root

I tried installing Python 2.7 without root on a remote linux machine. I ran the commands ./configure prefix=/ make install DESTDIR=/xxx/yyy/ where /xxx/yyy/ is a directory for which I have ...

15 30 50 per page