#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2004
    Posts
    44
    Rep Power
    11

    Several questions


    What is argv[] for, I saw it alot on Python's program

    FTP Question(s):
    Let say if i want to retrieve an HTML file from server, I need to use retrlines commant then write to file, right??

    --

    How to upload a file to FTP server??

    --

    How to retrive or send binary file to a server??

    Thank You.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Posts
    624
    Rep Power
    35
    Originally Posted by flixxer
    What is argv[] for, I saw it alot on Python's program
    Code:
    import sys
    print sys.argv
    It is a list which contains the command line parameters passed to the program. If you start your script with
    c:\> python myprog.py -v something blah

    Then sys.argv will be;

    ['myprog.py', '-v', 'something', 'blah']

    As to the FTP questions, I haven't used it myself, but for the binary files look at ftp.storbinary and ftp.retrbinary in the ftplib module - http://docs.python.org/lib/module-ftplib.html

IMN logo majestic logo threadwatch logo seochat tools logo