Hello,
As I try to follow along with the video and copy everything Don types, I don't get the same results, only syntax errors or name "hello" not defined.
-
Developing with Python
-
A little more information will help troubleshoot your errors.
What are you using as your development environment?
A screenshot of what you typed and the error would help as well. If you cannot do that, repeat what you typed here, and what the error says.
Syntax errors usually indicate a typo, like a missing quote, missing parenthesis, etc.
Name "hello" not defined indicates you have not successfully created the variable "name" and assigned a value to the variable.
I am using Windows 10.
Mike Rodrick
Edutainer, ITProTV**if the post above has answered the question, please mark the topic as solved.
-
Hi,
When Don enters the command hello.py to create a file, this is something that doesn't work for me![issue one.PNG]
with the photo you sent, I was able to do everything except create a file as Don did
-
Looks like you are running Windows. The text editor vi is not installed on Windows by default. This is why you are getting the error.
You can install vi on Windows, there are a few guides available on the internet. Do a search for
vi on Windows 10
I would recommend installing VS Code. This is a great text editor for Windows, and it supports several languages, intellisense, and color coding. You can learn how to download and install it, and how to set it up to work with Python here.
https://docs.microsoft.com/en-us/windows/python/beginners
This page will also help you create python files and execute them in the VS Code terminal.
Mike Rodrick
Edutainer, ITProTV**if the post above has answered the question, please mark the topic as solved.
-
Hey @Victor-Mendoza
Sorry you're having issues working with Python.
Mike has made some great observations, just one thing I would add...
It looks like you're running the Python interpreter from the command line, which is fine, but you're trying to launch an external text editor (vi) from inside the Python Interpreter.
It seems like what you want to do is create a Python script that will be named 'hello.py'
If this is the case then you will need to choose a text editor that works with your system, in your case you can just use notepad.exe, or download/install VS code as Mike suggested, and then create a file called 'hello.py'.
In the hello.py file, you will type the Python code you wish to execute, and then save the file.
Then you will execute that file with Python from the command line. This would looks something like this.
I hope this helps you get this all figured out.
Cheers,
DanielITProTV
Show Host