LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-18-2010, 07:45 AM   #1
bino_linux
LQ Newbie
 
Registered: Aug 2010
Posts: 18

Rep: Reputation: 0
python script help


So I have a python script (which I know nothing about python) that runs a third party binary called "report". What I would like to do is add a perl script I wrote to be executed at the end of this python script. My perl script runs the cpulimit command on the PID that's created from running the python script. Any python users know how I would go about doing this?

Thanks
 
Old 08-18-2010, 07:51 AM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192
Well I am not sure why you would want to mix yet another language into the script as I am sure python can manage the task perl has performed.
That being said, find the line where python calls the binary and repeat for your perl script sounds like an obvious path.
 
Old 08-18-2010, 08:30 AM   #3
bino_linux
LQ Newbie
 
Registered: Aug 2010
Posts: 18

Original Poster
Rep: Reputation: 0
Grail...I had to test the script I wrote to make sure it did what I thought it was going to do. So I figured since that worked, and I don't know python, that I could just try to incorporate my script into this one.
 
Old 08-18-2010, 10:14 AM   #4
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192
Fair enough, so did you try my other suggestion?
 
Old 08-19-2010, 06:17 AM   #5
bino_linux
LQ Newbie
 
Registered: Aug 2010
Posts: 18

Original Poster
Rep: Reputation: 0
Yes, I tried that. I also tried using os.system but couldn't get that to work either. I'm thinking it's from my lack of knowledge.
 
Old 08-19-2010, 12:52 PM   #6
robotsari
LQ Newbie
 
Registered: Jun 2010
Location: boston & sf bay, depending on the day
Distribution: ubuntu, rhel, debian
Posts: 20

Rep: Reputation: 1
There seems to be a lot of hits on Google:
http://www.google.com/search?client=...utf-8&oe=utf-8

What specifically have you tried and found not working? Not just "I tried using os.system" but put in the specific call(s) you attempted. But first, go through the first 10-20 google results first and then post here if those were not working; if you find a solution, post that here and mark the thread as "solved" so others may learn.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mysterious discrepancy b/w script results at terminal and in python script cedardoc Linux - Newbie 1 08-03-2010 03:59 PM
[SOLVED] Converting a Shell script to a Python script Aquarius_Girl Programming 4 01-29-2010 12:27 AM
Python Script Issue* Millenniumman Programming 1 06-18-2006 09:21 PM
python cgi script and premature end of script headers Neruocomp Programming 1 07-28-2005 11:43 AM
python script LinuxLala Programming 14 04-07-2004 06:19 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration