• Physick

    By didn't work, I meant that the console didn't know about the class in the file that was just executed. Suddenly, it did work and remained working all evening. Tonight, I can't import or use the class in the just run file.

    So, I checked sys.path as you suggested. Sure enough the top-level directory of Pythonista isn't in the path.

    No errors of any kind appear, except no module myclass (not the real name, but it doesn't seem to matter), which since the folder isn't in the path makes sense.

    Import os


    Which is the folder where the file is located.

    I think this is a bug. It works sometimes and not others. It began when I updated the OS. Before the update, this worked every time.

    posted in Pythonista read more
  • Physick

    Hello. I'm pretty new to python. I found it years ago, but only in the last few months have I started using it. I found Pythonista to be a huge help with learning Python. Everything you need is on your iPad. You don't need the Internet to look things up. It's a great way to occupy your time on a flight. So, I can't agree with your poorly supported comments. I find it has help, autocomplete and other features that really help. I've been recommending it as a way to get started with Python. By the way, I'm an experienced programmer, but for the last 15 years, I mostly run projects and don't do much coding. I'm also old! Object oriented was a hard thing to adjust to. What really made the difference for me with Python was that I took a course at the community college. Five days of 8 hours a day for 24 of our staff. It was an introductory course, I already knew most of it, but at the end of the week, I could suddenly program in Python.

    posted in Pythonista read more
  • Physick

    @JonB. So, thanks. I think this is just a flakey part of the new iOS update. Things don't work and then suddenly do. I appreciate your help on this.

    posted in Pythonista read more
  • Physick

    @jonB Hi. I totally agree with what you say. But part of it doesn't work. That part is when I run a script that defines a class and then immediately go to the console and try to use the class. This used to work and has stopped. I could even import other modules in the same directory as the first I ran, but now that doesn't work anymore.

    I copied your test script and put it in a file, which I then ran. Here is the result:

    3.5.1 (default, Sep 20 2016, 14:05:14)
    [GCC 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.31)]
    cwd: /private/var/mobile/Containers/Shared/AppGroup/87C36EF0-5007-410A-81F1-2CDA5EF1C05E/Pythonista3/Documents
    ['/private/var/mobile/Containers/Shared/AppGroup/87C36EF0-5007-410A-81F1-2CDA5EF1C05E/Pythonista3/Documents', '/private/var/mobile/Containers/Shared/AppGroup/87C36EF0-5007-410A-81F1-2CDA5EF1C05E/Pythonista3/Documents/site-packages-3', '/private/var/mobile/Containers/Shared/AppGroup/87C36EF0-5007-410A-81F1-2CDA5EF1C05E/Pythonista3/Documents/site-packages', '/var/containers/Bundle/Application/AAFBB031-7AB0-4862-8A10-4DE7B07D7E10/Pythonista3.app/Frameworks/Py3Kit.framework/pylib', '/var/containers/Bundle/Application/AAFBB031-7AB0-4862-8A10-4DE7B07D7E10/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages', '/var/containers/Bundle/Application/AAFBB031-7AB0-4862-8A10-4DE7B07D7E10/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/PIL_compat']
    i am a global

    When I then print(x) on the console it works as per your example.

    Now for the weird part! I retried my running my class definition. It didn't work. I did it again. It didn't work. Out of desperation I tried import my class--and it worked! I then went a=myclass.myclass(0.,0.) and it works. Just like it used to.

    posted in Pythonista read more
  • Physick

    @JonB Hi. I am new to python. This behaviour is a change with the new OS. On the iPad all the scripts are in the app's file space. It's reasonable to assume that directory is always on path--at least the top level folder, which is where my script is located.

    This is just an annoyance really. Things still work, but extra effort is needed to go test your new code. Other non-Pythonista problems are rampant with iOS 11, like my icons oriented at 90 degrees to my background. A reboot fixed that for now, but it seems turning the iPad at the wrong moment will do that. After a few updates, maybe everything will work again.

    posted in Pythonista read more
  • Physick

    Pythonista is great! Thanks for producing it. Unfortunately since iOS11 came out my iPad Air is having a lot of difficulties. Here are two that I’ve found with Pythonista 3.
    Smart Quotes: The keyboard produces smart quotes (single or double) when using a triple-quote for a comment. Can probably change the default keyboard or suppress this, but haven’t looked for it yet. Fortunately, the character bar quotes work!

    Importing modules/files. Pythonista can no longer find the cwd from the console. Using os.listdir(‘.’) will show the file, but you can’t import it. You also can no longer run the file, switch to console and use the defined variables and classes as was possible previously. Things do work if you create and run a file that imports a second file. Just wanted to see if others are having these issues?

    Fixed the smart quotes by turning off "Smart Punctuation" under Settings - General - Keyboard.

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!