Tagged Questions
-1
votes
2answers
24 views
Python with etc/Shadow
so I'm writing this program that needs to check the password hash in etc/shadow and compare it to the password the user entered. I tried encrypting the password with hashlib.sha512, but the result was ...
12
votes
1answer
85 views
Detecting when a child process is waiting for input
I'm writing a Python program for running user-uploaded arbitrary (and thus, at the worst case, unsafe, erroneous and crashing) code on a Linux server. The security questions aside, my objective is to ...
3
votes
1answer
40 views
How to run shortkeys using Python?
I understand, we can execute Linux Shell Commands using subprocess
import subprocess
subprocess.call(["ls", "-l"])
What if i want to run CTRL+C action over the terminal?
My Use Case is:
...
1
vote
2answers
33 views
Serving changing files with Flask
I currently am using Flask to serve up a visual programming environment. I would like the users to be able to load the code currently in the system if they come back later. I have tried using:
return ...
2
votes
1answer
35 views
Setting my Python Path?
I'm trying to run my boto script but I get the following error:
ImportError: No module named boto.swf.layer2
According to pip freeze I have boto installed so I'm wondering what has gone wrong here. ...
0
votes
0answers
10 views
Scapy issue OSError “Result to large” Windows 7
send(ip/tcp) Traceback (most recent call last)
File <console>, line 1, in <module> File "C:\Python26\lib\site-packages\scapy\sendrecv.py.......
OSError: Result too large
Sorry about the ...
1
vote
0answers
37 views
running a persistent python script from systemd?
I have a python script that decodes the input from a usb device and sends commands to a php script. The script works beautifully when run from the console, but I need it to be run on startup.
I ...
0
votes
2answers
121 views
Python - permutation and percentage
I am trying to calculate percentage change in values from 1-c1 to 4 for each bench.
the values for each bench are in a pythonic list similar to lists = [[],[],[],[],[],[]]
Is there a library or any ...
1
vote
2answers
30 views
How do I let pip install into HOME by default?
I want that pip always installs into $HOME just as if I type
pip install --user ...
But I don't want to type --user all the time. I think setting an environment variable would be a good solution ...
0
votes
1answer
22 views
How to get actual time TCP request is made and response is received by OS
I'm load testing a server so I have a client spitting out lots of HTTP requests (hundreds, possibly thousands per second). I want to measure how long it takes for the server to respond. Currently ...
1
vote
0answers
30 views
web2py: default controller line count?
my web2py applications default controller, default.py is only 611 lines but its size on disk seems 24MByte, i check windows and linux systems, really 24 Mbyte seem, so web2py admin application is very ...
0
votes
2answers
86 views
Python - all the print and stdout how can i get from terminal so that i can make a log?
Why it does not give output while doing from bash >>, so that it can be saved to a file.
$ cat > /var/tmp/runme.sh << \EOF
#!/bin/bash
export DISPLAY=:0.0
python /var/tmp/t.py >> ...
0
votes
1answer
29 views
Placing widget on to the window (Using tkinter)
I am trying to create the interface for my program using tkinter library.
My interface should appears like this
BUTTON1
BUTTON2
BUTTON3
B.pack(side = "left", padx = 00, pady = 0)
C.pack(side = ...
0
votes
1answer
35 views
Run excel macro from python (Windows and Linux)
I've written a Python script that takes input files and outputs a CSV file. Next, I go into Excel and use conditional formatting to color some of the information (e.g. if A2=1, color background red) ...
0
votes
1answer
35 views
Python - how can i read in and read out so that other readers can read it for further pursing?
I have to run the Java application and read the syslog to trigger some other Python based events.
At the same time i also need to dump and store it in /var/tmp/log.log of all java outputs, but ...