Hello everyone, I am brand new to programming as I just started my first term in Computer Science. I wanted to get ahead on things so I’m delving into Visual Studio and Python in my own time. The problem I’m having is python does not show my username on lines. It only shows >>> . I know it should look something like (‘C:\Users//username’) but it’s not displaying and Im not quite sure what to do. I know this is very low level information for most of you but it would greatly help me out. You gotta start somewhere right? Lol thanks in advance.
The >>>
is the Python prompt. That’s what it’s meant to look like. Sometimes it’s ...
, when there’s an unclosed bracket of some kind.
As for the C:\Users\username
thing, that would be C:\Users\username>
, where the part before the >
is the current directory. When you switch to a different directory, that part will change accordingly.
Yes, that’s as it should be.
No; that is the command prompt, which you can get in a variety of ways. It is a separate tool that you can use to help run your computer, for example by opening programs (such as Python). You really need to learn how to use this separately; it is an important skill that everyone who values their computer as a tool (rather than an appliance) can benefit from. When you run it, Windows will open a terminal window that shows plain text using a monospace (typewriter) font, normally sized to show 80x25 characters. The command prompt program uses this window to show its output (normally by just type-writing text) and take its input (which you type in from the keyboard; you can use the mouse to select and cut/copy/paste text, but that’s about it).
If you are using Visual Studio - this is one example of an IDE (Integrated Development Environment) - it may manage a command prompt window for you, and use it to run Python for you. I don’t use tools like this (they are not at all necessary), so I don’t know details of how Visual Studio does it.
Most programming languages are designed in such a way that the easiest, most direct way to get started is from the command line: by making programs that are designed to be used from the command line. In Python code, the built-in input
function reads a line of input from the keyboard (until the user hits the Enter key), and print
sends output (and, by default, skips to a new line afterward).
If you open a command prompt, you can also run the Python interpreter directly in its terminal window - that happens when you use the prompt to start the Python program normally. This is what shows you the >>>
prompt, which is a place that you can type Python code, one statement at a time, and see the effect as each statement is run immediately.
Also that interactive interface to the Python interpreter (what
shows the >>>
prompt) is often referred to as a REPL:
Understood, thank you! I’m going to figure out the appropriate directory.
Thank you for your response to my post! Your input has been incredibly helpful. Initially, I hadn’t planned on using Visual Studio Code, but as I started the free Harvard CS50 course, the instructor used it extensively in the lectures. Wanting to follow along precisely, I decided to use VScode as well. Although I’m a bit lost in the process, I’m still looking to use an IDE in VScode for the sake of the CS50 course.
Thanks again, I greatly appreciate you getting back to me.
Thank you for your response! I’m still working in my terminology. I will be referring to the wiki link.