MrThoe

USER_MANAGEMENT

Nov 16th, 2020 (edited)
828
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.92 KB | None | 0 0
  1. # User Management
  2.  
  3. ## Challenge
  4. For this challenge, you need to create a user management system.
  5. That is, a program that allows users to register an account,
  6. login with a username and password, and logout. Your application
  7. needs to be able to register multiple users.
  8.  
  9. ## Extra Challenges
  10. The following suggestions are extra challenges to make your program
  11. more sophisticated.
  12.  
  13. #### Password Reset
  14. Implement password reset functionality so that if a user forgets
  15. their password, their account can be recovered.
  16.  
  17. #### Profile Data
  18. Include extra user data, beyond a username and password, in the
  19. registration process. Then make a simple profile page for displaying
  20. that info.
  21.  
  22. #### Data Storage
  23. Instead of storing a plain text file, use a json file, or use a
  24. database such as sqlite or MongoDB.
  25.  
  26. ## Code
  27. Code snippets and hints that might be useful
  28.  
  29. #### Open a file for writing
  30. ```python
  31. with open('numbers.txt', 'w') as myFile:
  32.  
  33.     for x in range(10):
  34.         myFile.write('line: ' + str(x) + '\n') #newline character is necessary.
  35. ```
  36.  
  37. #### Open a file for reading
  38. ```python
  39. with open('someFile.txt', 'r') as myFile: #someFile.txt must exist
  40.  
  41.     for x in myFile.readlines():
  42.         print(x)
  43. ```
  44.  
  45. #### Split a line of text
  46. ```python
  47. >>> line = "Martha Stewart, 75, NJ"
  48. >>> line.split()
  49. ['Martha', 'Stewart,', '75,', 'NJ']
  50. >>> line.split(",")
  51. ['Martha Stewart', ' 75', ' NJ']
  52. >>> myList = line.split(",")
  53. >>> myList[1]
  54. ' 75'
  55. >>>
  56. ```
  57.  
  58. #### Create a navigation prompt
  59. ```python
  60. exit = False
  61.  
  62. while not exit:
  63.  
  64.     print('1. Stuff')
  65.     print('2. Other Stuff')
  66.     print('3. Different Stuff')
  67.     print('4. Exit')
  68.  
  69.     s = input('Make a selection: ')
  70.  
  71.     if s == '4':
  72.         exit = True
  73. ```
  74.  
  75. ## Grading
  76. Please review the rubrics for grading. When you are finished,
  77. modify this README file with entirely your own content. Be sure
  78. to use markdown to make the README professionally formatted.
  79.  
Advertisement
Add Comment
Please, Sign In to add comment