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

learn more… | top users | synonyms

1
vote
3answers
122 views

what could be the reasons for shell scripts kill itself?

I have shell scripts like #!/bin/bash while true;do #Code HERE! #Pushing Data to DB echo "Data to DB"> /root/schip.log 2>&1 done This is script is continuously running and ...
1
vote
1answer
71 views

What does Requires: Python(package) do for RHEL spec files?

I'm packaging some Python packages currently without RPMs, and some of those depend on others that I'm packaging. While packaging I noticed a format where people do: Require: python(pkg-name), but ...
5
votes
5answers
25k views

Execute shell commands in Python

I'm currently studying penetration testing and Python programming. I just want to know how I would go about executing a Linux command in Python. The commands I want to execute are: echo 1 > ...
0
votes
0answers
130 views

why md5 encrypted password insert into php ldap admin extra {md5}

I am using python script to inter encrypted password into php ldap admin but the problem I am facing is LDAP add extra {md5} before the encrypted password, I simulated the code by creating two files ...
-2
votes
1answer
44 views

What is posix, and how can I elevate my permissions using python? [closed]

I was wondering if I could elevate my permissions on a chromebook with the os posix using a python script. I was not given the administrative permissions when I was given the laptop for college.
2
votes
2answers
81 views

Is it possible to pass arguments into a Python script?

I know how to pass arguments into a shell script. These arguments are declared in AWS datapipeline and passed through. This is what a shell script would look like: firstarg=$1 secondarg=$2 How do I ...
0
votes
2answers
48 views

How to install python on debian? [closed]

I'm new to Linux, so I don't know a lot of things, and I want to know how can I download and install python on my linux VPS (with SSH access).
0
votes
1answer
86 views

Encountered “error: command 'c++' failed with exit status 1” while trying to install pymedia in ubuntu

I'm trying to install pymedia in ubuntu to run scripts using python 2.7. So, I tracked down the dependencies and got them installed : sudo apt-get install python-dev libogg-dev libvorbis-dev ...
0
votes
0answers
15 views

I want to merge CSV files to one Excel workbook in different sheets. I want each file in one sheet with the CSV file name as sheet name [duplicate]

input: 1-example.csv a b c 2-example.csv 1 2 3 output: output.csv/.xls sheet1-data(1-example.csv) sheet2-data(2-example.csv) a 1 b ...
2
votes
1answer
79 views

Why do I have so many python versions on my mac?

I'd like to get into scipy and first setup my macbook air for python development. The problem is I have many different versions of python installed - here is what I get when bash autocompletes "pyth": ...
0
votes
0answers
197 views

Python 3.4 & 3.5 glitch

I recently installed Python 3.5 from source code on elementary OS Freya. Without removing Python 3.4. For some time things ran fine, later they turned nasty. for example pip installs the packages at ...
1
vote
1answer
55 views

`man` pages for languages other than C (e.g, python, R, javascript, etc)?

man pages are a phenomenal resource while programming in C on Linux. While looking at someone else's code, if you see something foreign you can immediate research it in another terminal with $ man 3 ...
1
vote
0answers
293 views

Why Python cant import OpenSSL

I created a virtual env for a matrix home server installation on a shared hoster. $ virtualenv -p python2.7 /home/tristank/venv/synapse $ source /home/tristank/venv/synapse/bin/activate I installed ...
0
votes
2answers
139 views

How to check if a module or a package is already installed in python3?

Need to verify whether it is installed or not before the program can run.
0
votes
1answer
33 views

Terminal Software to add Watermarks to Videos?

I have a bunch of videos, 12,000+ a month. I would like to add a watermark to all of them, like a logo with our website. Is there any software I can use on the Terminal to do this? Ideally I'd like ...
1
vote
1answer
708 views

Running a python script 200,000 times in parallel using bash [duplicate]

I need to run my Python script 200,000 times. Is it possible to do parallel execution using bash? Since it's 200,000 times I would like to use at least 10 threads simultaneously
1
vote
3answers
856 views

Copy and get files from one machine which is connected via ssh to another one

I read a lot of answers to questions very similar to this one, but I couldn't find something that really fits my problem. Here's the situation. I have a machine whose address is "machine1@address", ...
1
vote
2answers
56 views

