@Tito Hi Tito, I recently used this same book (which I checked out of the Gold Coast Library, Qld). It is hard as it builds skills through repetition and each chapter builds on the previous so you can;t really jump ahead. I found it useful up until it started on "Object Oriented" stuff. I think you should rename the book "Learn Python an even Harder Way with Pythonista" but if you're new to Python I'd recommend "Python, in easy steps" by Mike McGrath as a better intro. This book is also available at the same library (if by some weird coincidence you're in GC).
Latest posts made by nev
RE: Learn Python the Hard Way with Pythonista
Thanks for your help, as JonB suspected my problem was having scripts located in "External Files".
After creating a new folder in the "SCRIPT LIBRARY" in "THIS iPAD" then importing the scripts from my iCloud drive (MYsubs.py and MYmain.py) into this new folder the "from MYsubs import sub1,sub2,sub3" statement in MYmain.py correctly located my custom modules (sub1, sub2, sub3) from MYsubs,py.
I was so happy to discover Pythonista and it worked like a breeze when I first opened it up and clicked on "EXTERNAL FILES"/"Open" selected and ran some python scripts from the iCloud Drive, which I'd been developing on the iMac/PyCharm, that I tried several scripts which again all worked until the aforementioned import error. Of course I hadn't read any documentation or run tutorials, but reading your responses then looking at the Pyhonista app, it's pretty obvious (now) that I should have imported the scripts into the "SCRIPT LIBRARY" (Dooh!).
Apologises for taking your time, next time I'll do a little more homework, but again thanks for your responses, it got me to the solution pretty quick. Next task is to do platform or screen resolution identification as although the scripts work now on iPhone & iPad the formats will need much massaging.
I have been using PyCharm on an iMac and have developed some modules that are imported into my python script (MYmain.py) using the statement "from MYsubs import sub1,sub2,sub3". This all works fine in PyCharm with the MYsubs.py and MYmain.py in the same project file structure, but the same statement with Pythonista on my iPad results in "ImportError - No module named MYsubs". I have copied MYmain.py and MYsubs.py into the External Files structure and also tried with a copy of MYsubs.py in the script library (This iPad) location, but cannot satisfy the import command, what is the correct method to define the path to external custom modules in Pythonista? If you could provide details of how to import custom modules from an external file, please advise.