omz:forum

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

    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 0
    • Topics 2
    • Posts 8
    • Best 0
    • Controversial 0
    • Groups 0

    TQA

    @TQA

    0
    Reputation
    481
    Profile views
    8
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    TQA Unfollow Follow

    Latest posts made by TQA

    • Help with FTP

      I want to read lines from a text document. But I can't seem to get the FTP connection working..

      from ftplib import FTP
      ftp=FTP('ftp.mydomain.com')
      ftp.login('username','password')
      ftp.retrlines('LIST')
      

      I know this will list the directories.

      posted in Pythonista
      TQA
      TQA
    • RE: Help with FTP

      Am I using anything wrong? I pretty much copied the example program..

      EDIT: Trying it again I get "error_perm: 500 AUTH not understood"

      EDIT: Sorry for the edits! It seems to be working now..? I switched to just FTP. Is it possible to read/write to a specific file via FTP?

      posted in Pythonista
      TQA
      TQA
    • RE: Help with FTP

      I do not get any error messages.. just appears to by idle. Doesnt move on through the program. Sorry for short responses, as I am on my phone.

      posted in Pythonista
      TQA
      TQA
    • RE: Help with FTP

      @dvader9: I have those in my program. was a typo when I wrote this post.

      posted in Pythonista
      TQA
      TQA
    • [HELP] Update View During Button Action
      def changeBackground(sender):
       z=sender.superview
       x=1
       while x<=10:
        button='button'+str(x)
        z[button].background_color=(0,0,0)
        x+=1
        time.sleep(1)
      

      In my mind, this code (assuming that this gets called by pressing a button) should change the background color of 'button1', 'button2', and so on in order. Changing one every second.

      However, if this code was ran the program would wait for 10 seconds and then update all of the buttons' background colors at once. How can I get it to update the UI at the time when that line of code is ran? I have tried z[button].set_needs_display() to no avail.

      Thanks!

      posted in Pythonista
      TQA
      TQA
    • RE: [HELP] Update View During Button Action

      I seem to have run into a problem..

      I write

      import os
      import os.path
      
      with open('save.txt','w') as f:
       f.write('hello')
      
      with open('save.txt','r') as f:
       f.read()
      

      Nothing happens. I don't get any errors, but the console output window doesn't even open.

      posted in Pythonista
      TQA
      TQA
    • RE: [HELP] Update View During Button Action

      I just want to save a single integer along with the date/time. I feel pretty stupid. I have no idea how this works as I have never done anything with reading/writing files before. How do I create a file to be written to?

      posted in Pythonista
      TQA
      TQA
    • RE: [HELP] Update View During Button Action

      Thank you all for the help! I once thought I was fairly fluent in Python, however I now realize how little I know.

      EDIT: Another quick thing. Let's say I make a game on Pythonista, is it possible to make some sort of "savegame" file? That way You could save leaderboards and/or progress?

      posted in Pythonista
      TQA
      TQA