Ubuntu :: Kill A Python Application From The Command Line?
Sep 27, 2010
How do I kill a python application from the command line? For an example I have 2 applications running. The first is bleachbit and the second is furiusisomount. They are both python applications so they both come up as python under process name. I could kill them by ID number but if there was another way to do it so that it could be automated in a bash script.
i've gotten my fedora 12 to the point where i can run python3 scripts from command line and can call up python 2.6.2 idle with the command 'idle' from command line. what command will call up python3 (3.1.2 to be exact) idle?
I had problems with python stuff and so update manager did not work. Also many other problems, PiTiVi was installed but did not start eg... After many trials of this and that I removed python-gtk2 and so also ubuntu desktop. But was unable to get it back. Now I cannot even shut down. While it is not possible to install desktop or anything else, would it be possible to fix this by upgrading the whole system to 10.04 (10.10?)? Would it fix python installation. How could I do it. Some info tells to change sources.list and run apt-get upgrade, but some tell not to do so.
t@t:~$ update-manager Traceback (most recent call last): File "/usr/bin/update-manager", line 26, in <module>
I have a application in /xxx/xxx/xxx/app I need to type a long path each time, if I want to use it. I want to use it just type 'app'. How to do? Whatever I'm stay in any path.
I am going to compile and install my first linux application from the command line. The program is the port scanner program NMAP, and I am looking at the documentation to learn how to do it. I saw this thread [URL], and I just want to make sure I understand what it is I'm doing.
bzip2 -cd nmap-5.35DC1.tar.bz2 | tar xvf - cd nmap-5.35DC1 ./configure make su root make install
"bzip2 -cd nmap-5.35DC1.tar.bz2 | tar xvf -" Here I am calling the bzip2 program to work with a specified file. look for the file nmap-5.35DC1.tar.bz2 in the current diretory (-cd) and to pipe (redirect) something, this is where I get lost, I think. And I know what x & v mean but not f, or what that has to do with the previous commands.
cd nmap-5.35DC1 Chage to the named directory. ./configure I assume this is a command? make Builds an executable su root make install not sure what the difference is between this and the above.
I've just added an application to load on startup in gnome.At first gnome loads properly,but after few seconds that application starts automatically and I can see its icon on taskbar , then gnome freezes and I can't do anything in gui.
How I can remove that application from starup of gnome using command line?
Is there a way to find out the currently installed packages and the corresponding command line to launch the package from a terminal. For example, I know that I have openoffice installed but I do not know how to find the command line to launch it.
how to use QGLviewer. I want to give my program a file name as a command line argument. All of the sample programs I find have a main.cpp file like this:
Quote:
#include <QApplication> #include "window.h" int main(int argc, char *argv[])
[code]....
Then the Window class, which is derived from QGLViewer, does all the program's actual work. If I want access to argc and argv, for example, to open and read a file that's passed as an argument, what would handle that? Is there a built-in way to get the arg variables to the window class, or do I need to just write a loadfile function and pass them?
I'm a bit new to Python programming and hoped that someone might be able to help with a problem I'm having. What I essentially want to do is to combine two text files line for line. I know how to do this in a bash script so to give you a better idea here's the code for that:
Code:
This is basically for adding on values to the end of a CSV file that uses ';' as the delimiter. So say file1 said:
And file2 said:
Then running this command would create merged_file1_and_file2 which would be:
The code I'm using at the moment is:
Code:
As I'm sure any experienced python programmer will see, this prints out the first line of the file "csvraw" and then all of the lines of "stamps" and then the remainder of "csvraw".
What I'd like to do is something like: (pseudo code, I know it's not python ;-))
Code:
Is this possible? I've tried googling and my Python Pocket Reference hasn't been much help. I've looked at pickling but that doesn't seem appropriate.
I'm trying to kill an android SDK emulator but it just won't shut down. When I try to kill it through system monitor (see pics) it doesn't work, "killall program_name" doesn't work either. It stays firm and all I have left is to reboot Ubuntu.
I had opened Thunderbird and discovered I had no cursor control. Couldn't close it, couldn't exit it, couldn't switch windows. I couldn't even shut down using that button.
I figured there must be a kill command similar to Windoze cntrl + alt + del that would allow me to close that application.Is there such a keyboard hot key for doing this?
I am using kvkbd as an onscreen keyboard and I have it set to start on the login screen but after I login I want the keyboard to close and I can not get this to work. At the bottom of /etc/gdm/Init/DefaultI added the line.Code:exec kvkbd&This works great and kvkbd starts up and even puts a panel icon at the bottom of the login screen but after the login the keyboard is still there?I have tried making a launcher and adding it to the startup applications. I wrote a script and put it in the /usr/sbin and /usr/bin and also added a line at the bottom of my /etc/rc.local that should have run that same script to kill kvkbd and nothing. The really weird thing is that the launcher that I made would work if I double clicked on it but if i had it set to run as a startup application it would not work.
I just ran "mysqld" manually in the terminal, but now I can't quit it and go back to bash. I've tried CTRL+C and typing "reset", but neither do anything. Anything I type is just ignored. I've had this numerous times in the past with various operating systems and in various scenario's, hence why I'm seeking the solution. Is there some universal hotkey to quit the currently running application or something? I guess I'm looking for a way to send SIGQUIT, SIGTERM or possibly even a EOF signal?
Is there any command in Linux to kill a socket connection WITHOUT killing its parent application? For example, I have streaming server with several connected users and I want to close socket connection to one of them?
I was giving the found the following shell script. I was told it was suppose to ensure only that only one script of Test.sh can run..
However, I get it looks like it has a error when i run it... As i get Test.sh: line 9: kill: (20831) - No such process
what is going on in this script can someone explain it to me... I thought it suppose to work like a singleton for my script creating a file .run-test-sdolan. However, i don't see how or where .run-test-sdolan is create?
sdolan@staging:$ vi Test.sh #!/bin/sh MYDIR=`dirname $0` CONFDIR=$HOME/ code....
In my work, I must use many different computers with Windows XP. On my home Linux computer, I'm writing some very simple software in Python (with Tkinter) that will make my work more efficient, which I'll use if I can find a way to get Tkinter to not look so ugly (it is for presentations).
It wouldn't be appropriate for me to ask the tech staff to install Python on every machine, but as it has some kind of "delete everything after reboot" software, they never seem to mind when other people (non-employees) put software there temporarily. Can I somehow burn Python + my software onto a CD, so I can quickly run it on any XP machine that I must use?
I am reading "A Byte of Python" and this is the 2nd time I've completely been confused about something:"What if you wanted to specify a two-line string? One way is to use a triple-quoted string asshown previously or you can use an escape sequence for the newline character - toindicate the start of a new line. An example is This is the first lineThis is thesecond line. Another useful escape sequence to know is the tab - There are many moreescape sequences but I have mentioned only the most useful ones here."In python:>>> "This is the first lineThis is the second"'This is the first lineThis is the second'>>>
I'm working with Eclipse and it's starting to misbehave now and then which completely freezes my computer. Is there any emergency command to kill such a misbehaving process so I don't have to reboot my computer?
I already have a emergency xkill icon in my taskbar and a [Ctrl]+[F1] console with "> sudo killall eclipse" pretyped(!) but sometimes it's even to late for this. What I would need is a emergency command/console that gets a guaranteed amount of process time so I can kill these process.
I started to copy a directory using Nautilus. I dragged and dropped a directory from my hosted server to my home drive. It got hung up, and wouldn't download. I clicked the red "stop operation" button, but I have a lingering icon in my upper panel saying that I still have file operations going on, even though it has supposedly stopped. How do I determine from the command line what this process is named and how do I kill it to remove the icon
I want to use a cron job to backup my files to my server. Now when I run the script manually, I get an error when backing up (something and sftp file being used or so). I only get this when I'm simultaneously connected to my server with sftp. So to be sure that this doesnt happen when I wont be there anymore to look at the log, I would like to know if there is a command to kill all sftp connections. I would put this command in the backup scrip cron uses.