Re: generating random passwords ... for a csv file with user details
Hi ALL, I am sorry for not mentioning that I am new to python and scripting. How can I add the above script to handle csv file. I want the script to generate passwords in the passwords column/row in a csv file. userid,realname,dateofB,passwd The script should read the userid and genrate the password for each user id (there are thousands of userids) Kanthi -- http://mail.python.org/mailman/listinfo/python-list
file backup in windows
Hi ALL, I am a newbee programmer and started of with python recently. I am trying write a script which backups outlook (.pst ) files everytime I shutdown my system. I have writtern following code after some findings on net. My .pst file path is as follows " c:\documents and settings\060577\Local Settings\Application Data\Microsoft\Outlook " where 060577 represents username. I want my script to identigy the user logged in and go to the resp outlook folder or should be able to read outlook store directory path from registry and the copy the files to the desired path. --- how can i make the following code work, I have probelm with filepath declaration. --- import os, shutil filepath = ' C:\\Documents and Settings\\060577\\Local Settings\\Application Data\\Microsoft\\Outlook\\* ' backup = ' D:\\temp\\outlook ' os.system ("xcopy /s %s %s" % (filepath, backup)) - Thank you, Kk -- http://mail.python.org/mailman/listinfo/python-list
Re: file backup in windows
Thank You all for reply's so far > > import os, sys > from win32com.shell import shell, shellcon > > local_app_data = shell.SHGetSpecialFolderPath (0, > shellcon.CSIDL_LOCAL_APPDATA) > outlook_path = os.path.join (local_app_data, "Microsoft", "Outlook") > > print outlook_path > > The above code was fine while printing, when I am trying to use this (outlook_path) to use as source path it is giving file permission error can you please clarify this -- http://mail.python.org/mailman/listinfo/python-list
Re: file backup in windows
Hi , I am sorry I am providing the code i used as it is. Being newbee to programming I have tinkerd with various options i found on the net. start of the code import os, sys ,shutil, win32file import time from win32com.shell import shell, shellcon local_app_data = shell.SHGetSpecialFolderPath (0,shellcon.CSIDL_LOCAL_APPDATA) outlook_path = os.path.join (local_app_data, "Microsoft", "Outlook") # print outlook_path #c:\documents and settings\060577\Local Settings\Application Data\Microsoft\Outlook source = outlook_path #source = outlook_path +'\\*' print source backup = 'D:\MailBackup' backup1=r'D:\temp\outlook1' backup2 = 'D:\MailBackup' today = backup1 + '_' + time.strftime ( '%Y-%m-%d') now = time.strftime('%H.%M.%S') target = today +'_'+ now if not os.path.exists(target): os.mkdir(target) # make directory print 'Successfully created directory', target #shutil.copy(source, backup) #os.system( "copy "(source,backup)) #os.system ("xcopy %s %s" % (source, backup1)) #os.system ("xcopy /s %s %s" % (outlook_path, backup1)) #os.system ("xcopy /s %s %s" % (backup2, backup1)) #os.system( 'xcopy /i D:\\MailBackup\\* d:\\temp\\outlook') #win32file.CopyFile (outlook_path, backup, 0) #os.system ("xcopy /s %s %s" % (backup,target)) os.system ("xcopy /s %s %s" % (source,target)) # this doesnt give me any errors but the #work is not done win32file.CopyFile (source, target, 1) --- end -- - output -- C:\Documents and Settings\060577\Local Settings\Application Data\Microsoft\Outlook\* Successfully created directory D:\temp\outlook1_2006-11-22_17.41.54 Traceback (most recent call last): File "C:\Documents and Settings\060577\kk\source_code\py\Mypy\pywin32test.py", line 34, in win32file.CopyFile (source, target, 1) error: (123, 'CopyFile', 'The filename, directory name, or volume label syntax is incorrect.') -- http://mail.python.org/mailman/listinfo/python-list
Re: file backup in windows
Hi, The following code has worked for me, I will continue from here to make this further userfriendly. More I would like to know how can i distribute my python code as self installer package. In the process of learning programming I would like take OutlookBackup.py as my first project and learn accordingly. Please guide me in this. Once again thank you all of you for your valuable suggestions Regards, Kk --- import os, sys ,shutil, win32file import time from win32com.shell import shell, shellcon local_app_data = shell.SHGetSpecialFolderPath (0,shellcon.CSIDL_LOCAL_APPDATA) outlook_path = os.path.join (local_app_data, "Microsoft", "Outlook" ) # print outlook_path #c:\documents and settings\060577\Local Settings\Application Data\Microsoft\Outlook source = outlook_path #source = outlook_path +'\\*' #print source backup = 'D:\MailBackup' backup1=r'D:\temp\outlook1' backup2 = 'D:\MailBackup' today = backup1 + '_' + time.strftime ( '%Y-%m-%d') now = time.strftime('%H.%M.%S') target = today +'_'+ now shutil.copytree(source, target) # copy directory tree --- -- http://mail.python.org/mailman/listinfo/python-list
generating random passwords ... for a csv file with user details
Hi, I have a csv file which in taken as the input file for adding users in my linux mail server with the format userid,fullname,passwword,dateofbith Now I have to write a script to generate random password in the password field for each user. A simple algorithm is sufficient for passwords I being new to scripting would seek all your help in doing so Thanks In advance kanthi -- http://mail.python.org/mailman/listinfo/python-list
Creating a file with $SIZE
Hi All, I would like create files of different size, taking size as user input. I need to check the data transfer rates from one network to another . In order to do this I will have to create files of diff size and work out. I am new to Python Thanks in advance. KK -- http://mail.python.org/mailman/listinfo/python-list
Re: Creating a file with $SIZE
I think I am not clear with my question, I am sorry. Here goes the exact requirement. We use dd command in Linux to create a file with of required size. In similar way, on windows I would like to use python to take the size of the file( 50MB, 1GB ) as input from user and create a uncompressed file of the size given by the user. ex: If user input is 50M, script should create 50Mb of blank or empty file Thank you -- http://mail.python.org/mailman/listinfo/python-list
Re: Creating a file with $SIZE
On Mar 13, 8:07 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Mar 12, 7:37 am, "k.i.n.g." <[EMAIL PROTECTED]> wrote:> We use dd command > in Linux to create a file with of required size. > > If you just want to get your work done, you might consider the cygwin > dd command. > Learning to write python is a worthwhile endeavour in any case. While I just started learning programming/python, I got this requirement at my workplace. I want to learn python than just get things done. Thank you all for the solutions, I will try them and let you all know about my results. -- http://mail.python.org/mailman/listinfo/python-list
How to Write to csv file to create bulk address book
Hi , I am new to scripting, I am working on script which would create 'n' number address book entries into a csv file which would be used to import into a address book. I need suggestions for the same The fileds for csv file are as follows ""Title","First Name","Middle Name","Last Name","Suffix","Company","Department","Job Title","Business Street","Business Street 2","Business Street 3","Business City","Business State","Business Postal Code","Business Country","Home Street","Home Street 2","Home Street 3","Home City","Home State","Home Postal Code","Home Country","Other Street","Other Street 2","Other Street 3","Other City","Other State","Other Postal Code","Other Country","Assistant's Phone","Business Fax","Business Phone","Business Phone 2","Callback","Car Phone","Company Main Phone","Home Fax","Home Phone","Home Phone 2","ISDN","Mobile Phone","Other Fax","Other Phone","Pager","Primary Phone","Radio Phone","TTY/TDD Phone","Telex","Account","Anniversary","Assistant's Name","Billing Information","Birthday","Business Address PO Box","Categories","Children","Directory Server","E-mail Address","E- mail Type","E-mail Display Name","E-mail 2 Address","E-mail 2 Type","E- mail 2 Display Name","E-mail 3 Address","E-mail 3 Type","E-mail 3 Display Name","Gender","Government ID Number","Hobby","Home Address PO Box","Initials","Internet Free Busy","Keywords","Language","Location","Manager's Name","Mileage","Notes","Office Location","Organizational ID Number","Other Address PO Box","Priority","Private","Profession","Referred By","Sensitivity","Spouse","User 1","User 2","User 3","User 4","Web Page"" All the entries written by csv file by script can be random & dummy as this address book is used for testing purpose. Thank you in advance, Kanthi -- http://mail.python.org/mailman/listinfo/python-list