היה משעמם היום אז:
מוצא קבצי flv בתיקיה שאתם מגדירים(למשל התיקיה שהדפדפן שומר בה את הקבצים האלה) ומעתיק אותה לתיקיה אחרת שגם אותה אתם תגדירים:
http://rafb.net/p/QPI2q980.html
הסקריפט השני הוא מן קליינט FTP גרוע שעשיתי ב5דקות:קוד:#!/usr/bin/python import os import shutil import time _PATH = "/search_path/" _TARGET_PATH = "/home/ubuntu/" print "Search path: %s" % _PATH print "Target path: %s" % _TARGET_PATH _PATH = raw_input("new search path: ") _TARGET_PATH = raw_input("new target path: ") files = os.listdir(_PATH) for flv in files: if flv.endswith(".flv"): print print flv + ": " + str(os.stat(_PATH+flv).st_size / 1024) + "kb" shutil.copyfile(_PATH+flv,_TARGET_PATH+flv) print "file copied" print "done"
http://rafb.net/p/bsGQU731.html
תעשו עם זה מה שאתם רוצים.קוד:#!/usr/bin/python import ftplib import time ftp_addr = raw_input("FTP Address: ") usern = raw_input("FTP User: ") passw = raw_input("FTP Pass: ") print "Trying to connect.." ftp = ftplib.FTP(ftp_addr,usern,passw) ftp.login() print "" try: ftp.getwelcome() except all_errors: print "exeption" #asdf inp = int(raw_input("Select Action: 9 = Insert commands. 1 = Show current foler. \ 2 = Show files and delete. 3 = Create new folder. 4 = Upload file. ")) if inp == 1: ftp.pwd() if inp == 2: ftp.retrlines('LIST') filedel = raw_input("Enter the number 1 with filename to delete a file (example: 1filename). Enter 2foldername to delete a folder: ") elif filedel.startswith("1"): ftp.delete(filedel) elif filedel.startswith("2"): ftp.rmd(filedel) if inp == 3: createf = raw_input("Enter folder to create: ") ftp.mkd(createf) if inp == 4: sendf = raw_input("File to upload: ") try: f = open(sendf,'rb') except IOError: print "Exeption" ftp.storbinary('STOR' + sendf, f) f.close() if inp == 9: command = raw_input("Insert command: ") ftp.sendcmd('STOR' + command) else: print "Wrong input" ftp.quit()
פעם הבאה שישעמם לי אני אכתוב כמה סקריפטים שמתחברים לאפליקציות של גוגל ואשחק עם זה קצת :|




ציטוט ההודעה


<