Tagged Questions
0
votes
2answers
20 views
python does not execute shell command “mail” properly
I use the following bash code to send email:
echo abc | mail -s Subject [email protected]
It works fine. Now I want to use the same command in python, so I write the following:
call(["echo abc" "|" ...
2
votes
0answers
37 views
determine where python is running from in linux [migrated]
I normally work in python on Windows and I use the dos command where python to make sure that I am using the virtual environments version of python. What is the equivalent command in the linux shell?
...
6
votes
2answers
66 views
Does Python have sync?
The sync man page says:
sync() causes all buffered modifications to file metadata and data to
be written to the underlying file systems.
Does Python have a call to do this?
P.S. Not fsync, I ...
-4
votes
1answer
29 views
Linux text editors with configurable background color [closed]
What Linux-compatible text editors offer configurable background color? I want to avoid white.
Notepad++ isn't available on Linux, and I don't want to use WINE. Emacs and Vim sound intimidating. ...
-2
votes
1answer
23 views
use a python set to report shells listed in /etc/passwd file
I need to know how to use a python set to list all the unique shells listed in the /etc/passwd file in the linux filesystem. This will be executed in a python shell from the command line.
0
votes
2answers
18 views
Executing commandline commands from Python using subprocess module
I am trying to use the subprocess module in python and trying to fetch the process id of firefox
cmd = "firefox &"
fire = subprocess.Popen(cmd,shell=True, stdout=subprocess.PIPE, ...
0
votes
0answers
21 views
Verify signature of PKCS#7 signed file using Python
On Linux, I need to verify the signature of a PKCS#7 signed file and retrieve its original contents using Python and its standard libraries.
Currently, I can verify the contents of this file (and ...
-1
votes
2answers
42 views
trap command used to protect a file from Alt + f4
I want to know whether Trap command will be use to protect a file from SIGKILL (ALT+ F4) signal or not. If it is then the following command will does that?
trap ~/Desktop/left.py SIGABRT
I'm trying ...
1
vote
1answer
26 views
OverflowError: user id is too big
Runtime environment:
Mac OS X 10.8.3 Intel 64bit
Python 2.7.3
How to solve the setuid nobody length issue?
bash
$ id nobody
uid=4294967294(nobody) gid=4294967294(nobody) ...
0
votes
1answer
29 views
Running Java Application using Popen
I am running tika on my Linux server, and I want to run it using python (subprocess.Popen)
However, I have a non-root access, so I only have a local java installation. Every time I need to set the ...
0
votes
2answers
38 views
About piping stdio and subprocess.Popen
I have one Python program, that is opening another Python program via subprocess.Popen. The 1st is supposed to output some text into the console (just for info), and write some text to the 2nd program ...
0
votes
0answers
18 views
Sound of Debian in autoboot script don't function
I start my system (raspberry pi) with a python script. In this script i use:
os.system('mpg123 mysound.mp3 &')
With the autoboot (script) the sound don't function, but if i start the system ...
0
votes
1answer
38 views
Running function in python script from linux runs whole script
def parseCommand():
args = None
if len (sys.argv) < 2:
print('no command entered')
return
command = sys.argv[1]
print ('command executed: %s' %command)
if ...
0
votes
1answer
31 views
curl command Chinese/Japanese url encode
I want send a post request to a site.
The python code below works fine.
# -*- encoding=utf-8 -*-
import urllib, urllib2
url = "http://xxx.com/login.asp"
req = urllib2.urlopen(url, ...
1
vote
1answer
61 views
Convert MSword to XML/HTML on Linux
I need to convert MSWord file into XML or HTML, while preserving the structure of the file (mainly tables). I happened to find tika, which is quite powerful in extracting text from MSword files (and ...