What others do: Pythonista

The number of iPad IDEs is growing, here is one for Python that I learned about today:

http://omz-software.com/pythonista/

Some quick observations from what I’ve read in the docs (will probably buy this app later today and try it myself):

  • Comes with many parts of the huge standard library.
  • REPL
  • No, it doesn’t offer easy code sharing, but urllib and a scriptable editor. This would mean that you can write your own simple code sharing facility in a few lines. Load contents from URL, instruct editor to create a new file with these contents. Is that true that code sharing is possible if it is not built in, but simply requires you to write a small script once? One program to load them all? See, Apple doesn’t forbid code sharing, they just want to make it insanely difficult.

Now I hope that my real experience with Pythonista lives up to the written promises.

Disclaimer (if needed): This is not to belittle Simeon’s efforts, he’s doing a great job. Just looking for inspiration.

I would love to hear some impressions!

Found an Air Hockey game for Pythonista as a gist. Wrote this script:


import urllib
import editor
url = 'https://raw.github.com/gist/3271073/6130e044172d580722317a95fc1d0799e2be893b/air_hockey.py'
contents = urllib.open(url).read()
editor.make_new_file('AirHockey', contents)

Admittedly, the link is a bit lengthy …

I ran the script, a few seconds later a new editor pane opened with the Air Hockey source code in it, I could immediately push the run button and play it.

That was fast!

Autocompletion of the editor is very good with Codea style suggestions. Text outputs go into a huge output pane. Before storing the game I tried print(contents) and there it was.

While programming, you can swipe the output panel in from the right and you have a REPL input.

Scripts are not organized as projects but simple files. You can however import every such file from every other script.

All docs can be browsed in an in-app browser with full content search. Another advantage of Pythonista’s browser is that if you go back, you really go back to where you were, not the top of the list like in Codea. This makes exploring the libraries easier. Examples are accompanied with “Copy” and “Open in Editor” buttons right in the docs. You can double tap on a function, select “help” and get a nearly instant help window. The speed of HTML (I think it is pure HTML, have to look deeper somewhen; or is it some kind of Wiki underpinnings?) beats the tons of Javascript that try to make Codea’s docs fancy.

This is probably a bad place for advertisement, but if you like Python …

I’ve bought everything for Codea, and I’m going to continue supporting Codea, but I love Python. So I’m going to pick this up over the weekend.

Thanks for your impressions!

Thanks for news! I will buy Pythonista today. =;

I’ve been playing with Pythonista since release. It’s a good app.

I’d like to add Xcode export to Codea, one of the reasons we didn’t have this is because we thought Apple wouldn’t approve. Pythonista does it well, though.

Wow, Pythonista looks great! I have room in my heart for more than one iPad programming app :slight_smile:

This gives me a good excuse (and tool) to learn Python!

Ooh yay, python is my favorite language!
In New Zealand that app costs $6.49, and I have $10 left to spend. Is it worth getting Pythonista or Spritely (a pixel editing program that costs the same)?

Looks interesting at a first glance. I had a look on their documentation which shows some good concepts like the scene and layers and also integrated animation. But all these can be done with Codea, thanks to this very active forum, e.g. the tween lib exists. The export to xcode would be really nice, but I understand Simeon that they didnt add it because of Apples restrictive App policies. Maybe you could add it now in the next releases :slight_smile:

Things which I really would miss in Phytonista and love in Codea are

  • 3D.
  • Physics engine.
  • Simple variable change tests at runtime with parameter().
  • Last but not least this forum. Without it, it would be hard and less fun to create Apps.

So for me, there is currently no other option besides Codea.

To me Pythonista isn’t a replacement for Codea, but rather another tool that allows me to prototype quickly on the iPad, and to get my chops up on new languages. I like both apps. Each one has it’s merits and it’s shortcomings, and I’m glad to have the choice between the two :slight_smile:

Both Codea and Pythonista have their strengths. I introduced this Pythonista thread not to put it against Codea but rather for inspirations and concepts that might be copied.

Pythonista has nice and useful docs. I like the “Copy” button for the in-doc examples. Pythonista also offers the same browsable docs on its homepage. Codea offers two such docs: one its outdated, the other needs a WebKit based browser and is a bit difficult to use.

What I also found very interesting are the ways to get source code from the net. As I interpret it, Apple does not forbid code sharing, they just make it difficult and accept that those “in the know” practice it. In Pythonista you can import a script from the net by using a tiny script like I did it above. If they can do it we should be able to do it, too.

These are some of the things that I am interested in. I would be glad to see Simeon copy such ideas.

I agree with everything @Codeslinger said.

