• The trick in this case is that, while you cannot resize a view presented using present, you could have another blank view be the one you present, and then the view you are resizing is a subview.

    @polymerchm implemented this in a clean way, for use in settings menus, where he creates a semi-transparent view that dims whatever is on screen (could be another view), and creates a Fullscreen "shield" view. Inside that shield, you can have a subview that draws any other view wherever you want on the screen, and now can be resized like any other view.:
    This concept can be extended to detect touches on the shield, to dismiss it when user taps outside the settings view.

    Another option is to use my overlay class, which is designed for draggable window overlays.

    Even if you don't use the actual draggable overlays, this shows how you can grab the pythonista app window root and add subviews the the main pythonista app window, that can live wherever you want and can be resized, however you have to take a little care in order to not crash things.

  • @halloleooo Ho. Nice, I didn't know, never too old to learn

  • That worked! Thanks everyone I can’t believe how fast you all provided help.

  • I'll just point out that the turtle module in pythonista is written in pure python (plus the canvas or ui module, I forget which), so can be edited to provide whatever missing functionality you need... Although that may be more effort than you really want!

    For instance, see

    The cpython turtle module is mostly NOT tkinter -- in theory it shouldn't be too hard to just strip out the tkinter drawing methods with ui.path drawing methods.

    If you are trying required to submit programs that work in a particular environment, you probably should make sure that you run your final checks in that
    environment -- get yourself a free shell account if you don't have a desktop/laptop. Sagecell also is a way that you can run code in a more standard environment (there are some threads on pythonista and sagecell with a wrench script that lets you run a script edited in pythonista on a sagecell server)

  • @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

Internal error.

Oops! Looks like something went wrong!