how add path to open()

28 views
Skip to first unread message

Dariusz Mysior

unread,
Nov 29, 2014, 2:35:31 PM11/29/14
to django...@googlegroups.com

I join to topic with my problem

I want to create new file with login and password in new file and I can do it with code below, but I don't know how save this new files in one folder users

def rejestracja(login, haslo): save=None login_tmp=login haslo_tmp=haslo save={login_tmp:haslo_tmp}

 filehandler
=open(login,"wb")
pickle
.dump(save,filehandler)
filehandler
.close()
filehandler
=open(login,"rb")
file
=pickle.load(filehandler)
filehandler
.close()
print file
raw_input
("\n\nWcisnij [ENTER]: ")

Collin Anderson

unread,
Nov 30, 2014, 2:24:44 PM11/30/14
to django...@googlegroups.com
Hi,

I think you want something like this. (Just make sure a login name doesn't have '..' in it :).

filehandler = open('users/' + login, "wb")

Collin

Dariusz Mysior

unread,
Nov 30, 2014, 11:48:44 PM11/30/14
to django...@googlegroups.com
Yes this is it :)

thanks :)
Reply all
Reply to author
Forward
0 new messages