Advertisement
Guest User

Untitled

a guest
May 8th, 2016
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. import json
  2. import sys
  3.  
  4. part = sys.path[0].split('\')
  5. del (part[part.index('Python') + 1:len(part)])
  6. sys.path.insert(1, '\'.join(part))
  7.  
  8. from data.fold2.other import accounts_list
  9.  
  10. class AddUser():
  11. def __init__(self, username, password, Type=1):
  12. self.username = username
  13. self.password = password
  14. self.Type = Type
  15. accounts_list[self.username] = [self.password, self.Type]
  16. with open('data\fold2\other.py', 'w') as file:
  17. file.write('accounts_list = ' + json.dumps(accounts_list))
  18.  
  19. import sys
  20. from other import accounts_list
  21.  
  22. part = sys.path[0].split('\')
  23. del (part[part.index('Python') + 1:len(part)])
  24. sys.path.insert(1, '\'.join(part))
  25.  
  26. from data.fold1 import subfile
  27.  
  28. subfile.AddUser('username', 'password')
  29.  
  30. accounts_list = {}
  31.  
  32. File "C:Pythondatafold1subfile.py", line 16, in __init__
  33. with open('data\fold2\other.py', 'w') as file:
  34. FileNotFoundError: [Errno 2] No such file or directory: 'data\fold2\other.py'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement