omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular
    1. Home
    2. Phlurim

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    • Profile
    • Following 0
    • Followers 1
    • Topics 6
    • Posts 17
    • Best 1
    • Controversial 0
    • Groups 0

    Phlurim

    @Phlurim

    1
    Reputation
    874
    Profile views
    17
    Posts
    1
    Followers
    0
    Following
    Joined Last Online

    Phlurim Unfollow Follow

    Best posts made by Phlurim

    • Newbie Problem With Where Pythonista Auto-Saves Own .py Files

      I am an absolute newbie to Python on my iMac, and to Pythonista on my iPad. {So far, Pythonista seems a bit more user-friendly for me, at my current level of knowledge.} My learning is going well, but slowly. The following are some initial questions w.r.t. Pythonista in particular:
      I have a few test .py programs I've created with Pythonista. I appreciate that they get saved automatically, but I have no idea where they’re saved to. I created a 'work' folder in my iPad, but Pythonista doesn't appear to save any of my work to it. My ‘work’ folder is always empty.
      Is there a reference someone could give me, please, pointing to any Pythonista (or Python) documentation that explains where my .py files are getting stored to automatically; plus, how might I be able to change the auto-save location to my iPad’s ‘work’ folder?
      I have similar questions about IDE, and some other newbie questions, but they’ll have to be for another day.

      Thank you … Phlurim

      posted in Pythonista
      Phlurim
      Phlurim

    Latest posts made by Phlurim

    • RE: ANSI escape sequence codes

      Thanks. Before I installed Pythonista on my iPad Pro, I had already installed Pyto
      last winter on my Mac desktop (Monterey Intel). Your code works great via Pythonista, but I'll give the ANSI escape sequence code a try on Pyto.

      I find that Pythonista, and it’s tablet environment, are more newbie-friendly than Pyto, for my particular style of self-taught learning. Am having fun playing with Python at my own leisurely pace (my ‘hobbies’!) It’s also good therapy for propping up my aging memory (I'm a 77½ yr old retired Canadian electrical engineer with a ‘not-dead-yet’ insatiable desire for learning new things.)

      One final question: I’ve seen the occasional on-line comment that Python 3 and Pythonista 3 are now obsolete, and that programmers should abandon them, and upgrade ASAP. Is this true?

      Thx

      posted in Pythonista
      Phlurim
      Phlurim
    • RE: ANSI escape sequence codes

      I’m a newbie, and am having lots of fun playing with your slick code. Thx again for sharing it.

      posted in Pythonista
      Phlurim
      Phlurim
    • RE: ANSI escape sequence codes

      Many thanks. Your code works great on my iPad.

      posted in Pythonista
      Phlurim
      Phlurim
    • ANSI escape sequence codes

      The ANSI escape sequence codes don’t seem to work for printing bold text in Pythonista 3 on my iPad Pro. Many forum contributors suggest code like the following, which I copy & paste. And they all say it’s as simple as this. It does seem simple, which is exactly what I’m looking for. But it doesn’t seem to work for me.

          *print("This is bold text - looks like:",'\033[1m' + 'Python' + '\033[0m')*
      

      My Pythonista 3 console output:

          *This is bold text - looks like: [1mPython[0m*
      

      And the word ‘Python’ is not shown as bolded.

      Am I forgetting something? Is there a particular module that I’m suppose to import first? Is ANSI recognized by Pythonista? Is there a unicode alternative to ANSI?

      Please advise. Thank you.

      posted in Pythonista
      Phlurim
      Phlurim
    • RE: tabulate() Pythonista on iPad Pro

      Ok. Thx.
      I tried installing tabulate() via Pythonista on my iPad Pro. But the directions seem to require a Mac keyboard, versus iPad’s on-screen keyboard?! Does this mean I have to connect an Apple keyboard to my iPad in order to be able to install tabulate()? If so, I don’t see this as a problem. Thank you.

      posted in Pythonista
      Phlurim
      Phlurim
    • tabulate() Pythonista on iPad Pro

      Can’t find any info about using tabulate() in Pythonista on my iPad Pro. If not feasible, are there any alternatives to tabulate()?

      posted in Pythonista
      Phlurim
      Phlurim
    • RE: Write & Read Floating Point Data To File

      Thx for the code snippet. I see what’s happening here w.r.t. json.dump & json.load, but still not clear on the format of the data that ends up in ‘floats.txt’, ‘out_file’ , and ‘in_file’ after each of these json methods. I’m guessing ‘floats.txt’ always contains string formatted data only. But what’s in ‘out_file’ , and ‘in_file’! In which case, how then can I read it - retrieve it from floats.txt - and use it as float variables instead of string variables? (This probably gives a good idea just where I am in learning Python - I’ve a looong way to go!)

      posted in Pythonista
      Phlurim
      Phlurim
    • RE: Write & Read Floating Point Data To File

      Thx. I think my problem boils down to a personal lack of rudimentary understandithe form that my floating point data must be converted to before Python will allow it to be written to my file, via write().

      I think I’m suppose to convert each floating point data item to a representative text string via str(), before writing to my file via write(). I understand that, by doing this conversion, my file will contain ASCII strings that are the text equivalents of my original raw floating point data. I believe that, if I fail to do this conversion prior to Python will likely not save my data to my file as floating point numbers.

      I would much appreciate any feedback as to whether or not my interpretation is on track.

      Thank you … Phlurim

      posted in Pythonista
      Phlurim
      Phlurim
    • Write & Read Floating Point Data To File

      After creating my own file (“w”), I would like to know how to:

      • Write floating point data to file
      • Print (or otherwise view) entire contents of file to confirm it contains all the float data I wrote to the file

      After re-opening my file (“r”), I would like to know how to:

      • Read content of this file, line by line.
      • Print (or otherwise view) contents of file to re-confirm it contains all the float data I wrote to it
      • Use the float data contained in my file for doing math calculations
      • Save calculation results (floats) to another file
      • Print (or otherwise view) contents of this other file to re-confirm it contains all the calculation results
      posted in Pythonista
      Phlurim
      Phlurim
    • RE: Importing a math module

      I’ve had occasional puzzling error msgs while using Python’s built-in modules (import math for example). It seems that Python accepts either ‘math.pi’ or ‘pi’ in my main code. At other times, not.
      What are the specific syntax rules for stipulating, in main code, the names of the functions inside imported Python modules.

      Supplementary question: My code includes a function. My function calls a function inside a built-in Python module. Is it necessary to import the Python module from my main code, or from inside my function?

      posted in Pythonista
      Phlurim
      Phlurim