We have been working on a rewrite of the docs for some time now. It’s nearly ready, and I can’t wait to show it to you all. I have some pretty ambitious ideas and have been working hard to make them happen. Docs will be on the home screen, as well as a standalone universal app.

I’ll add an API to construct projects programmatically, allowing one to write similar bootstrapping scripts. We need to be careful here, however. Just because a feature is available in another app doesn’t mean Apple is okay with it - as we have found out several times with Codea.

Finally, we have some really great changes made for Codea 1.5. @John and @Dylan have both created some awesome new rendering features. I don’t want to go Ito specifics because it’s much more fun to hear about a new feature and then have immediate access to it. So I’ll wait until it has been sent off to Apple.

In the mean time I have also been re-writing Codea’s code editor, making it a lot better.

I’m hoping version 1.4.6 is approved soon. It tries to improve speed and stability within the existing design and will be the point after which we start adding new and redesigned features.

@Codeslinger thanks for the example. Howerver on my ipad there is an error when i run the script: the function urllib.open is really urllib.urlopen. Once replaced, the scripts does exactly what you say. Thanks! I wish python had some forum equivalent to this great one.

import urllib
import editor
url = 'https://raw.github.com/gist/3271073/6130e044172d580722317a95fc1d0799e2be893b/air_hockey.py'
contents = urllib.urlopen(url).read()
editor.make_new_file('AirHockey', contents)

@Codeslinger when reading your post it seemed pretty easy to find open repositiries with pyhton games. I’ve started looking on google, but the codes i find seems to use some libraries not included in pythonista. Do you have some other good links to share? Regards.

One

You’re right, Jvm38, it must read “urlopen”. I don’t copy and paste the code but simply retyped the few lines from my fallible memory.

Two

If there is one thing that is inherently non-standardized then it’s graphical interfaces. (One reason why Tcl is still my favorite scripting language across the 3 OSes I use is Tk. Yes, Python has Tkinter, but that’s not exactly the same.) Games and everything else graphical have to be written explicitly for Pythonista just like games for Codea have to be written for Codea. AirHockey was a lucky finding. We have to wait a bit for Pythonista to gain traction.

Mini Codea strengths digest

After writing some good things about Pythonista, I should not forget to mention the strengths of Codea, like e.g. KilamMalik mentioned. Codea comes with 3D and physics support, comes with an absolutely top-notch game, it has a great community (if Pythonista has one it is difficult find) and Simeon is busy to fulfill our wishes.

Agreed, please don’t take my praise of Pythonista as a knock on Codea. I am a huge fan of both apps. I am now particularly excited about the 1.5 update that @Simeon mentioned. It sounds like the text editor is getting some much needed love, and all else being equal I feel like this is the main area for me where it is lacking compared to Pythonista.

Rather than an API to construct projects programatically… just allowing normal File I/O in the sandbox should be sufficient, no? It would be a superset of what we’d want for file loading, and be compatible with gajillions of lua file I/O stuff already existing. (I’m not fond of a new API to do something that an existing API can already do…)

PS. Grabbing it now. I… dislike Python. Typed “hate”, was too strong. I think syntactically significant whitespace is the sign of a deranged mind. But then - I program in Perl for a living, so “meh”. My mild annoyance at some of the pythonisms is overcome somewhat at having another playground, another tool in case I need to use something that some poor unfortunate thought was best done in python. Plus, there’s a guy at work who loves python, but hates Apple and iOS - the cognitive dissonance alone will be worth the 5 bucks :slight_smile:

I’d actually like to see one supporting ruby. Oddly enough, perl isn’t highly desired, even though I think in it. Perl’s “There’s More Than One Way To Do It” has spawned a module hell in CPAN. I’m hoping things like Task::Kensho straighten it out a bit, but not counting on it.

.@Bortels io.* is allowed in the current release of Codea. It might be good to mock up a higher level API using the Lua io library.

It is?!?!? Well, foo - I had it stuck in my head that you had to monkey with the app to turn it back on, and didn’t want to go there. I have something new to play with now! :slight_smile:

I assume it’s restricted to the Codea sandbox - can you get to other project directories within Codea? if you can, I don’t see writing a “gist loader” or such would be difficult at all…

I’m operating under the assumption apple won’t let you add a downloadproject(url) function - but will look the other way when we roll our own… The new cut and paste is a 99% solution, and if we have a “just cut and paste the import/export program”, that is close enough…

… and it’s looking like I’m overly optimistic in what io.* has available (can’t get a directory listing???). Add lfs for equivalent to the wishlist. I suspect we can still do blind hackery, but it’s not as appealing.