Python : read from a file containing only 2 lines, assign each line as a
value to a data holder
The assumption is a.txt contains 2 lines
username
password
The assumption is in python when you assign a value
to something, that something is called a "data_holder"
dear python: read this file named a.txt and then make sure the first line
stored into a data_holder. as well as the second line is stored into a
data_holder.
so that this
print '%s %s' %(a,b)
would result in..
username password
EXTRAS
the following code might come in handy to construct this script.
a = open('a')
b = a.readlines()
a.close()
No comments:
Post a Comment