Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help Requested
#3
Another option would be to create a simple menu driven system, which ichabod801 has an excellant tutorial on located here: Command Line Interface.

As to your code, there are numerous errors, some serious, some not so much. It is not a good idea to use variables that are used by Python, even if you capitalize it, as you did with "Input". Variables should be lower case, for example "required_password", not "Required_Password". Please do not use single letters as variables, they become difficult to follow and give no clue as to their purpose.

In your code you assign "Name" as "User" (line 8) and "B" a value of "/:" (line 12), then on line 25 you assign "C" the value of Name + B, making "C" equal to "User/:". Things are now spiraling out of control towards a fiery crash. For instance, you never allow the user to change the value of "Name", it will always and forever be "User", never "Admin" or "Larry" or "Moe" or "Curly". A better way would be to ask for the name, rather than hard code it:

name = input("Please enter your name: ")
There are numerous other errors in your logic that need to be addressed before your program will come close to running.  Might I suggest you start by creating a flow chart, showing what you want to do and when you want it to happen. You can then add variables, functions or classes to your chart and finally convert it to actual code.

Whether you choose to go the route suggested by nilamo or that of ichabod801, you need to understand what is happening, when it is happening and why it is happening.  To that end, be liberal with the use of the "print()" function.  They can always be removed once your code is finalized.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply


Messages In This Thread
Help Requested - by Contraversia - Aug-01-2017, 07:00 PM
RE: Help Requested - by nilamo - Aug-01-2017, 07:34 PM
RE: Help Requested - by sparkz_alot - Aug-01-2017, 08:24 PM
RE: Help Requested - by Contraversia - Aug-23-2017, 02:50 PM
RE: Help Requested - by nilamo - Aug-23-2017, 02:50 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  The supplied user buffer is not valid for the requested operation. py2exe 1 3,394 Apr-27-2018, 12:17 AM
Last Post: py2exe

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020