• @Luximonsti I save the image to my photos on my iPhone 11. Then I go into photos and click on the image. Once I’ve clicked on the image I click on the share icon. Then I click save to files. On that screen I rename the file and save it Pythonista somewhere. After that I go in to fight on Easter and move it into my project folder. Hopefully that helps

  • iOS does not really allow one app to close (throw out of memory) another app because that is considered a bad user experience.

  • @manuel, by launcher, do you mean something that shows different apps that you can then, well, launch?

  • @Luximonsti, you could also share the code you have so far.

  • Thank you for the info

  • Thanks it should be a great starting point for it ^^.

  • Many of the Pythonista-specific modules are written in C (or Objective-C) and compiled, so you can't see the source code for them. To find out if that's the case, import and look at the module in the Python console:

    >>> import console >>> console <module 'console' (built-in)>

    The "built-in" part means that the module is compiled and not written in Python.

    Some modules (like scene) are actually made of two modules: the main module is written in Python, and it imports a second module that is compiled. For example, you can see the location of the scene module's Python code:

    >>> import scene >>> scene <module 'scene' from '/var/containers/Bundle/Application/.../Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/scene.py'>

    However if you look into the scene.py file, you can see that it imports a _scene2 module, which is compiled:

    >>> import _scene2 >>> scene2 <module '_scene2' (built-in)>

    That means you can read the parts of the scene module that are written in Python (scene), but not those that are compiled (_scene2).

  • @Drizzel, I was thinking about getting 100% accurate detection by first doing the rectangle intersection, and if that indicates a possible hit, then placing shape 1 on a canvas in memory, then ”deleting” the non-transparent pixels of shape 2 (also properly placed). If the end result does not equal the original, you have a hit.

  • Layers really are not required anymore -- this used to be a way to move groups of items together, but with spritenodes you can do the same by assigning as a child of another Node.

    If you just want to get the stacking order, use SpriteNode's z_position.

  • You basically have to implement a physics system with a gravity component.

    Here is a simple example. Change the initial velocity to change angle of arc.

  • Try using Long Path Tool program, it really works for me! I recommend it to you.

  • @ccc , no I was not in any of the beta programs. I found the update worked from the updates page, although from the app's own page when an update is available the button changes from "open" to "update". I was not seeing that from the app's page itself. My only option was "open" and when I opened and went to the settings dialog in Pythonista 3 it clearly said 3.0 and not 3.1 (which it did display after updating from the updates page). Now I have the widget!

  • For me, at least, I think it would be more organized to take this approach:

    class King(ChessPiece): def availableMoves(self): returns place to move to #Do this with all the chess pieces: class Queen class Bishop class Knight class Rook class Pawn

    All would inherit from a single class, ChessPiece, so that they could all have the common features while still retaining what makes them different, like available moves. Then, you could create a nested list for your pieces.

    R1, R2 = Rook(), Rook() B1, B2 = Bishop(), Bishop() K1, K2 = Knight(), Knight() QQ = Queen() KK = King() P1, P2, P3, P4, P5, P6, P7, P8 = Pawn(), Pawn(), Pawn(), Pawn(), Pawn(), Pawn(), Pawn(), Pawn() NN= 0 Board = [[R1, K1, B1, QQ, KK, B2, K2, R2], [P1, P2, ... [NN, NN, ...

    Continue on like that. That could eliminate your chessboard module.

  • @amharder If you want to use Unicode characters in string literals, there are a few better options than unichr. For all of them, you should use unicode strings (u"...", with a u before the string) because Python 2's old str strings don't work properly with Unicode.

    First, you can use a Unicode hex escape like u"\u2654", this is simple but not much nicer than unichr. There are also Unicode name escapes like u"\N{WHITE CHESS KING}", this inserts the Unicode character with that name into the string.

    The third option is to copy and paste the characters you need directly into the Unicode string. If you do this, you also need to add the following line to the start of your script:

    # -*- coding: utf-8 -*-

    This comment tells Python how Unicode characters are stored in the file, so it knows how to read them. Then you can type or paste any Unicode character into your u"..." string and it will appear correctly.

    By the way, Python 3 is much better at handling Unicode than Python 2 is. Python 3's str supports Unicode correctly, so you don't have to use unicode and u"..." strings by hand, and you can type Unicode characters directly into your file without adding a coding line at the top. There are lots of other great features in Python 3 too. If you're already using Pythonista 3, you can try switching your Python version to 3.5 and see if your script runs with that.

  • @Webmaster4o I'll try that website but I already posted the other lines too

  • @MTcoder Yes... This forum is the places for that. I believe that what @omz was saying with his post above was that he was able to reproduce the problem locally and that in his expert opinion, he believes that it should be recorded and tracked in our new bugbase.

  • @VIC3

    I think I'm still a little confused. But let's see if this is right:

    You start your script You type in a path (path) The UI comes up You want browser to show a file browser view using your path *(quick way would be a tableview) *

    If that's the case you first need to construct your data differently. You will need either a list or a dictionary to use for a tableview data source. Have you made a tableview before?

    Did you try os.listdir like @dglessus mentioned?


    #os.listdir takes a path argument my_file_list = os.listdir('../Documents')

    Also: You could get path input from a console.input_alert() (a popup) rather than typing it into the console.

  • Exactly. str is the string class, and you can use it to convert an object to a string. For example, str(42) is the same as '42'. This is important when you want to do something like this:

    print("Your score is: " + str(42))

    Without using str, you would get a TypeError, because you can't add a string and a number.

    This means that if you assign something different to the name str, you cannot use the original str class anymore. The same goes for other standard types like int, float, list, dict, etc.

Internal error.

Oops! Looks like something went wrong!