OpenCores
URL https://opencores.org/ocsvn/phr/phr/trunk

Subversion Repositories phr

[/] [phr/] [trunk/] [codigo/] [gui/] [windows/] [minimal python2.7.6/] [subprocess/] [process.py] - Blame information for rev 314

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 172 maximiq
#from subprocess import check_output
2
#st = check_output("dir C:", shell=True)
3
#print st
4
 
5
import subprocess
6
 
7
command = "dir c:"  # the shell command
8
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
9
 
10
#Launch the shell command:
11
#output, error = process.communicate()
12
#print output
13
 
14
for line in iter(process.stdout.readline, ''):
15
    print line,
16
process.stdout.close()
17
 
18
 
19
#while True:
20
#    out = process.stdout.read(1)
21
#    if out == '' and process.poll() != None:
22
#       break
23
#    if out != '':
24
#       sys.stdout.write(out)
25
#       sys.stdout.flush()
26
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.