If I want to create a GUI which displays exactly the same data as TOP command does in LINUX, where do I get the data from?

I found out that I can get the PID(first column) from the /proc/[pid]/stat file, first column. I am not sure where can I find the rest of the attributes. And my guess is we need to calculate the %CPU ...
0
votes
1answer
78 views

How do I clean up vi and reinstall it completely? [closed]

Basically when I try to run vi, I have the following error (and after open it, there are a lot of errors): Error detected while processing function UltiSnips#bootstrap#Bootstrap: line 35: Traceback ...
0
votes
1answer
483 views

How to fix “cannot find -lxml2” error while installing 'igraph' for python?

On Ubuntu 15.04 I am trying to install 'igraph' using the following command: pip install python-igraph in order to, well, use the igraph package in python to work with graphs and stuff. However, ...
2
votes
1answer
1k views

PIL install error: SyntaxError: Missing parentheses in call to 'print'

I am trying to install PIL (the Python Imaging Library) using the command: pip install PIL --allow-unverified PIL --allow-all-external seeing the following errors: gkhan@Gkan ~ $ pip install PIL ...
1
vote
2answers
414 views

How can I switch between Python 2.7 and 3.4 that are installed on Debian 8 (Jessie)?

I'm using Debian 8.2 (Jessie), and have both Python 2.7 and 3.4 installed. Python 2.7 is the default and that's what is used when I run a Python script or interactively in the Terminal. How can I ...
1
vote
1answer
296 views

Run a Python script in the background on boot

I recently installed the Google App Engine Development server on my FreeBSD home server to be able to test my GAE app remotely. What I can't figure out is how to run the Python development server as a ...
4
votes
1answer
103 views

Where is the default device name (e.g. /dev/ttyUSBx) specified?

I'm investigating dynamic device name mapping via udev. The goal: On a multi user system, each user can allocate and free devices like usb-serial converters or PCIe cards (FPGAs). If an user ...
0
votes
1answer
82 views

How to import self made modules in Python on Ubuntu 15.04

I just moved from windows 8 to Ubuntu 15.04. I do some programming in python3, and some programs rely on imports from self made modules. In windows all I had to do was add the directory which contains ...
1
vote
0answers
27 views

The first click on Linux Mint menu does not open it

I noticed that the first click on the menu after rebooting or turning my computer on does not open it, I must click again to actually show it. I use LMDE with MATE. I have followed the instructions I ...
2
votes
0answers
77 views

Why is denyhosts not banning *some* brute force root SSH login attempts?

I recently noticed in my logwatch emails from a couple of servers that although denyhosts was doing its job for some brute force root ssh login attempts others seem to be ignored and continue to ...
1
vote
1answer
653 views

LD_LIBRARY_PATH ignored by Python 2.7

I'm trying to install Theano on a box for which I have no root access and it looks like that LD_LIBRARY_PATH is ignored by my installation of Python 2.7. Since I can't install packages at the system ...
1
vote
1answer
24 views

How is python invocation different when launched by Nagios nrpe?

When invoked with python2 after importing os and sys, the following function runs successfully but acts incorrectly when invoked by Nagios nrpe: def get_proc1_open_files(): # Set proc1_children ...
0
votes
1answer
88 views

Why are the bytes I'm receiving not the bytes I sent?

I've been working my way through a security games site, trying to automate what I'm doing using pwntools. I've come across a problem somewhere in my process, however. When I try to run the vulnerable ...
1
vote
0answers
121 views

How do I use the Python module “keyboardleds” to determine Caps Lock state?

I want my system to ascertain the state of Caps Lock (is it on or off) by inspecting the keyboard DIRECTLY. After much searching, I understand that this can be done in Python by using the module ...
0
votes
0answers
119 views

permission needed for Python to access USB drive?

I got this Python script that reads media files from USB stick. It used to run fine, today it keeps giving me OS Error: [Errno 13] Permission denied: media/myName/usbName when the script runs the ...
1
vote
1answer
69 views

How do I get the pid of the exact progarm launched

So I have a couple python programs say program A and program B, when using "pgrep python" to get the pid, it gives me the pid of both program A and program B. However, I am writing a program that need ...
2
votes
0answers
42 views

How can X11 shortkeys be captured by a Python program?

