• Pythonista posted

    This is awesome. Thanks for making this. Now I just need to figure out a way to access it at my school computers.

  • Stackoverflow rules for general programming questions...


  • @cvp actually, one possible issue is that you did

    from ftplib import FTP

    then overrode the FTP class with an instance variable named FTP.
    So the second call to FTP is actually referring to the first instance, not ftplib.FTP class constructor anymore. So even if you renamed the second variable, the first one led to the confusion. The second try block would have resulted in a NameError or TypeError depending on whether an exception was caught in the first try. The try-except prevented you from seeing the real error.

  • Swipe-to-delete should work, but you can also tap the Edit button, select the file(s) you want to delete, then tap Delete (in the bottom toolbar).

  • I agree. I use Editorial to make quite large outlines. To navigate and work easily with long texts, I want sections to be folded when I open a file.

    Several times I by accident I tapped the triangle button in the left corner and the next time I opened that document, everything was unfolded. So I had to fold all these many items manually.

    So my wishlist:

    an undo button for "unfold everything" a button to fold everything put the triangle button in another place
  • I would say that it would be a nice feature but, of course, not if it made the app review more problematic. I presume there is no way to programmatically change the script which is the Today widget?

  • Solved by pyicloud update, see here

  • OK,thanks. I‘ll have a watch.

  • Do you mind posting the final script with the changes. I would love to see how it turned out.
    Thanks in advance.

  • @iAmMortos said:

    Using tommasoturchi's mysqldb connector, I'm doing this:

    import mysqldb db = mysqldb.connect(host="my.host.com", user="user", passwd="pass", db="MyDBName", port=3306) cursor = db.cursor()

    and I'm getting an error: ord() expected string of length 1, but int found all the way down in the network.py file at self._packet_number = ord(packet[3])

    wassup with that?!


    I think the port should be a string.

  • @omz I hadn't! Exactly what I was looking for. I'm interested in trying to use QR codes for indoor navigation and I thought pythonista would be a great platform for demonstrating this. I'll come back and share when I have some results.

  • I tried adding:

    import locale locale.setlocale(locale.LC_ALL, 'de_DE')

    as they said - but I just get 'unsupported locale setting'

  • Thanks for the heads up!

    There was an error in the regex to parse the bottle version. Should be fixed now. Your approach unfortunately wouldn't work with version strings like '0.13-dev'. Anyway, I think on Python 2 the version of bottle included with Pythonista should be fine, so I adapted the code to reflect this too.

  • Ah, if you want to separate the Python files too, then you need to get one file to load the other. This should be easy to do by putting both scripts into the same folder (which you probably did already) and then importing the second file from the first:

    # In main_script.py: import other_script

    Now, to present the second view from the main script, but using the functions from other_script, we have to use a small trick. In the other_script, create a function that looks like this:

    # In other_script.py: def load_other_view(): return ui.load_view("other.pyui")

    Then you can call this function in your main script to load the other view:

    # In main_script.py: import ui import other_script main_view = ui.load_view("main.pyui") other_view = other_script.load_other_view()

    The reason why we need to define the extra load_other_view function in other_script is that ui.load_view looks for action functions and such in the script from which it is called. If we load both views from main_script, it will try to find all action functions there. To load the second view's action functions from the other file, we define the load_other_view helper function that loads other_view.pyui from within other_script. That way other_view.pyui's action functions are always loaded from other_script, even if load_other_view is called from elsewhere.

  • @donnieh Thank you, I found the bug now.

  • No, this is not possible. iOS puts every app in its own sandbox, which means that it can only modify its own data. Most parts of the file system are not readable at all, including data of other apps.

  • @dgelessus thanks that helps a lot, and makes a lot sense. I'll make sure to not use input() on version 2. Even though I was just making files to mess around with not for any real purpose. Thanks a lot for explaining it.

  • Although it is a bit finicky and smallish, firebug-lite does work on the ipad, and has an inspect feature. Here is an example of how you could integrate this into pythonista.

    If I knew js/css better, I would increase the button sizes a smidge, and make it so you can redisplay the plugin after dismissing it...right now when it closes...it is closed for good.

  • @TutorialDoctor thanks that will help a lot. I have my default interpruter set at 2.7 because that the closest to what they use on learn python the hard way. I'll have to play around with it some more.

  • Cool. Looking forward to more.

Internal error.

Oops! Looks like something went wrong!