Python is an interpreted, general-purpose high-level programming language whose design philosophy emphasizes code readability.
0
votes
0answers
11 views
Systemd: How to start/stop Python script that should run in background, inside Virtualenv
On my Raspbian machine, I want a successful OpenVPN connection to my VPN provider to initiate a Python script, that persistently should run in the background as long as the VPN connection is active. ...
0
votes
0answers
14 views
python virtual environment
I have to install python package locally/globally on a machine using pip, so for I do not want to install pip on local machine. I can successfully create a new virtual environment using
easy_install ...
2
votes
0answers
25 views
DD-wrt serial messages
Since I recently bricked my WDR3600 by accidentally flashing wrong firmware with mdt I had to do some soldering to make serial work.
Since the window to entering bootloader cmd was really short I ...
-2
votes
0answers
15 views
How can I make these improvements to this code [migrated]
I want to improve the code below so if the user types in an integer in the name question an error alert message tells the user to input there name again not integer. In addition how can I can a code ...
0
votes
1answer
18 views
Python psutil version conflict for Terminator on Centos 7
This issue started after latest updates installation, probably in last 2-3 days.
When I try to open Terminator I get error,
Traceback (most recent call last):
File "/usr/bin/terminator", line 23, ...
0
votes
1answer
14 views
Trying to get .py scripts running through apache (mod_python)
All the tutorials say to look for <directory...> </directory>, but
I cannot find this in my default 000-default.conf (on my raspberry pi).
Can someone explain what I am supposed to do? All ...
0
votes
1answer
45 views
How do I calculate the column percentage of a file?
I have a tsv file that contains some values. I want the sum of each column and total number of values and percentage values.
Eg:
file.tsv contains
x 1 1 0 1 x x 1 x
...
1
vote
0answers
10 views
Fatal Python error: pycurl: libcurl link-time version is older than compile-time version
When updating yum via sudo on our (Amazon Linux) server, I get the following error:
Fatal Python error: pycurl:
libcurl link-time version is older than compile-time version
I find the following ...
1
vote
0answers
18 views
Start my webpy server using supervisor
I am trying to start my python web.py server at boot, but I am having difficulties getting it running by itself.
I have a config-file like the following. It's basically the sample file with an added ...
0
votes
2answers
29 views
How to compile C Extension for Python
I am attempting to install https://github.com/lthiery/SPI-Py (on a Raspberry Pi running Raspbian)
by running sudo python setup.py install
This fails with error
spi.c:20:20: fatal error: Python.h: No ...
-1
votes
0answers
3 views
lp only prints blank page without fit-to-page option
I am trying to print graphs made with matplotlib and saved as pdfs. With only lp file.pdf a blank page prints. With lp -o fit-to-page file.pdf then the graph prints but its obviously the entire page ...
0
votes
0answers
15 views
Terminator installed via Homebrew “Incompatible library version”
I've installed Terminator from the homebrew/gui tap, but when I ran it, it raised this error:
You need to install the python bindings for gobject, gtk and pango to run Terminator.
I edited ...
0
votes
0answers
21 views
Enabling Yum Repos in Python
I have a set of scripts that automatically downloads packages from yum using the internal Python bindings on Centos 7. These work fine until I need to enable a repo during a package download. I've ...
1
vote
0answers
25 views
How to use a tty as a sound device for pjsua?
I have a bi-directional PCM device that appears as /dev/ttyUSBxx. It provides and consumes 16-bit linear PCM at 8KHz (though that can be changed to u-LAW or a-LAW). I would like to use the device in ...
1
vote
1answer
47 views
How / Is it possible to install python in a portable way?
I'm working on a python script which takes care to migrate a mysql database with a certain schema / structure, into a postgresql database with a different structure.
During the development phase I ...
0
votes
2answers
59 views
How do I install Python in Linux with no Internet access?
Part 1
I have CentOS with no Internet access. I have a docker container based on Ubuntu. I want to install Python inside the Docker container. I downloaded some .deb files for installing Python ...
0
votes
1answer
16 views
Pitfalls to symlinking python2.7 to python?
I have a CentOS 6.7 machine with the "system" python (2.6.6) installed from an RPM at /usr/bin/python. We installed an additional version installed from source (2.7.11) used for development purposes ...
0
votes
0answers
55 views
Write to terminal in Tkinter GUI
I am trying to show the changes in the command line in real time in my Tkinter GUI, I managed to create the GUI and integrate the terminal into it, but I cant bind the buttons with the terminal, my ...
0
votes
0answers
28 views
can't run any python 2 programs due to encoding error
After a system update, I'm not able to run any python 2 program. I get the error.
UnicodeDecodeError: 'utf8' codec can't decode byte 0xf6 in position 203: invalid start byte
python3 says it uses ...
0
votes
0answers
6 views
Removing items in one array based on whats in another array - python [migrated]
I'm trying to make a function that removes items from all_cards based on whats in the iss_answer array. My iss_answer array will change often in my program so I can't just type ...
0
votes
0answers
23 views
Email user temporary code access code when using ssh
I am looking for a way to create my own two factor authentication for ssh. After the user enters the correct login info I would like the terminal to send an email to the user that contains a code ...
1
vote
0answers
16 views
Is it possible to control socket.error timeout in an external library?
I know that if you are creating sockets directly in your code, you can specify the connection timeout. I also know that many libraries that deal with networking allow you to specify the connection ...
1
vote
1answer
30 views
How do I use GNOME Keyring with Python Keyring in virtual environment?
I have written a Python script that I would like to run in the background on my Raspberry Pi. The script makes use of the Python module Keyring (link), which is used to access a keyring backend to ...
0
votes
1answer
10 views
Create Multiple libvirt Volumes From One XML File
I'm using libvirt's virsh vol-create command to create multiple volumes. I've started using Jinja2 templates to help with automating the task for a specific application. In my case, it would help ...
1
vote
1answer
58 views
No module named yum
I am facing errors while running any yum commands on centos 7 system
No module named yum
Please install a package which provides this module, or
verify that the module is installed correctly.
It's ...
-2
votes
1answer
29 views
Online state change
Are there ready script in bash or python which pings target and reports only online state change? Also would nice to have average time between failures.
0
votes
0answers
23 views
How to install PyGUI for Python3?
I want to install PyGUI for Python3 on Fedora 23.
From PyGUI:
Linux - requires pygtk (tested with pygtk-2.14.0 and Gtk+-2.14.7).
And by going to PyGTK it says:
Note: New users are ...
3
votes
3answers
51 views
Creating a self-contained installation file for pymssql for CentOS
I'm trying to deploy a Python application on a machine that due to system and organisation requirements can't have gcc installed on it, so I need to create a self-contained installation file for ...
0
votes
0answers
25 views
Thumbor ImportError: No module named thumbor_plugins.optimizers.pngcrush
I'm strugling to properly install Thumbor on a server.
I made my regular installation. Tested working at that time (Centos 7, Python 2.7.5)
I setup supervisord to manage a deamon for thumbor
I got ...
-1
votes
3answers
69 views
Shell scripting : want to login on some server, which are in same domain and execute command and exit
I have 10 unix servers, I want to log into them one by one, execute 4-5 lines of code, save the output and exit.
For Example: 10 serves:
Intially at xyz server
Login in server 1 --> execute 4-5 ...
1
vote
2answers
30 views
Wait until gnome-terminal ends
I'm trying to implement a script who runs four terminal window in parallel using this function gnome-terminal -e sh -c "python scraper.py".
I would like to know if there's a way to wait until each ...
0
votes
0answers
22 views
Installing specific version of python and its dependencies in chroot enviroment
I'm trying to install python from source on chroot environment in CentOS 7.1, If I'm using ./configure --prefix=/chroot but I need to find the dependencies and copy them to chroot directory also, How ...
0
votes
1answer
21 views
Unknown media type error while installing
I'm trying to install gmate on fedora 23
First, it require some packages: pywebkitgtk, python-sexy, python-inotify and ack
Installing them without any problems:
[root@host gmate] # dnf install ...
0
votes
1answer
31 views
Centos 5.11 No module named yum [closed]
I'm running Centos 5.11 and I installed python 2.7 (replacing 2.4) I soon found out that yum won't work with 2.7, as expected if I put python -V it shows Python 2.7.
My classmate did a snapshot of ...
0
votes
0answers
100 views
Upgrading python to 2.7.11 on Ubuntu 14.04
I've been trying to upgrade my python to 2.7.11 or 3.4 (the latest one) but I'm having doing so. I followed the guide here:
Upgrade to Python 2.7.11 on Ubuntu 14.04 LTS
Everything completes fine but ...
1
vote
0answers
30 views
Running Python application on boot through init.d script
I am trying to start an Python application on a Debian based OS that is running on a router. This application comes prebundled with site-packages and a python binary. Like a virtual environment. The ...
-1
votes
1answer
28 views
Need some support on Python for string append/replacement
I am writing a python script to replace/append certain strings with their equivalents..
Actual string:
Name = "com.icon.t2p"
Object = "/com/icon/t2p/host"
Expected Output :
Name = ...
0
votes
1answer
26 views
Which is more expensive, shell command or manipulating file in python?
docker ps which gives the LIST of running dockers with <ID> <name> <port> etc.
We can get the same info in /var/lib/docker/containers/<ID>/config.json. (Here ID is same in ...
0
votes
2answers
29 views
placing words corresponding to a key in a singe row
I have a symbol table of the form (key-value pairs)
01 aaluu desii
01 aaluu cipsa
01 amaruuda ilaahabaadii
02 hai
02 nahii
02 txamaatxara
To start with, I am supposed to place ...
0
votes
1answer
52 views
Jenkins, Python and root
I am trying to run Python unittest as part of a Jenkins build. My build was failing as follows:
+ export ...
1
vote
0answers
28 views
how to find default SMTP server name?
I have a python script which uses smtplib to send out an email. I am not sure what to use for mail server name in the smtplib.SMTP initialization.
On my test server I use the below and it works fine.
...
0
votes
3answers
34 views
Extract Strings from Web Log file
Given a file containing web access logs for a YouTube video, every line is a hit and is in the format.
62.172.72.131 - - [02/Jan/2003:02:06:41 -0700] "GET /random/html/riaa_hacked/ HTTP/1.0" 200 ...
1
vote
0answers
40 views
Python installation fails in chroot
I tried to install Miniconda Python in a chroot:
chroot $1 wget -q https://repo.continuum.io/miniconda/Miniconda3-3.19.0-Linux-x86_64.sh -O /tmp/miniconda.sh ...
0
votes
2answers
24 views
Program run from udev cannot open a window [duplicate]
I have a script, written in python:
#!/usr/bin/python3
from tkinter import messagebox
variable = messagebox.showinfo('title', 'question')
This python script does nothing else than showing a message ...
1
vote
2answers
29 views
Program cannot resolve host name if it's started before first successful internet connection
This is related to a stackoverflow post I posted.
Basically I have a Python script that I'm running on an embedded system (Buildroot-based). The python script runs on startup, but I cannot guarantee ...
1
vote
1answer
19 views
Set maximum number of processes started by incrond
I am using incrond to monitor a directory for incoming files. After each file arrives in the directory a python script is called to process it.
A problem arises when the rate of incoming files is ...
0
votes
0answers
48 views
uwsgi , application not found
Ok so I have been trying to find a solution to this for 2 days now but I cannot seem to make much progress. I am running this on a nginx server but that appears to be fine.
I copied over a python ...
1
vote
1answer
38 views
ImportError: No module named '_struct' when installing setuptools
I've installed separate Python versions on Centos 6.7 using the instructions listed here, using a local install (not my package manager).
When I tried to install [setuptools][2] (e.g. python3.5 ...
3
votes
1answer
58 views
Permission denied error without ssh connection
I have an Ubuntu 12.04 server which runs a python application. The application is started manually in tmux or automatically when the server starts.
Application processes http requests from android ...
19
votes
5answers
3k views
Why is there an EOF in the middle of the arguments?
I wanted to write a little bash function such that I can tell bash, import os or from sys import stdout and it will spawn a new Python interpreter with the module imported.
The latter from function ...