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

learn more… | top users | synonyms

1
vote
0answers
22 views

Python embedded in bash not working [migrated]

I want to embed a small python script inside a bash script so that I can send a json object to a socket. I have tried the following code: python -c "$(cat << 'EOF' import socket import json ...
0
votes
0answers
19 views

Process Being Killed due to low swap

I'm running a python (2.7) script on mac osx yosemite. The script is fairly computationally intensive, certainly bumping up against my machine's RAM limitations. The computer crashes and restarts ...
2
votes
2answers
42 views

Clone Python from one linux machine to another

I want to run some of my python scripts on my new Linux (Centos 6.5) machine that I developed on another Linux machine (also Centos 6.5). But my problem is that my new machine is not having internet ...
0
votes
0answers
10 views

Trigger a graphic window during kickstart

I have built some custom centOS instalaltion CD with the help of anaconda and kickstart, nothing really exciting here, everything is working fine, packet are installed, pre and post installation ...
0
votes
1answer
48 views

Yum Corrupted on RHEL 6

I really need help. I am encountering the issue with my yum command. It seems to be exactly the same as the issue described on this site, Yum corrupted on CentOS 6.2, Problem importing one the python ...
0
votes
0answers
35 views

Opening a TCP port in Linux

I am trying to establish a TCP socket between my linux server and my client running on my laptop. The TCP server code I am running is, from socket import * HOST = '' PORT = 1999 ...
2
votes
0answers
17 views

Can I connect to Multiple Bluetooth devices using a Bluetooth dongle?

I am using a usb bluetooth adapter on my PI 2 , which communicates to an arduino using HC-06 Bluetooth module. This script runs to connect to that module: #! /usr/bin/python import serial from ...
2
votes
0answers
25 views

Catch/diagnose user process being killed - Inexplicably logged out automatically

Context: I'm using bash in Mac OSX Yosemite. Problem: I'm executing a (python) script that I expect to use alot of resources and take a few hours to run, redirecting stdout and stderr to a log file. ...
0
votes
0answers
20 views

Does python has a Key Derivation Function (kdf) module used in Wifi Protected Setup (WPS)?

I have tried browsing python's documentation website to determine if there is a Key Derivation Function (kdf) module. The kdf is a function used in the Wifi Protected Setup (WPS) to generate keys for ...
-1
votes
0answers
12 views

So long time on compressing with subprocess on python [closed]

I'm doing a gui compressor on python as a school task and I used the following code to compress: def crea_arxiu_3(): f = open('fitxers.txt','w') for i in range(llista2.size()): ...
1
vote
0answers
20 views

Create new TCP Connection for every http requests in Python [migrated]

For my college project I am trying to develop a python based traffic generator.I have created 2 CentOS machines on vmware and I am using 1 as my client and 1 as my server machine. I have used IP ...
1
vote
0answers
31 views

Why won't my python scripts run without the python command when moved from Windows to Linux? [duplicate]

I have some Python files that I wrote on my Windows PC and then sent over to a Linux machine using pscp. They work as intended on Windows, but when I try to execute them on the Linux machine, I always ...
0
votes
0answers
22 views

Control TCP Connections in Python

For my college project I am trying to develop a python based traffic generator.I have created 2 CentOS machines on vmware and I am using 1 as my client and 1 as my server machine. I have used IP ...
0
votes
0answers
38 views

CentOS: Connection reset by Peer error while running python script

For my college project I am building one traffic generation tool using python. I have developed my own linux server and client on Vmware. I am using urllib2 for traffic generation in python. The ...
0
votes
0answers
25 views

How do I get Ubuntu to use Anaconda's python instead of the standard /usr/lib/python…?

I installed Anaconda using instructions provided on the main website, which are similar to those that can be seen here: http://askubuntu.com/questions/505919/installing-anaconda-python-on-ubuntu ...
2
votes
2answers
36 views

check “newness” / “is-read” of /var/spool/mail/$USER like pam_mail for custom motd script

How can I check with bash or python (preferred) if there are some unread mails in /var/spool/mail/$USER like pam_mail does? I'd like to use this for my own custom motd script, motd.dynamic
0
votes
0answers
23 views

Local system doesn't forward to intended port defined in OpenShift proxy app

I've set up a proxy server via OpenShift based on this tutorial and used a few days by forwarding my local system's ports to remote app's ports: $ rhc port-forward AppName The result in the proper ...
0
votes
2answers
46 views

