Posts by Tobias Sette • 21 points
4 posts
-
1
votes3
answers18812
viewsA: Running command with another user within a shell script
I use the command runuser. Basic syntax: runuser -l usuario -c comando. The commands below serve as a test, showing which current user and bash PID: whoami && echo $$ sleep 2 runuser -l…
-
1
votes2
answers5650
viewsA: How to Direct Commands to the Linux Python Terminal
Split: What will happen when you click on your script depends on what is configuring to be done in the window manager. Assuming script runs: python interpreter does not has a graphical interface, so…
-
0
votes3
answers8272
viewsA: How to call external command with Python?
I do so, I believe it is a pytonic way: from subprocess import Popen, PIPE class Cmd(object): def __init__(self, cmd): self.cmd = cmd def __call__(self, *args): command = '%s %s' %(self.cmd, '…
-
0
votes3
answers8766
viewsA: Read a few lines from a file
Store in a file the number of the line being read, when starting the process the script reads the number of the line and starts with it or the first if the line is not informed. To know the line…
pythonanswered Tobias Sette 21