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

learn more… | top users | synonyms

0
votes
0answers
19 views

Python function should print out something, does nothing

I wrote small script for my Raspberry Pi Project with an Adafruit 16x2 RGB LCD: def KismetScanner(): print 'Deauth Flood' monitormode = subprocess.Popen('airmon-ng start wlan0', shell=True, ...
0
votes
0answers
22 views

Exit from imported script in python [migrated]

abc.py: import xyz #also import other required modules #other required code xyz.func() #other required code xyz.py: import threading import sys #few threads def func(): #start all threads ...
0
votes
1answer
44 views

Which ip alias is currently active? [on hold]

I used IP aliasing technique to assign multiple IP addresses on a single NIC. I am using these IPs in a Python script to generate traffic. I am doing this for my college project. How can I determine, ...
1
vote
0answers
24 views

writing systemd unit file and specfile for a python twistd application [on hold]

I have given a task to write the systemd unit file for a python twistd application and create rpm of it. The application is open source and you can find it here: ...
0
votes
1answer
23 views

how to change several piece of html code

I have several chunks of html code ,see below, in a html page that I need to change Assurez-vous de bien recevoir tous nos messages en ajoutant bebeco@concretisezvosprojets.com à votre carnet ...
1
vote
0answers
29 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
4answers
77 views

Script to delete files that don't match certain filenames

I have a folder with 500,000 images, sorted in subfolders by year and month. I'd like to create a script that does this: If the filename does not match any of the filenames in names.log then delete ...
0
votes
0answers
39 views

Why are some Python apps not compiled but rather distributed as scripts? [closed]

As an example, I've got Quod Libet (a music player) here. The /usr/bin/quodlibet file is a python2 script (not sure about other files it is using, coz I don't know where they are). At the same time, ...
-1
votes
0answers
16 views

python scapy issue -_- wrpcap [closed]

I hope I am in the right section, anyway, I use python-scapy script to sniff on the network. It works fine but the issue I'm having is with wrpcap when I just install a new system like ubuntu or kali ...
0
votes
0answers
15 views

Start GTK apk based on python

How to start application based on python + glade? startx python apk.py doesn't working. I can run application like firefox from text mode -> startx firefox
2
votes
0answers
36 views

Display cron job times in a human-friendly format

Is there a way to display or is there a tool that can parse a crontab expression and display it in a human-friendly way? 10 6 * * * sh /usr/local/crons/file_check.sh For example, for the above cron ...
0
votes
0answers
28 views

Xterm not printing python errors

I'm running a suite of bash and python scripts that (taken together) make up a large open source software project running on Ubuntu 14.10 under VirtualBox 4.3.22. I'm using python 2.7.8 and xterm ...
0
votes
0answers
31 views

broken yum/python

Yum seems to be broken and below is the error. 'import site' failed; use -v for traceback There was a problem importing one of the Python modules required to run yum. The error leading to this ...
1
vote
3answers
60 views

How to include python script inside a bash script

I need to include below python script inside a bash script. If the bash script end success, I need to execute the below script. #!/usr/bin/python from smtplib import SMTP import datetime ...
1
vote
1answer
71 views

Linux Mint 13 Problem - No module named site

My Linux Mint 13 64-bit system has developed a problem. Whilst I can run basic commands like ls and vi if I try anything more complex (I have tried python2.7, mysql-workbench and addusr) I get:- ...
0
votes
1answer
27 views

Python script: wait until job in tmux session has completed

I am trying to continuously run a python script with random parameters from another python script, where each run is in its own tmux session. A very simplified overview of what I'm trying to do goes ...
0
votes
1answer
25 views

Installing gdal python package inside Python27 Software Collection

I have a Centos 6.6 VM with the Python 2.7 SCL. I have gdal and gdal-devel installed. If I start the scl with sudo scl enable python27 bash and do a pip install gdal it fails on: gcc -pthread ...
2
votes
1answer
48 views

how can I add an extra character after a word search [closed]

I have the following field names demelog voyapro naisjdf naismc decoide decoccm travide travccm equiccm mariccm Below is a sample of my file. There are more columns before the first fck=83... ...
1
vote
1answer
21 views

How to run specific architecture (32/64) of Python in Centos6 when both are installed?

I have a Centos 6.6 Docker image being used for an automated build. It has the default x64 Python 2.6.6 installed. I need to run some things in a 32-bit Python environment. I snagged the ...
0
votes
0answers
41 views

Testing outgoing FTP with fake data

I would like to implement a fake FTP transfer in a program I'm working on. Basically I just want there to be FTP traffic happening in the background for a variable length of time. Similar to how iperf ...
0
votes
1answer
47 views

Exit /dev/tty after error message

I run this bash function when a button is pressed, it calls my mobile, however when the call ends or I reject the call, it hangs in /dev/tty and does not return to the main program call.sh ...
0
votes
0answers
18 views

Problem in running uberwriter (a python app)

I installed uberwriter on my archlinux using AUR. But when I want to run it this error will be shown: Traceback (most recent call last): File "/usr/bin/uberwriter", line 44, in <module> ...
2
votes
2answers
51 views

Can't import wx even after installing python-wxgtk2.8

I am running Linux Ubuntu 14.04 LTS and am trying to install wxPython so I can develop GUIs on python. I have python 2.7 and 3 installed but 2.7 in default. I have installed wxPython as recommended ...
1
vote
1answer
21 views

Importing Python files from inside folders

On Mac OS X, I can import a .py file named test inside the directory dir by running import dir.test However, on Debian (specifically Raspian) this does not work. What is the alternative?
0
votes
0answers
16 views

python search function not working [migrated]

