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
-
I should hope it was. Otherwise, users could close your app window with no way to get it back besides relaunching the app.
-
@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.
-
Yes, it was. Why do you need this functionality?
-
@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.
-
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.
-
@ahenry91 Ah, I thought you were asking whether it had been removed because you had tried it and discovered that it had. My bad :)
-
Even works with the new Scene module.
Thanks so much. -
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.
-
@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.
-
One question - is there a way to programmatically access the version number / build number from within python?
UPDATE: @omz thanks!!
-
from objc_util import NSBundle info = NSBundle.mainBundle().infoDictionary() version = str(info['CFBundleVersion']) short_version = str(info['CFBundleShortVersionString'])
-
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.mNSString *mainScriptFile = [writableScriptDirectory stringByAppendingPathComponent:@"main.py"];
Is there any reason this would cause any problems or is not advisable?
UPDATE: thanks @omz
-
@Tizzy You can change that if you like.
-
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?
-
@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.
-
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. -
@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?
-
@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).
-
Is there a way to access the 'normal' documents folder of the app from within (for accessing via iTunes file share after allowing in info.plist)? The 'normal' documents folder of Pythonista seems to be in an appgroup now.
os.path.expanduser('~/Documents') now results in '/private/var/mobile/Containers/Shared/AppGroup/E57F167E-F2F0-488A-A406-C6523F6F01DB/Documents' which is not accessable via iTunes fileshare.
-
No idea about iTunes, but what I use is a program called iExplorer. It allows you to read some files from a connected iOS device, but more importantly you can browse local backups, which also include the AppGroup folder.