Something like:
import csv
in_csv=csv.reader( file('your INPUT filenamehere.csv') )
out_csv=csv.writer( file('your OUPUT filenamehere.csv','wb') )
## If you have a header record on your input file, then
out_csv.writerow( in_csv.next() )
## Iterate over your input file
for row in in_csv:
# Row
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 pass
k.i.n.g. enlightened us with:
> 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
Check out the source of pwsafe, it has a great password generator. It
can generate with different lengths, based on amoun
Kanthi skrev:
> 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 sufficie
import random
def rand_str(len):
chars = ''.join(['abcdefghijklmnopqrstuvwxyz',
'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
'1234567890',
'_+']) # plus whatever additional characters you
want
return ''.join([random.choice(chars) for i in ran
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 bei