GoPiGo script

hakugin.gin at gmail.com hakugin.gin at gmail.com
Mon Nov 2 10:19:09 EST 2015


On Monday, November 2, 2015 at 9:28:35 AM UTC-5, input/ld... at casema.nl wrote:
> He mike,
> 
> Thank you or making this script.
> Only I get errors for sleep.
> I also tried to change it to time.sleep() but that also gives errors.
> 
> File "test05.py", line 23
>     sleep(2)
>         ^
> SyntaxError: invalid syntax
> -------------------------------------------------------------------------------
> 

And this is why I shouldn't code while tired hahaha...

I reviewed the code I submitted and found a couple of other errors. If you are changing the "sleep()" lines to "time.sleep()" you will need to change the line "from time import sleep" to "import time", otherwise you will most likely encounter something like:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'time' is not defined

Since you are just beginning with Python I would suggest reading various entry level books such as Python 101 by Mike Driscoll, which I have read and own. I am not Mike Driscoll, but his book and blog, http://www.blog.pythonlibrary.org/ have been extremely helpful. There are MANY resources available for learning the Python programming language out there, including https://wiki.python.org/moin/BeginnersGuide



More information about the Python-list mailing list