Forum Archive

Pythonista Tutorials

bethanybeachbum

Looking for best tutorials for Pythonista on YouTube or elsewhere on the Internet. Haven’t found anything satisfactory on simple Google search or YouTube search. Any suggestions appreciated.
Thank you,

ashishkumarji

yes, i am looking a tutorial with good examples

JonB

are you looking for tutorials of python in general? Or pythonista specific modules like ui and scene?

bethanybeachbum

Pythonista specific. Want to learn pythonista on iPad. Already know some Python on Mac laptop.

cvp

@bethanybeachbum did you already check the examples provided with Pythonista?

JonB

Iirc, I did most of
http://www.pythonchallenge.com/
On my iPad using Pythonista. It has been a while -- you can use the embedded web browser (although you often need to see the url bar, so maybe you need to switch back and forth with safari) or requests.
This covers many modules in the python standard library, though is probably not really a beginner tutorial per se, there are usually clues to tell you which module to use, then it is up to to read the docs in that module.... At some point you'll need to learn to use the requests module so you can download files.

I think @ccc used to recommend Zed Shaw's book, Learn Python the Hard Way, which you can find online / at your local library's ebook system, etc.

For pythonista specifically, the main pythonista specific modules are ui for "apps", scene for gamesu, and editor for doing things with code. Also objc_util for doing nativey things(not for beginners, unless you also know ObjC), photos, location and maybe a few other very specific modules...the built in docs are your friend, use it.
Some resources include:
https://github.com/Pythonista-Tools/Pythonista-Tools, which hosts pinks to a number of code demos. For instance you will find links to @TutorialDoctor 's ui projects
https://github.com/TutorialDoctor/Pythonista-Projects/tree/master/Projects/UI

@humberry's ui tutorials
https://github.com/humberry/ui-tutorial

@enceladus pythonista examples
https://github.com/encela95dus/ios_pythonista_examples

If you are new to pythonista, install stash, https://github.com/ywangd/stash
So you have access to pip, and other unixy tools.

The best way to learn is probably to pick a small project, something useful or fun to you, and dive in, asking for (specific) help when you get stuck.

mikael

@JonB, your post should be pinned to the top of the forum, wonder if @ccc has access.

Wenzel3

Thanks for the step by step tutorial.

My Card Statement

william26445

@JonB Hey! I am looking for some modules related to vector graphics and Pythonista's extensions, tried searching but didn't find quality, could you please suggest some?

ccc

https://forum.omz-software.com/topic/6147/equally-spaced-circle-in-ui
points to https://github.com/mikaelho/caves vector.py

JonB

@william26445 when you say vector graphics, do you mean SVG specially? Or just graphics consisting of lines, rectangles, ellipses, etc?

The scene and ui Path have the usual assortment of lines, arcs, ellipses rectangles, etc, that you would expect from a vector graphics program.

Here is an example of a clock.
https://forum.omz-software.com/topic/4168/analog-clock-example-to-ui-example-help

For ui, you subclass ui.View and define a draw method.

For scene, you would define a draw method within your scene.Scene subclass, and use the scene_drawing functions:
http://omz-software.com/pythonista/docs/ios/scene_drawing.html

If you are a beginner programmer, looking for a general primer on this sort of vector drawing, I highly recommend Kahn Academy's JavaScript course.

https://www.khanacademy.org/computing/computer-programming/programming

This is JavaScript, not python, obviously, and JavaScript has some bizarre and annoying conventions. But scene_drawing in pythonista has basically the exact same set of core drawing functions, so you could replicate anything you create in Khan using pythonista with very minimal changes. My son is hooked on making games and animations using Khan's simple setup.

william26445

@JonB I am initially looking for the basic shapes; lines, ellipse, and more. Scalable vectors are not the one. By the way, I will watch out for the beginner tutorial you shared, maybe I'd find something.

JonB

@william26445 read through the docs for scene_drawing, and for ui.Path. I believe there are some examples there as well.

Check the Pythonista_Tools repo on GitHub, maybe under graphics, there are probably a number of old examples.

Finally @zacbir used to have a repo called geometer, where he used the basic wrappers to create generative art. The repo is still there, but I don't see the example anymore...

JonB

@william26445
Found it.

http://zacbir.net/2013/02/19/dunno-if-its-art-but-i-like-it/
Which links to :
https://github.com/zacbir/pythonista

You might get some ideas there. I should also have mentioned the canvas module, which is depreciated, but might be more suitable for real time experimentation.

william26445

@JonB Thanks a lot! God bless you.