I faced a problem when I tried to get the key and value from
my file wahbilogintest.py
, which contains a dictionary kids{}
.
Can you please help me how I will search after my file wahbilogintest.py
in directory C:/webbplats/mydata
and iterate over in the file to get/bring key and value?
My source code
class visafilerIkatalogen :
import os
folder = 'c:/webbplats/mydata/'
dinfil = raw_input("Enter your userprofile med prefix.txt: ")
#dindictionary = raw_input("Enter your dictionary name: ")
loginReadProfile = open(folder+str(dinfil),'r')
for key, value in dinfil.iteritems():
print 'Username is: ',key
print 'value is: ',value
print loginReadProfile.readlines()
loginReadProfile.close()
Myobj12 = visafilerIkatalogen()