omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    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.


    New Xcode Template on GitHub

    Pythonista
    14
    38
    30954
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • andymitchhank
      andymitchhank last edited by

      Thanks for this! The instructions are very thorough also. It is much appreciated.

      1 Reply Last reply Reply Quote 0
      • andymitchhank
        andymitchhank @omz last edited by

        @omz Has the 2 finger slide down gesture to close the Pythonista script been removed from the template? It doesn't appear to be working directly in Pythonista anymore. (This may have been addressed already, but I can't seem to find anything about it being removed).

        1 Reply Last reply Reply Quote 0
        • Webmaster4o
          Webmaster4o last edited by

          I should hope it was. Otherwise, users could close your app window with no way to get it back besides relaunching the app.

          andymitchhank 1 Reply Last reply Reply Quote 0
          • andymitchhank
            andymitchhank @Webmaster4o last edited by

            @Webmaster4o I know this was an issue with previous versions of the template. If you look at the Pythonista-Tools github repo and download some of the apps in the apps store, you can close the app window.

            1 Reply Last reply Reply Quote 0
            • Webmaster4o
              Webmaster4o last edited by

              Yes, it was. Why do you need this functionality?

              andymitchhank 1 Reply Last reply Reply Quote 0
              • andymitchhank
                andymitchhank @Webmaster4o last edited by

                @Webmaster4o Oh, I don't need/want it. I just wanted to make sure that it was removed and I don't have access to my mac at the moment to test it.

                Webmaster4o 1 Reply Last reply Reply Quote 1
                • omz
                  omz last edited by

                  The gesture should still work for scripts running in Pythonista, but the Xcode template blocks this behavior, so a two-finger swipe gesture shouldn't do anything in a standalone app.

                  1 Reply Last reply Reply Quote 1
                  • Webmaster4o
                    Webmaster4o @andymitchhank last edited by

                    @ahenry91 Ah, I thought you were asking whether it had been removed because you had tried it and discovered that it had. My bad :)

                    1 Reply Last reply Reply Quote 0
                    • mrcoxall
                      mrcoxall last edited by

                      Even works with the new Scene module.
                      Thanks so much.

                      1 Reply Last reply Reply Quote 1
                      • bortels126
                        bortels126 last edited by

                        Hey. I just wanted to stop by and say thank you for this. I consider it above and beyond, and the thorough instructions in the readme are very much appreciated. Time to go play with it.

                        1 Reply Last reply Reply Quote 1
                        • Tizzy
                          Tizzy last edited by

                          @omz I'm adding my sincere thanks here as well. I've been making extensive use of the old one and chiming in about a desire for this here and there. This is seriously empowering stuff.

                          By the way, I listen to "Accidental Tech Podcast" (atp.fm) live, and there's a "tipster" from Apple that answers questions in their irc chat after the live shows - I mentioned pythonista and the fact that you can make iOS apps from iOS with it and asked if people were generally aware of it and how people inside apple felt about it. He said they were very aware, and highly impressed.

                          1 Reply Last reply Reply Quote 0
                          • Tizzy
                            Tizzy last edited by Tizzy

                            One question - is there a way to programmatically access the version number / build number from within python?

                            UPDATE: @omz thanks!!

                            1 Reply Last reply Reply Quote 0
                            • omz
                              omz last edited by

                              @Tizzy

                              from objc_util import NSBundle
                              
                              info = NSBundle.mainBundle().infoDictionary()
                              version = str(info['CFBundleVersion'])
                              short_version = str(info['CFBundleShortVersionString'])
                              
                              1 Reply Last reply Reply Quote 1
                              • Tizzy
                                Tizzy last edited by Tizzy

                                Another question:

                                In the previous template I figured out that I could change the name of my main python file by searching for "main.py" and then changing it to whatever script I want to run.
                                in PAAppDelegate.m

                                NSString *mainScriptFile = [writableScriptDirectory stringByAppendingPathComponent:@"main.py"];
                                
                                

                                Is there any reason this would cause any problems or is not advisable?

                                UPDATE: thanks @omz

                                1 Reply Last reply Reply Quote 1
                                • omz
                                  omz last edited by

                                  @Tizzy You can change that if you like.

                                  1 Reply Last reply Reply Quote 1
                                  • Doglike-spike
                                    Doglike-spike last edited by

                                    Just tested it out and it almost works flawlessly, there were a few issues with indents, but nothing large. Being new to the world of programming, I was just wondering how exactly this work. Does the XcodeTemplate translate the Python language into Objective C, or does the Iphone actually support Python?

                                    Webmaster4o 1 Reply Last reply Reply Quote 0
                                    • Webmaster4o
                                      Webmaster4o @Doglike-spike last edited by

                                      @Doglike-spike I think he basically rewrote parts of the Python language, in order for it to work on iOS. I'm not sure though.

                                      1 Reply Last reply Reply Quote 1
                                      • dgelessus
                                        dgelessus last edited by

                                        Python (at least the main implementation, CPython) is written in C, and Objective-C is a superset of C, which means that C code should compile as Objective-C without modification. The iOS/Pythonista-specific modules like console, ui, location, etc. are custom extension modules written by omz, they are not available outside Pythonista.

                                        1 Reply Last reply Reply Quote 1
                                        • Tizzy
                                          Tizzy last edited by

                                          @omz is it a shared codebase such that we can expect the template to always be up to date with the latest release version of pythonista?

                                          1 Reply Last reply Reply Quote 0
                                          • omz
                                            omz last edited by

                                            @Tizzy Yes, the template is basically a subset of the main app. It would actually be possible to take the PythonistaKit framework out of the App Store version, and build your own template with it (I think @stroughtonsmith has actually done that).

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Powered by NodeBB Forums | Contributors