I need help with part of python code. I have search function which will search for string in file, and retrun it if found, or give Error dialog if not found. Also after Error dialog is closed, give ...
13
votes
4answers
1k views

Write Python stdout to file immediately

When trying to write the stdout from a Python script to a text file (python script.py > log), the text file is created when the command is started, but the actual content isn't written until the ...
1
vote
2answers
19 views

Where is pithos installed?

I'm trying to find the installation directory in Pithos so I can hack it, and am really bad a unix commands and am embarrassed to ask this. If I do: `which pithos` This returns a link to the ...
2
votes
3answers
127 views

Writing a program for editing .txt data - Python or Unix?

I only have little experience in programming, and I'm currently working on improving my skills. Basically, I need to write a program, that can do some specific processes to some data in a .txt file. ...
2
votes
1answer
46 views

Get 'python-keyring' to stop prompting for 'encrypted keyring' password

Situation: I followed these instructions (http://mercurial.selenic.com/wiki/KeyringExtension) on setting up the mercurial keyring-extension for mercurial. On a Ubuntu 12.04.4 (precise) machine it ...
0
votes
3answers
77 views

How do I print a certain line of python code using the Linux terminal?

If I am writing some python and I only want the terminal to show a certain line, what command do I use? For example my program is: print("line one") print("line two") print("line three") And I only ...
2
votes
3answers
83 views

Replace multiline string in files

I have a number of files I want to update by replacing one multi-line string with another multi-line string. Something along the lines of: * Some text, * something else * another thing And I want ...
0
votes
0answers
69 views

errors while installing python-pip on ubuntu

When running sudo apt-get install python-pip I got the following error messages, what causes the problem and how to fix it? Thank you very much for any help. Err ...
0
votes
0answers
60 views

Homebrew?? error: option --no-user-cfg not recognized

Using homebrew, in which I am have no skill, I was updating cmake (as part of install of avidemux...) on snow leopard $brew -v upgrade cmake Everything works fine through Verifying ...
0
votes
0answers
92 views

Unable to use python speech_recognition lib Microphone class due to ALSA

I am attempting to write a speech recognition program for the raspberry pi, however I am facing some issues using python's speech_recognition library. From the error messages (posted below) I think ...
2
votes
0answers
38 views

arecord until sound level drops low enough

I am trying to implement constant voice recognition on my Pi at the moment, I am achieving this by having two threads running, one constantly recording (with arecord in a bash script) for X amount of ...
1
vote
2answers
68 views

Installing older versions of python packages with apt-get (specifically wxpython)

I've been beating my head against the wall trying to troubleshoot a graphical program with a WX backend. We've found that wxPython 2.8.10 work fine, and seemingly any newer releases doesn't. Despite ...
3
votes
1answer
56 views

Finding certain X window with Python's Xlib

I am trying to find an unmapped window on my X server in order to map it back and send it some EWMH hint. Because the window is unmapped I cannot use EWMH to ask the window manager directly. So I am ...
5
votes
2answers
265 views

If any spawned child processes fail, kill all and exit

In my script I split up a data set into input_aa, input_ab, etc. Then, I run each through the same Python script, as such: # Execute program on each split file for part in input_*; do python3 ...
0
votes
0answers
3 views

What potential trouble may arise by copying module directly from one python sys path to another?

Our server is CentOS and sys python is in version 2.6, meanwhile there is also a python2.7 under /usr/local/bin I did yum install MySQL-python, but in python2.7 I can't import this module. So I ...
0
votes
2answers
66 views

Runs perfectly through the command line, will not work through systemd ExecStart

I've installed Butterfly http terminal server, written in python, on my Arch machine. I'm new to systemd, but I'm having an issue with one of the command line parameters. /usr/bin/butterfly.server.py ...
0
votes
1answer
63 views

Why does apt-get in Ubuntu still want to install Python 2.7?

New Linux VPS, installing Python and a few other tools I like to use. Did apt-get update and apt-get upgrade, and I noticed when I did apt-get install python it defaulted to version 2.7. (I can, ...
0
votes
2answers
1k 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 ...
0
votes
1answer
35 views

/usr/lib/python2.4/site-packages/cElementTree.so: wrong ELF class: ELFCLASS32

yum update There was a problem importing one of the Python modules required to run yum. The error leading to this problem was: /usr/lib/python2.4/site-packages/cElementTree.so: wrong ELF class: ...
1
vote
2answers
277 views

What should I do about Python 2.7.9 not looking for SSL certificates in the right place on FreeBSD?

I have a FreeBSD 10.0 system, and a couple of days ago, I upgraded my python27 port from Python 2.7.8 to Python 2.7.9, which enabled SSL verification by default. Unsurprisingly, it broke my existing ...
1
vote
2answers
89 views

How can I replace bash using Python?

According to the accepted answer for this SO question: , Python can make a great bash replacement. My question then, is this: how do I go about seamlessly make the switch? I think the main thing to ...
3
votes
3answers
175 views

Unable to run python script - Permission Denied

Trying to run a NZBGet (Python) Script, I've tried to run manually with: /mnt/local/ext001/MEDIA/NZBGet/scripts/videosort/VideoSort.py but this results in: bash: ...
1
vote
1answer
133 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 ...
0
votes
1answer
392 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
36 views

Setting different path for installation in python packaging

I am new to python packaging. My Command Line Interface (CLI) named virtdc modules has to be installed in /var/lib/virtdc. virtdc is the top folder structure /var/lib/virtdc/ framework/ ...
0
votes
1answer
29 views

Permissions when creating a simple Python package for pip

I'm trying to package a simple app I wrote, so that it can be installed on a system using python setup.py install and (later) using pip install awesomeapp. The app consists of two files in the same ...