Python is an interpreted, general-purpose high-level programming language whose design philosophy emphasizes code readability.
0
votes
1answer
16 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 ...
0
votes
0answers
15 views
Problem executing python script under zsh
I have recently installed Deepin Linux which as zsh shell as its default. I need to execute python programs but I can't. I know how to run them under bash. But under zsh when I use chmod and make the ...
1
vote
1answer
10 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 ...
1
vote
1answer
16 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
25 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
2answers
40 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 ...
-1
votes
0answers
13 views
How to fix Python ValueError:bad marshal data? [migrated]
Running flexget Python script in Ubuntu, I get an error:
$ flexget series forget "Orange is the new black" s03e01
Traceback (most recent call last):
File "/usr/local/bin/flexget", line 7, in ...
0
votes
1answer
25 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
18 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
33 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 ...
3
votes
2answers
31 views
How to locally install .deb without apt-get, dpkg or root access?
I'm using python on a Linux cluster (without root access) and want to use the numpy module. After downloading numpy from Numerical Python, extracting and trying to install it with:
python setup.py ...
1
vote
2answers
39 views
Invoke python script through make command
I have a tool with 5 python scripts say A.py, B.py, C.py, D.py and E.py. I have to run this program in Linux. A.py is the one program I run which imports other files and uses them. For running A.py, I ...
4
votes
0answers
6 views
How do I activate Xorg record module on Raspian?
I'm trying to automate some tests on my RaspberryPi and I'm using python's pymouse to perform some emulated clicks. On my Debian it works fine, but when it comes to Raspian it keeps failing with this ...
0
votes
1answer
49 views
How to catch first line of stdout from bash process substitution?
I am working with the following block of bash and it is not printing out the first line of expected output:
exec 3< <(python3 -m http.server)
while true; do
read -t 2 line
...
0
votes
0answers
44 views
python install on linux RHEL5 - GCC 4.1.2-52
I used the following guide from the Beyond Linux From Scratch SVN Book, not knowing that my distribution was actually RPM Based (see comments), and now I am getting the following error during python ...
2
votes
1answer
25 views
preventing dpkg-buildpackage using /usr/bin as installation destination
Briefly, I am building a Debian package. Everything works fine with packaging except the point, that after packaging my application is always in the /usr/bin folder.
It's actually a Python ...
1
vote
1answer
67 views
Installing DevedeNG in kali linux, but missing python dependency it says is already installed
As you can see in the picture it says dependency is not satisfiable, but when I try to install the latest version of python3 the command prompt tells me i have the latest version installed.. Any ...
1
vote
2answers
50 views
How can I install youtube-dl on BOSS linux?
I try to install youtube-dl on BOSS Linux by following commands. $ sudo add-apt-repository ppa:nilarimogard/webupd8
$ sudo apt-get update
$ sudo apt-get install youtube-dl
$ sudo pip install ...
0
votes
1answer
51 views
What changes to be done in Python file when Makefile is being used?
I have a set of python class files. I run the MainProgram.py on the linux as python MainProgram.py which uses the rest of the class files.It reads from an input file and write an output file.
Until ...
2
votes
1answer
46 views
How to monitor the opening and closing of files?
I'm writing an AI personal assistant. One part of the software is a monitor daemon. A small process that monitor's user's active windows. I'm using python( with libwnck and psutils for obtaining info ...
0
votes
0answers
18 views
Running lpr through command line and through python different outcome
When I run lpr <filename>.jpg the file prints out boderless (this is what I want).
When I run subprocess.call("/usr/bin/lpr " + tmp.name, shell=True) from a Python program, it prints out with ...
0
votes
1answer
33 views
systemd daemon & python getting the wrong time
I made a daemon that it is started by systemd, and inside my daemon I have a python function to get the time. The problem is that the time is wrong, I have 8 hours of difference.
This is my service ...
0
votes
1answer
30 views
Fixing a broken PYTHONPATH environment variable
I recently installed some software, which required python to operate. For some reason, it installed its own version of python, and modified the PYTHONPATH variable. Now, when I attempt to import a ...
0
votes
1answer
37 views
Packages Containing 'dfsg' in Version Number Causing Issues
I am running the same Python software under both Mint 13 and Mint 17.1 – both are 64-bit. Prior to 64-bit operation the software was running on Mint 13 32-bit. On 64-bit Mint 13 everything works as ...
0
votes
1answer
56 views
Fix version issues of Python on CentOS 6.6
I'm very new to Linux and Python as I am an intern, please bare with me. If I'm missing something then let me know I can update the post.
I installed python 2.7.9 under a users directory on centOS ...
2
votes
2answers
31 views
stderr gets flushed before stdout, when using file logger
My python code:
import sys
print "i am a daemon"
print "i will be run using nohup"
sys.stderr.write("i am an error message inside nohup process\n")
When i run the code as python a.py, it shows,
i ...
1
vote
1answer
47 views
Can't use Python3 Package Installer
I successfully installed Python3's Pip and SetupTool packages by:
sudo apt-get install python3-pip
but when I try to download/install any package for Python3 by:
pip install <package-name>
...
0
votes
1answer
198 views
pip install gives “TypeError: 'int' object is not iterable ”
In Debian testing, when I try to install the python package python-constraint via
pip install python-constraint
I get the following error;
Exception:
Traceback (most recent call last):
File ...
4
votes
0answers
36 views
How to declare accented variables in Python [migrated]
I need to write few basic scripts for students in Python, like this one:
#!/usr/bin/python
# -*- coding: utf-8 -*-
mia_età = 31
print mia_età
But apparently I cannot use accented characters while ...
0
votes
0answers
44 views
Run Git Pull from a shell start-up script
I have raspberry-pi that loads a shell script on start up.
This script runs a python script 'boot_camera.py' which is found in a repository.
I Have a server which sends the raspberry-pi a command ...
0
votes
0answers
17 views
Error in Python multiprocessing process [migrated]
I am trying a write a python code having multiple processes whose structure and flow is something like this:
import multiprocessing
import ctypes
import time
import errno
m=multiprocessing.Manager()
...
1
vote
1answer
42 views
Url Decoding shell script
How can I store the url-decoded string in a variable using shell script
#!/bin/sh
alias urldecode='python -c "import sys, urllib as ul;print ul.unquote_plus(sys.argv[1])"'
...
1
vote
0answers
27 views
How to use vim-slime from within a single tmux session?
I'm trying to integrate ipython and vim through a single tmux session using the popular vim plugin "vim-slime." The problem is that while I can get it to work fine provided that vim is opened in a ...
0
votes
0answers
47 views
Centos 7.1.1503 no longer has some static libs that python packages assume are present
I ran repoquery -ql readline-devel and it revealed that only various .so libs are a part of this repository.
/usr/include/readline
/usr/include/readline/chardefs.h
/usr/include/readline/history.h
...
1
vote
1answer
32 views
How do I make Python plugins work in Pluma?
I'm trying to add the Python plugin trailsave to the text editor Pluma* (which is a Gedit fork) but the plugin doesn't show up in the "Active plugins" list in the Pluma preferences. Also, I have ...
1
vote
0answers
25 views
setting up pycurl for embedded ARM
I am working on a linux x86_64 machine, and I am trying to set up pycurl for an embedded ARM processor running petalinux. I need pycurl library before building the embedded linux image. I have ...
0
votes
2answers
60 views
Service start fails after Capistrano2 deploy task
Below is a part of the /etc/init.d script that controls a daemon. The full init.script is available at http://pastebin.com/02G5tpgH
case "$1" in
start)
printf "%-50s" "Starting ...
1
vote
0answers
16 views
Passing a parameter to a dstat plugin
I wrote a simple plugin (dstat_externalBackup.py) for dstat to monitor the filesystem free space and placed it in /usr/share/dstat and it works as intended.
€ dstat --externalBackup 3600
extern
free ...
2
votes
1answer
76 views
Compiling Python 3.4.3 error
I have been trying to update Python 3.4.3 from source, but each time, during the ./configure command, I get an error in the configure.status
> configure: checking for device files checking for ...
2
votes
2answers
124 views
How to list all object paths under a dbus service?
This is a follow-up question to A list of available DBus services.
The following python code will list all available DBus services.
import dbus
for service in dbus.SystemBus().list_names():
...
13
votes
3answers
2k views
Why does python still work after being removed?
On Debian 8 jessie I've removed python:
perry@perry:~$ sudo apt-get remove python
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'python2.7' ...
0
votes
0answers
37 views
QtPy5 on Raspbian, getting ImportError: cannot import name QtCore
I need to be able to use the latest WebKit that includes WebRTC support
How do I install Qt5+QtPy5 on Raspbian?
What I have tried so far...
Installed Qt5 on RPi2 - PASS
Native build Qt5 on RPi2 ...
0
votes
0answers
8 views
Pip managed python extending distribution packaged modules
I am looking for recommendations on extending the python library managed by my arbitrary distribution with packages available via PPI. Basically I have been working with a distro managed installation ...
0
votes
1answer
28 views
Debian Lenny Adafruit_BBIO failure to install
Im sorry if i have this in the wrong forum, but im not sure where to put this. Google Groups is going to be too slow in a response (They are where i posted to first). I have Debian Lenny installed on ...
1
vote
2answers
44 views
IPython Qt Console doesn't have a title in GNOME app switcher
When I use the app switcher in GNOME 3.16, the IPython Qt Console (version 3.1.0) doesn't have a title under its icon (see image, and compare with Chromium). I also noticed that the icon doesn't ...
0
votes
1answer
50 views
Log output from more than one script
I have a problem concerning the logging of a process:
I have 3 scripts, a.py, b.py and c.sh
a.py calls b.py and b.py calls c.sh
The goal is to continuously log std out/err (write to file and ...
0
votes
1answer
45 views
Crontab giving no result
I have set up a cronjob on my server which is supposed to run every minute and store the output in the given file. I have been trying a lot and saw a lot of links but nothing seems to work. Following ...
2
votes
1answer
66 views
Convert TeX accents to UTF-8 in Python
edit below
First of all, I am quite sure this is a duplicated question. But I have no idea how to search for it. I spent quite a long time already.
I am reading with python from a .txt file the path ...
0
votes
0answers
17 views
Can I update python within a user scheme?
I'm running python on a shared server without root access.
I've installed pip using the user scheme which allows me to install the packages I need.
I can't find any documentation on how to do an ...
1
vote
2answers
65 views
Installing VIM with Python support locally without sudo
I'm trying to install VIM with Python support on Linux without sudo, but for some reason VIM always gets installed without python ( -python in vim --version )
I first installed Python locally by ...