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

learn more… | top users | synonyms

0
votes
2answers
75 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 ...
0
votes
2answers
80 views

get values which only ocurre once in the vector

there is a vector of numbers I have which ascend (it is called t8_) 2 7 8 9 11 15 34 91 91 92 94 the problem is that some number happen two times - I don't want to remove them but they have to ...
0
votes
1answer
39 views

syntax error while tring 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
24 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
3answers
5k views

Multicast UDP not working

Multicast UDP on raspberry pi I haven't narrowed things down enough to know if my issue is because of debian, raspbian specifically, or if I am just missing a something completely. I have a python ...
0
votes
1answer
878 views

qmake error when installing PyQt5

I'm trying to install PyQt5 for python3 from source files. I install SIP correctly. Then when I want to prepare the make file for installing PyQt, I get this error: #python3 configure.py Error: ...
0
votes
1answer
30 views

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

I recently got done making a python program. Now the question is, how do I go about making an installation script for it. From my understanding you need to create a make file, but from what my ...
2
votes
0answers
21 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 ...
-1
votes
1answer
26 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
41 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
95 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
26 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
398 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 ...
2
votes
0answers
450 views

avconv/ffmpeg output through /dev/ttyAMA0

I tried to pipe streaming video from video4linux2 webcam connected to a Raspberry Pi through /dev/ttyAMA0 to a computer using an Arduino as a intermediary. First of all, is it possible? Because I was ...
0
votes
0answers
21 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 how to view system,hosts, provisioning Tab(list Volumes, Virtual Volume sets, ...
0
votes
1answer
189 views

RuntimeError: You need gevent installed to use this worker

I need gevent to run docker-registry but i have this error: Error: class uri 'gevent' invalid or not found: [Traceback (most recent call last): File ...
3
votes
2answers
1k views

python3 traceback error

Whenever I mistype any command in terminal instead of getting Error:Command not found I get this python message error Traceback (most recent call last): File "/usr/lib/python3.3/site.py", line ...
1
vote
1answer
42 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 \ ...
1
vote
0answers
43 views

Is it possible to execute python script on Visual studio with Linux environment

Is it possible to execute python script on Visual studio with Linux environment For example The following python code was written on the visual studio import os f = os.popen('date') now = ...
0
votes
0answers
24 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
21 views

Unable to start Terminator in Fedora

I'm not Unix friendly user so my question could be very dummy. I installed Terminator using this command: sudo dnf install terminator After someday of using without problem, For some reason, today ...
0
votes
3answers
62 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 ...
0
votes
0answers
41 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. ...
1
vote
0answers
39 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 ...
1
vote
1answer
202 views

How to copy rows of different files and paste column-wise?

I want to create a new file by copying rows of each file and pasting columnwise according to their file name orders. Here is the sample input and required output files below. file1.txt 1234 5678 ...
2
votes
3answers
767 views

Distributions that only ships Python 3.X

Is it possible currently? I tried to remove python in Fedora 19 but yum depends on it.
0
votes
1answer
53 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
82 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
322 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
134 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 ...
1
vote
2answers
70 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
1answer
344 views

Failed installation 32-bit python on 64-bit Linux Mint

I basically have two questions: How do you install 32-bit Python alongside 64-bit Python on linux? How do I fix my broken system from the failed attempt below? I just tried to install a 32-bit ...
1
vote
2answers
62 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
1answer
86 views

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

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

OpenDNS automatic diagnostic

I've contacted OpenDNS support because advertising are not filtered on this site http://www.backpackerboard.co.nz/ They asked me to read this manual instructions ...
0
votes
0answers
293 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 ...
5
votes
1answer
4k views

How to display the name of the current Virtualenv?

I'm using virtualenv, virtualenvwrapper, zsh, oh-my-zsh, terminator, on Crunchbang. I'm trying to display the name of the current virtualenv like so workon example (example)... I've tried many ...
2
votes
1answer
214 views

Virtualenv creation seems to do nothing

I have a problem setting up a Virtualenv on my web host server (to install python modules later on) So far I tried this (over SSH): wget ...
1
vote
1answer
50 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 ...
10
votes
5answers
12k views

Why is this python error message generated whenever I type a nonsense command?

Whenever I type any "nonsense" command, this python error message is generated. Normal commands work fine. Any idea how to debug this? $ somenonexistingcommand Traceback (most recent call last): ...
1
vote
1answer
23 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
38 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 ...
0
votes
2answers
7k 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 ...
1
vote
1answer
41 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
36 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', ...
1
vote
1answer
253 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
2answers
63 views

about executing a python program in a shell script which is scheduled on crontab

i have a problem with regards on crontab. I have a script named checker.sh and i want to schedule it that would run every minute: * * * * * sh /home/pi/checker.sh so i have the script here: the ...
0
votes
1answer
51 views

Error installing scipy

I'm on Manjaro trying to install scipy in virtualenv using pip. I get this error. How to fix it?
0
votes
0answers
21 views

invoking python program for each path in makefile vapth

I have a makefile as follows: VPATH = ../../HWP \ ../../hwsv/server \ ../hwpf PROC_INPUT_FILES = abc.c \ def.c \ xyz.c MEM_INPUT_FILES = ...
1
vote
1answer
181 views

How to activate Virtualenv when a Python script starts?

I want to schedule a python script to run using cron on certain dates, the problem is that in order for example.py to work, example-env has to be activated, is there a way to make example.py activate ...