Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
deleted 68 characters in body
Source Link
Mad Physicist
  • 115.7k
  • 29
  • 202
  • 292

I have read tons of posts but still can't seem to figure it out.

I want to subprocess.Popen() rsync.exe in Windows, and print the stdout in Python.

My code works, but it doesn't catch the progress until a file transfer is done! I want to print the progress for each file in real time.

Using Python 3.1 now since I heard it should be better at handling IO.

import subprocess, time, os, sys cmd = "rsync.exe -vaz -P source/ dest/" p, line = True, 'start' p = subprocess.Popen(cmd, shell=True, bufsize=64, stdin=subprocess.PIPE, stderr=subprocess.PIPE, stdout=subprocess.PIPE) for line in p.stdout: print(">>> " + str(line.rstrip())) p.stdout.flush() 

I have read tons of posts but still can't seem to figure it out.

I want to subprocess.Popen() rsync.exe in Windows, and print the stdout in Python.

My code works, but it doesn't catch the progress until a file transfer is done! I want to print the progress for each file in real time.

Using Python 3.1 now since I heard it should be better at handling IO.

import subprocess, time, os, sys cmd = "rsync.exe -vaz -P source/ dest/" p, line = True, 'start' p = subprocess.Popen(cmd, shell=True, bufsize=64, stdin=subprocess.PIPE, stderr=subprocess.PIPE, stdout=subprocess.PIPE) for line in p.stdout: print(">>> " + str(line.rstrip())) p.stdout.flush() 

I want to subprocess.Popen() rsync.exe in Windows, and print the stdout in Python.

My code works, but it doesn't catch the progress until a file transfer is done! I want to print the progress for each file in real time.

Using Python 3.1 now since I heard it should be better at handling IO.

import subprocess, time, os, sys cmd = "rsync.exe -vaz -P source/ dest/" p, line = True, 'start' p = subprocess.Popen(cmd, shell=True, bufsize=64, stdin=subprocess.PIPE, stderr=subprocess.PIPE, stdout=subprocess.PIPE) for line in p.stdout: print(">>> " + str(line.rstrip())) p.stdout.flush() 
added 1 character in body
Source Link
Will Vousden
  • 33.5k
  • 9
  • 89
  • 97

I have read tons of posts but still can't seem to figure it out.

I want to subprocess.Popen()subprocess.Popen() rsync.exe in windowsWindows, and print the stdout in pythonPython.

My code works, but it doesn't catch the progress until a file transfer is done transfered! I want to print the progress for each file in realtimereal time.

Using pythonPython 3.1 now since I heard it should be better at handling IO.

import subprocess, time, os, sys cmd = "rsync.exe -vaz -P source/ dest/" p, line = True, 'start' p = subprocess.Popen(cmd, shell=True, bufsize=64, stdin=subprocess.PIPE, stderr=subprocess.PIPE, stdout=subprocess.PIPE) for line in p.stdout: print(">>> " + str(line.rstrip())) p.stdout.flush() 

I have read tons of posts but still can't seem to figure it out.

I want to subprocess.Popen() rsync.exe in windows, and print the stdout in python.

My code works, but it doesn't catch the progress until a file is done transfered! I want to print the progress for each file in realtime.

Using python 3.1 now since I heard it should be better at handling IO.

import subprocess, time, os, sys cmd = "rsync.exe -vaz -P source/ dest/" p, line = True, 'start' p = subprocess.Popen(cmd, shell=True, bufsize=64, stdin=subprocess.PIPE, stderr=subprocess.PIPE, stdout=subprocess.PIPE) for line in p.stdout: print(">>> " + str(line.rstrip())) p.stdout.flush() 

I have read tons of posts but still can't seem to figure it out.

I want to subprocess.Popen() rsync.exe in Windows, and print the stdout in Python.

My code works, but it doesn't catch the progress until a file transfer is done! I want to print the progress for each file in real time.

Using Python 3.1 now since I heard it should be better at handling IO.

import subprocess, time, os, sys cmd = "rsync.exe -vaz -P source/ dest/" p, line = True, 'start' p = subprocess.Popen(cmd, shell=True, bufsize=64, stdin=subprocess.PIPE, stderr=subprocess.PIPE, stdout=subprocess.PIPE) for line in p.stdout: print(">>> " + str(line.rstrip())) p.stdout.flush() 
code formatting
Source Link
nosklo
  • 224.2k
  • 58
  • 300
  • 299

I have read tons of posts but still can't seem to figure it out.

I want to subprocess.Popen() rsync.exe in windows, and print the stdout in python.

My code works, but it doesn't catch the progress until a file is done transfered! I want to print the progress for each file in realtime.

Using python 3.1 now since I heard it should be better at handling IO.

 import subprocess, time, os, sys cmd = "rsync.exe -vaz -P source/ dest/" p, line = True, 'start' p = subprocess.Popen(cmd, shell=True, bufsize=64, stdin=subprocess.PIPE, stderr=subprocess.PIPE, stdout=subprocess.PIPE) for line in p.stdout: print(">>> " + str(line.rstrip())) p.stdout.flush() import subprocess, time, os, sys cmd = "rsync.exe -vaz -P source/ dest/" p, line = True, 'start' p = subprocess.Popen(cmd, shell=True, bufsize=64, stdin=subprocess.PIPE, stderr=subprocess.PIPE, stdout=subprocess.PIPE) for line in p.stdout: print(">>> " + str(line.rstrip())) p.stdout.flush() 

I have read tons of posts but still can't seem to figure it out.

I want to subprocess.Popen() rsync.exe in windows, and print the stdout in python.

My code works, but it doesn't catch the progress until a file is done transfered! I want to print the progress for each file in realtime.

Using python 3.1 now since I heard it should be better at handling IO.

 import subprocess, time, os, sys cmd = "rsync.exe -vaz -P source/ dest/" p, line = True, 'start' p = subprocess.Popen(cmd, shell=True, bufsize=64, stdin=subprocess.PIPE, stderr=subprocess.PIPE, stdout=subprocess.PIPE) for line in p.stdout: print(">>> " + str(line.rstrip())) p.stdout.flush() 

I have read tons of posts but still can't seem to figure it out.

I want to subprocess.Popen() rsync.exe in windows, and print the stdout in python.

My code works, but it doesn't catch the progress until a file is done transfered! I want to print the progress for each file in realtime.

Using python 3.1 now since I heard it should be better at handling IO.

import subprocess, time, os, sys cmd = "rsync.exe -vaz -P source/ dest/" p, line = True, 'start' p = subprocess.Popen(cmd, shell=True, bufsize=64, stdin=subprocess.PIPE, stderr=subprocess.PIPE, stdout=subprocess.PIPE) for line in p.stdout: print(">>> " + str(line.rstrip())) p.stdout.flush() 
Source Link
John A
  • 1.2k
  • 2
  • 9
  • 4
Loading