How to copy a file from one machine to another machine

Nico Grubert nicogrubert at gmail.com
Wed Sep 21 05:40:27 EDT 2005


Hi there,

I would like to copy a file from one machine (machine #01) to another 
(machine #02).

machine #01: Suse Linux 9.2, Samba 3, Python 2.3.5
machine #02: Windows Machine, Destination Dir: <Share>\temp\files\

Both machines are in one network so they can communicate each other. In 
order to be able to write a file in the directory on Machine #02 I need 
to be the user "myadmin".

In a short Python program I create the source file on Machine #01 like this:

filecontent = 'This is just a test...'
# my own helper method to generate a unique filename
filename = createUniqueFilename()
f = open('/var/files/' + filename, 'w')
f.write(filecontent)
f.close()


Every time a new source file has been created it needs to be copied or 
moved from machine #01 to machine #02.
Are there Python modules which help me doing this job? Any examples how 
to do that would be very helpful.

Kind regards and many thanks in advance,
Nico



More information about the Python-list mailing list