[Tutor] Commands

David Rock david at graniteweb.com
Thu Jan 23 21:27:40 EST 2020


> On Jan 23, 2020, at 20:04, Aaliyah Wood <aaliyahrebeccawood at gmail.com> wrote:
> 
> Hi David,
> 
> Thank you for getting back to me so quickly, my version of Python is 3.8.1 for Windows. Essentially what is happening is Python is not recognizing and commands like True, False, print. I attached a couple pictures to explain better. The screenshot is a lesson I am watching on YouTube, this is an example of what my program is supposed to look like. The photo of my laptop is what the program looks like on my computer. I’m just confused as to why I cannot run a program and why it doesn’t look right. It was working two days ago when I began learning and now it isn’t. If you need any more explanation just let me know!
> 
> Thank you again,
> Aaliyah 
> <IMG_0370.jpg>
> <IMG_0368.jpg>
> <IMG_0371.jpg>

Ok, that helps a lot.  One thing to note, make sure when you reply, you reply to the tutor mailing list, not the individual.  That way, everyone can help, and not just one person.  In this case, it’s actually good you did, because the mailing list would have dropped the images, so we would not have seen what they look like.

I can tell from the pictures that you are using PyCharm, which is part of the issue.  PyCharm is a great IDE for Python, but it has its own learning curve.  What’s happened is you created a generic text file named “App”, rather than an “App.py” python file.  That’s why PyCharm isn’t coloring things for you; it does not know it’s supposed to be a Python file.

If you do File->New Project and create a new, blank project, then Right-click on the project name and pick New->Python File 

That should get you a file that PyCharm knows is a Python File and should behave as you expect.

I’d also look around for tutorials specifically on using PyCharm.  That will go a long way to helping you deal with the quirks of working in that specific IDE.
For something simpler, you could also try using IDLE, the built-in editor that comes with Python installs.  It will also give you syntax highlighting, without the overhead of also learning an IDE at the same time.

—
David




More information about the Tutor mailing list