Visit Jeremy's Blog.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 01-31-2005, 05:35 PM   #1
Registered: Oct 2004
Distribution: Fedora 7
Posts: 232

Rep: Reputation: 30
python read output from seperate script?

Does anyone know of a way to assign the output of a script/program to a variable in a python script?

I tried this:

text = execute("some_script")

but that didn't work....
Any ideas?

thanks in advance.
Old 02-01-2005, 10:38 PM   #2
Registered: Oct 2004
Distribution: Fedora 7
Posts: 232

Original Poster
Rep: Reputation: 30
O.k I figured it out
I had to do this:
import os
file = os.popen("myfile","r")
outputtxt =


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
shell script to read ps -e output and determine process double processes. dr_zayus69 Programming 1 09-21-2005 05:37 PM
python cgi script and premature end of script headers Neruocomp Programming 1 07-28-2005 11:43 AM
How do you output PCM sounds linux using python and ALSA? jjdb6185 Programming 1 07-13-2005 02:39 PM
How to compare records in two tables in seperate My Sql database using shell script sumitarun Programming 5 04-14-2005 09:45 AM
Send output to seperate terminals? Brain Drop Programming 3 02-25-2005 10:44 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:20 PM.

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