Skip to content

Commit

Permalink
No more os.system()
Browse files Browse the repository at this point in the history
  • Loading branch information
Frankie P committed Feb 28, 2013
1 parent 8274960 commit 345eb0a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server.py
Expand Up @@ -23,7 +23,8 @@ def upload(username, password, file, data):
return "Login Failed"
else:
if file not in os.listdir("files"):
os.system("touch files/"+file)
with open("files/"+file, 'w') as file:
pass
upload = open("files/"+file, 'ab')
data = data.split()
for data in data:
Expand Down Expand Up @@ -56,5 +57,5 @@ def login(username, password):

if __name__ == "__main__":
if "files" not in os.listdir(os.getcwd()):
os.system("mkdir files")
os.mkdir("files")
app.run(host='0.0.0.0')

0 comments on commit 345eb0a

Please sign in to comment.