Issues with Python

Rick Johnson rantingrickjohnson at gmail.com
Sun Jul 30 18:19:47 EDT 2017


> Hi, I am new to Python and though I have been able to
> download the 3.6 version on my laptop , I still have
> issues with the syntax. While writing a program to
> execute, it will display syntax error with different
> shades of color usually green or yellow.

Which IDE (aka: fancy text editor) are you using to write this
code?

> What can I do about this?

About what?

    (!) Do you want to change the colors of the syntax
        hilighting?

    (2) Do you want to know how to prevent or fix syntax errors?

    (3) Something else entirely?

Unfortunately last weekend i had to pawn my crystal ball to
payoff the vig, (it seems my financier is not the type to
just "fuggetaboutit") so i'm afraid you'll have to be a
_little_ more specific when asking questions. But seriously.
:-) Syntax hilighting is used by some editors to help a
programmer differentiate between certain elements of code.
And this hilighting can be very helpful to the beginner.

> How do I know the error and effect it?

Oh, you'll know when you make a mistake, because Python will
throw an error message. For instance, if you type "aaa"
(without the quotes) at the Python command prompt, you'll
receive a message that looks similar to this:

    Traceback (most recent call last):
      File "<pyshell#0>", line 1, in <module>
        aaa
    NameError: name 'aaa' is not defined

This one is easy to diagnose. But in order to understand
Python exception messages you need to read some tutorials.
If you think you can start writing code (even Python code)
without some sort of "guide", then you're going to have a
real difficult time. Even folks with prior programming
experience need a guide. I imagine it would be like a
delivery driver moving from Paris to London and trying to
navigate around the streets of Merry ol' London using a map
of Paris. It's just not practical.

> Can't it be programmed like we have in excel that will tell
> you error and prompt you if you wish to accept the right
> formula format?

By utilizing Python, or any other programming language that
is available (and boy, there are quite a few of them!), you
can program your computer to do just about anything you
want. Maybe you could even write a real life HAL5000! But if
you're expecting that your experience with Micrcosoft Excel
formulas will translate over into Python, well, then, you're
in a tough time. Excel is a "single purpose software"
whereas Python is a "general purpose programming language".
Using Python, you could write a spreadsheet program like
Excel. Although I wouldn't suggest it, as there are already
tons of them freely available, and Python is not the best
language for something like that, and Microsoft would not be
too happy about it. But you could do it if you were so
inclined. My advice is that you visit the Python.org website
and look through the list of tutorials for absolute
beginners. After completing a few of these tutorials, you
should be off and running in no time. Here is link:

    https://wiki.python.org/moin/BeginnersGuide/NonProgrammers

After clicking the link, skip down to the section titled
"Tutorials and Websites", and start with "One Day of IDLE
Toying". IDLE is a "fancy text editor" that ships with
Python, and this tutorial is very gentle on beginners. After
you have finished "One Day of IDLE Toying", my next
suggestion would be "A Byte of Python", which will introduce
you to some basics. From there, you can go through all the
other tutorials. When you have finished all the beginner
tutorials, then take a stab at the advanced section. Here is
a link

    https://wiki.python.org/moin/BeginnersGuide/Programmers

And don't forget, Google is a programmers best friend.

Who surprisingly, hardly ever complains.

Which unfortunately, is something i cannot say for the women
i have known. But i digress! O;-)



More information about the Python-list mailing list