We Recommend

Learning Python Learning Python
The authors of Learning Python show you enough essentials of the Python scripting language to enable you to begin solving problems right away, then reveal more powerful aspects of the language one at a time. This approach is sure to appeal to programmers and system administrators who have urgent problems and a preference for learning by semi-guided experimentation.


Posted By

stagger on 02/24/08


Tagged

textmate python FTP ttm thesis


Versions (?)


Who likes this?

1 person has marked this snippet as a favorite

wbowers


FTP Uploader


Published in: Python 


  1. # Import FTP library:
  2. import ftplib
  3. # Connect to the server:
  4. s = ftplib.FTP('server','user','password')
  5. # Open file to send:
  6. f = open('/folder/folder/local_filename','rb')
  7. # Store file on server:
  8. s.storbinary('STOR server_filename', f)
  9. # Close sent file:
  10. f.close()
  11. # Close server connection:
  12. s.quit()

Report this snippet 

You need to login to post a comment.