I want to have a little Python program running in the background that monitors for certain shortkey presses (e.g. Ctrl Alt direction key). The idea is that these shortkeys can trigger various actions. ...
0
votes
1answer
73 views

python gnupg cannot user keychain keys

I have an issue using the gnupg module in python in Ubuntu 14. My keychain is set up correctly. I can use gpg on the command line to decrypt files with having to enter my passphrase. I have also ...
0
votes
0answers
13 views

How to avoid the python script file output in the terminal? [duplicate]

I'm in my Macintosh Terminal. I was running a python proxy script at local and everything works fine except the python script keeps throwing out all kinds of logs in my terminal. How do I avoid them? ...
0
votes
0answers
127 views

Compiling 64bit Python on HP-UX (Itanium)

I'm trying to compile 64bit Python (2.7.10) on HP-UX (ia64), as per the Python readme, but can't seem to get it to work properly. This is what I'm using. I've also removed the "-O" from the OPT line ...
3
votes
0answers
279 views

ViM and Python says the encoding is ANSI_X3.4-1968

In ViM, the following command (using Python 3.4.3) outputs ANSI_X3.4-1968: :!python -c "import sys; print(sys.stdout.encoding)" However, I want UTF-8 everywhere. In .vimrc, I do have set ...
2
votes
2answers
138 views

Why is mail-utils / cron sending out so many emails?

I was trying to troubleshoot why my Raspberry Pi isn't sending emails with ssmtp / mail-utils, and so I opened up my gmail account that I use for the Pi. To my surprise, there were 15k unread emails ...
1
vote
1answer
131 views

Python script works from terminal, but fails in scheduler, to write to external drive

I am trying to use a Python script to read/write from an external disk in linux, which works fine. The problem comes when I use a job scheduler to execute the Python program. I am running all this on ...
0
votes
1answer
114 views

Need script to kill python process with low CPU usage

I've created a very large and complex python program and I now know it has a serious bug that I'm having a very hard time pinning down. I'm using this code in a production environment so I need a ...
1
vote
1answer
48 views

Tell Python to use alternative library

I am trying to use an alternative version of opencv (3.0) in my Python scripts. I compiled and installed this version to my home directory, and now I am trying to tell Python to use it. I have the ...
0
votes
0answers
42 views

How to steal keystrokes instead of just monitoring them?

I am writing a program that allows controlling the mouse through keyboard. The user is supposed to assign a hotkey to start the program, which runs in the background without GUI or CLI. The keyboard ...
6
votes
2answers
78 views

direct execution of python scripts

I have noticed that sometimes python scripts are not being started directly, ie /foo/bar.py, but rather from a shell script, which does nothing else than /usr/bin/python -O /foo/bar.py $@ One such ...
1
vote
1answer
273 views

python3.4 failed to import gi

I have tried many ways to install gi on my Mint17.02. zen@zen:~ > sudo pip3 install gi zen@zen:~ > sudo python3.4 -m pip install gi Requirement already satisfied (use --upgrade to upgrade): gi ...
2
votes
1answer
60 views

python Vs bash string slicing

My file a contains the text, bcd\\\\. With bash, i read the file and print characters from 4th to 8th position as, tmp=$(cat a) echo "${tmp:3:4}" It prints, \\\\ All happy. Now i use ...
1
vote
4answers
2k views

piping python variable value to bash script (inside python script)

After years of bash scripting I've been given the task of modifying a python script to have it call a shell script when certain conditions are met. That part wasn't too bad, but now I'm trying to ...
0
votes
0answers
490 views

Cannot install pyzmq

I'm trying to install pyzmq on my Elementary OS netbook as it is a dependency for ipython notebook. The full report is at github as exceeds the stackexchange character limit. Here are the last few ...
0
votes
0answers
199 views

How to sync Google Calendar gcalcli with Conky/Desktop?

Main Question: As the title says, I want to sync my Google Calendar with the Linux Mint 17.2 desktop; preferably through Conky. I'm aware of a method using Thunderbird but I'd rather have it set up as ...
1
vote
1answer
57 views

How to install cctrlapp on debian?

I try to install the cctrl command line client on a debian 8 machine. Following the install instructions, I installed python, pip and then (via pip) cctrl apt-get install python apt-get install ...