How to execute unix “jobs” command in python environment

I want to know currently running background process by using unix "jobs" command in python environment. I tried using import os os.system('jobs') but it not works for me
1
vote
1answer
68 views

uninstall Python installed by compiling source?

I installed Python 2.7.9 on Ubuntu 14.04 by compiling its source, by .configre, make, and make altinstall. make altinstall is because I don't want to overwrite the default Python 2.7.6. My self ...
0
votes
3answers
29 views

How can I set up using a different version of Python from the OS?

my OS (Ubuntu 14.04) uses an older version 2.7.6 of Python as /usr/bin/python which points to /usr/bin/python2.7 I installed a new version 2.7.9 of python as /usr/local/bin/python2.7. In my own ...
3
votes
2answers
95 views

how to execute a bash command in a python script

How can I launch a bash command with multiple args (for example "sudo apt update") from a python script?
0
votes
1answer
35 views

Adding commands in a shell script to add a python module path

I want to modify a linux shell script used to install a python module (setup.sh) to add the folder the an environment variable. This is needed so I can run the python module from a terminal. e.g. ...
1
vote
1answer
31 views

Enable cursor keys in python shell over ssh

I run OpenElec on a Pi. I can ssh to the Pi and open a python shell. How do I enable the cursor keys to work like up getting to last command in the python shell, like it does on my Ubuntu box. Now ...
1
vote
3answers
50 views

Simple install script says it is unable to locate package

This install script is giving me the error Unable to locate package for most of the programs. #! /bin/bash apps=( 'python-dev', 'python-pip', 'python-numpy', 'python-scipy', 'python-matplotlib', ...
-2
votes
1answer
47 views

How to parse json output through shell / Python [closed]

I am running a curl command which gives me json response. Now I want to parse the response output to get the keys and corresponding values from the output or getting value for a particular key. I ...
0
votes
0answers
20 views

Do I have support for python in gdb or not?

I've been following this tutorial which requires running gdb with python support but I get following message: ┌─[wakatana@~] [63 files, 178Mb] └──> gdb --python gdb: unrecognized option '--python' ...
0
votes
1answer
33 views

Installing python library matplotlib on RedHat for second python installation

I can't seem to find documentation on this. Matplotlib says to run: sudo yum install python-matplotlib which installs all the dependancies and this version of matplotlib successfully: ...
-1
votes
0answers
34 views

Proper python development habits under Debian

I've learnt python with IDEs under Windows and after switching to the traditional text editor/terminal couple under Linux I'm lacking two main things which made life easier. First, I used to press one ...
1
vote
1answer
39 views

Install newer & older versions of python on debian?

How can I install extra versions of python on Debian (jessie). On Ubuntu I can use the "deadsnakes" PPA which will give me any python version I want, with the version name in the command (e.g. ...
0
votes
0answers
46 views

running a python script in termin os x

I do not know why but I cannot run a python script though the terminal. my script: define_regions.py print "Hello World!" print "Hello Again" print "I like typing this." print "This is fun." print ...
-2
votes
2answers
69 views

How can I find the name of my Network Interface [closed]

I have a project that requires me to scan the local network. I found a program on the internet that allows the local network scanner condition, but I brought the gold @ IP argument in my network ...
0
votes
0answers
25 views

Using pyenv with sqlite3

I'm trying to install Python via pyenv and I would like to compile it with SQLite. I understand that this requires libsqlite3-dev or similar, but I don't have root access on this machine. I ...
0
votes
0answers
31 views

Sign a soap message from a JKS dynamically using Python Unix

I am currently calling a webservice using Curl command from unix . I have a requirement that I have to dynamically message sign the soap request every time I make a call to the webservice using my ...
1
vote
3answers
60 views

Do I have multiple python on my computer? and how to uninstall one of them?

I encountered the problem that pip install - U numpy did not update the numpy version in python, which is similar to ...
0
votes
1answer
62 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 'Kismet Scan' #clearlogs = subprocess.Popen('rm -r /var/log/kismet; mkdir /var/log/kismet', ...
0
votes
2answers
42 views

How do I correct the path for pip?

I'm trying to get pip to point to a different install rather than the default. It is currently pointing to /usr/bin/pip, but I want it to point to /usr/local/bin/pip. I believe I have the path set ...
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 ...
1
vote
0answers
37 views

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

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
25 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
67 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
102 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
1answer
22 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
51 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
36 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
44 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
114 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
142 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
53 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
81 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
51 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... ...