User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Python section within the Software Development category of DaniWeb, a massive community of 403,298 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,851 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Python advertiser: Programming Forums
Views: 374 | Replies: 2 | Solved
Reply
Join Date: May 2008
Posts: 2
Reputation: unpolloloco is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
unpolloloco unpolloloco is offline Offline
Newbie Poster

Python interaction with firefox?

  #1  
May 8th, 2008
I am quite the beginner at python (and programming altogether), but I'm attempting to learn (slowly but surely). Anyway, I am attempting to make a standalone python program that will interact with firefox (opening links, etc.). I've figured out how to open FF and open links. However, for the life of me, I cannot figure out how to close it again. I used os.spawnl(os.P_NOWAIT, "c:\\program files\\mozilla firefox\\firefox.exe") to open FF. I then attempted to use win32api.TerminateProcess(396,0) to close it again, but I received the error: error: (5, 'TerminateProcess', 'Access is denied.') . I am guessing that FF is blocking my TerminateProcess command(?). MSPaint will start/shut down fine using this method, but the Any ideas to prevent FF from blocking my command or ideas about other methods to shut the program down? Thanks for any and all help!
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2007
Posts: 41
Reputation: 1337455 10534 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 5
1337455 10534 1337455 10534 is offline Offline
Light Poster

Re: Python interaction with firefox?

  #2  
May 9th, 2008
Is it possible to do a
  1. import os
  2. os.system('tskill firefox')
?
"And da wind cry moron." ~ Pearls Before Swine
Reply With Quote  
Join Date: May 2008
Posts: 2
Reputation: unpolloloco is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
unpolloloco unpolloloco is offline Offline
Newbie Poster

Re: Python interaction with firefox?

  #3  
May 10th, 2008
That was too easy! Thanks!
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Python Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the Python Forum

All times are GMT -4. The time now is 7:03 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC