OK, so I have no experience of python and I have just installed Pythonista. The idea was to learn Python and explore writing apps for the iPad with it. I haveover 40 years programming experience in Assembler, Algol, C C# Java and Visual Basic.
I have to say that whilst Pythonista looked attractive as a way of programming on the iPad it is very poorly supported in the product with novice getting started help. Right now it seems rather opaque. Much of the documentation seems to be for Python on a workstation running Linux, Windows or OSX. When one it totally new to both the language and the development environment it is rather confusing.
I would like to find some tutorials that start at a real beginner level and take me through the IDE with a simple subset of Python. Perhaps starting with a simple ‘hello world’ form and then incrementally revealing the power of the ide at the same time as bringing in more Python language - moving quickly to reveal its own nature.
Pointers would be welcome.
Take any Python 3 Getting Started guide and experiment on the console (the one that you get to by swiping from the right). Or create an empty file and keep pressing play as you experiment.
Examples, as suggested, are a good way to see what’s possible, but despite several UI projects, I have had little use for the UI designer, preferring the control provided by creating UIs programmatically.
And ask here if stuck, people are happy to help.
Thank you. These replies are helpful. However I think maybe an apportunity is missed. I am an out of date but experienced programmer so yes of course I can infer what is going on by reading through the examples and by experimenting. However I understand that there is an optimism that novice programmers can be drawn in to the use of Python. From that perspgective a specific getting started set of exercises in the documentation would be very helpful.
@dumdum, Hi. I think our backgrounds sound pretty similar. I was a developer many years ago and I had been out of touch with programming for such a long time. But a few years ago I came across Pythonista. I have also been retired for a long time. But when I seen Pythonista I was drawn into and it really excited me. A way for me to reconnect with programming after so many years out of it. For me its a hobby, but I really enjoy it. But it took me sometime to get my head around what Pythonista is or should be to me. (This is only my opinion from my perspective, others may disagree). So in crude terms Pythonista is a Language IDE (Python) with some built in modules to access some iOS specific modules, such as photo's, contacts etc. As well as adding a very nice UI module and UI designer.
But its not a Python tutorial app. There are so many sources to learn Python on the net, pod casts, you tube videos, blogs, not to mention all the books...the list goes on. Another good source is Pythonista-Tools Github repository. A lot of useful code including example code.
Also, this forum is a great source of info and help from very dedicated members including the developer @omz.
(One note about searching the Forum, use some google tricks like site: to search the forum instead on the Forums built in search tools. I don't like saying it, but the built in forum search tools are not great). Also Note, the first entry in the Forum, a link to a Slack Channel for Pythonista.
Anyway, the more I learnt about Python the Language, Pythonista made more and more sense to me.I still consider myself a beginner, but I know enough to have some fun with it and be dangerous to myself :) I think its that some way to me Python looked like other high level languages I have used Eg. VB. But thats not true, its a lot more sophisticated. I also have been a C programmer, and did some ASM debugging, didn't do much with c++ but a enough to understand the basics of OOP. Also other languages such Pascal etc... But for me Python is an anomaly. Maybe this is just because I was out of programming for so many years.
Anyway, it is really hard to express my feelings concisely, this post will turn into a book if I dont shut up.
Bottom line is, I hope you dont let this be your missed opportunity. So many people fall head over feels in love with Python, and I see why they do. Python can be as rudimentary as you would like it to be or at the other end of the scale give you the power to do very sophisticated things. I really hope you give it a go. I have no affiliation with Pythonista other than being a passionate user of the app which allows me to program Python on an iOS device (with all the extra goodies that @omz has included).
Anyway, good luck. I look fwd to you joining the community here.
Edit: Btw, the reason I am still a beginner is that its just a hobby for me. I go very slowly. I could easily but a lot further along if I applied myself. I am somewhat lazy these days. But its still very enjoyable
Hello. I'm pretty new to python. I found it years ago, but only in the last few months have I started using it. I found Pythonista to be a huge help with learning Python. Everything you need is on your iPad. You don't need the Internet to look things up. It's a great way to occupy your time on a flight. So, I can't agree with your poorly supported comments. I find it has help, autocomplete and other features that really help. I've been recommending it as a way to get started with Python. By the way, I'm an experienced programmer, but for the last 15 years, I mostly run projects and don't do much coding. I'm also old! Object oriented was a hard thing to adjust to. What really made the difference for me with Python was that I took a course at the community college. Five days of 8 hours a day for 24 of our staff. It was an introductory course, I already knew most of it, but at the end of the week, I could suddenly program in Python.
It may be useful for experienced programmers in C++/Java/C# (but not in python) to look at rosetta code and see how basic tasks in C++/C#/Java are written in python. Python programmers who want to learn objectiveC/Swift can also look at the site.
i. walk a directory recursively
ii. Write a list comprehension that builds the list of all Pythagorean triples with elements
between 1 and n.
iii. GUI component interaction
Pythonista code for this example is given below and using designer simplifies this task.
@Phuket2 Thank you for your message. Yes we do have similarities. I am a late academic in systems engineering almost ready to retire. I see Python as a means of carrying forward some research themes that have lain idle for the want of some tools. I am almost fully convinced that this is a good tool for my purpose. I have spent some time looking up tutorials from other sources and remain impressed with the possibilities - as you say it can be used in a very basic way on one hand and by its class Support can be used for sophisticated applications. I have found the class implementation to be good but rather idiosyncratic.
I will persevere and look forward to the time when I become reasonably fluent. I am at the stage of trying out some simple tasks such as some exercises in natural language parsing.
Like you I find, now at least, more success in searching through google. Thanks again for your encouragement.
@Physick Thank you for your reply. It is very interesting to see our different observations. Did you pick up Pythonista before or after doing the course on Python?
It seems to me that all the documentation provided is simply the standard python documentation expected to be used in one of the traditional IDEs. The result is that whilst read code examples the embedded copy button does not work. If you copy and paste using iPad functionality the quotes throw up problems. Further the standard tutorial is really only an elaborated reference manual. All these things will mount up for real novices - people the python community seem to want to catch. I therefore think there is a real place for two or three step by tutorials entirely in Pythonista terms that result in simple Pythonista applications.
Finally I hasten to add that I am persuaded that Pythonista is in any case a very fine app. My quibble is just minor.
@dumdum, on top of any other challenges you might face in an unfamiliar development environment, you have also hit on some bugs. The Copy button did work earlier, and the quotes are a recent issue as well.
@dumdum, i think you will find out quickly that Python tutorials are out of the scope Of Pythonista. Depending on the languages you have used before, Python has some pretty cool stuff. But some juicy things to look up on youtube is list(dict) comprehensions, generators, decorators, Monkey Patching, classes ability to override operators such as add, multiply etc as well as string representation for the class, context mangers. Look there are more than i mention. But it would be hard for Pythonista to do these topics justice, at the same time doing its primary job.
A lot of the language constructs mention above as far as I know appear in some form or another in other languages, and have even been taken from them. But when i started to see a little deeper into Python, I was getting blown away and still do. I think back to the c and pascal days also VB, i almost want to cry! There are some things that might make you think it's toy language, like lack of typing in params (there is more to that story in Python 3.6), the methodology of exception handling and some other things. I hard hard time with some of these concepts when i first started. But it does get clear, and better still it does make sense.
So just sharing my experience with starting to learn Python after being outr of programming so long. I found it very frustrating. I wanted it to fit into a box that I could easily relate to. Fortunately, that didn't happen. I discovered a whole new way. I only wish Python was as mature and well know as it is today when I was a developer all those years ago. Again, i cant state enough how powerful the language can be. Just generators are mind blowing for me.
Lastly, the Python community seem to be all about sharing and for the most part non judgemental. Meaning beginners are welcomed and not put down because they are asking what may appear to be a simple question. This is very important. No one wants to feel stupid.
Also checkout pypi for packages/code you can use in your projects. Also github is another excellent source for looking and discovering code. Also, this podcast on awesome Python is a great listen. Actually all the pod casts are great.
Anyway, I hope this helps.
@dumdum , I left out this excellent Resource. PyVideo.org. All the videos from the various Python conferences around the world. Including local developer groups. Eg, the list of videos from the PyCon 2017 in Portland Oregon. The videos were being posted during the conference. Anyway, its another great resource.
@Phuket2 - thank you for your detailed response. I will check out the references you have provided. I am slowly gaining confidence in simple, non GUI, oo codewriting. I guess now it is a matter of learning what is available for GUI design and even perhaps, if it is possible, creating a stand-alone shareable app and more ambitiously web apps that might help some research collaborators.
@dumdum there're numerous resources around the internet and it doesn't make sense to copy & paste them here. Google is your friend.
I can give you one recommendation only - think about some mini project / app / script you want, not a big one, just something smaller. Then go and finish it, whatever it takes, ask, show what you have tried, people will help you. And then choose another mini project / app / script and start again.
It has no sense to spend time with reading lot of tutorials, watching videos, ... because only small portion will stay in your head. You have to immediately use, try, ... whatever you learned / read.
If you're out of ideas for mini project / app / script, go and solve tasks from:
- Google for python code challenge
In these challenges, you can find very simple tasks to finish and then more challenging ones.
@zrzka thank you - good stuff. You are absolutely right that it is time to write a simple program. That is what I have begun doing. Watch this space as they say.
@zrzka Thanks zrzka for the links, they also help me! And I'm agree with you about how to learn a new programming language. Often it is useful for me:
- to think about any simple task to be coded (any kind of tasks that are possible with Python/idevice in order to perform some automatic operations);
- to try coding the simple task with human-pseudo-code (to have, at least, a structure of the code I want);
- to try translating the human-pseudo-code in Python code (using stackoverflow or google for pieces of code that someone else has already written and shared freely);
- to test often my code to be sure that all little pieces of code work as I want (it is not always simple to do if the main code calls several modules, functions, ...).
To learn a new programming language is frustrating for me if I have not some little useful goals that could make the managment of my phone easier. For example, now I'm trying to learn how to write a python code in Pythonista that reads all old events in the iphone built-in calendar app, moves them to a specific day and creates a backup txt file with all old events, in this way my calendar app is always clean and every day I can see the events that I still have to complete.
I’m a retired programmer with 50+ years experience. Python is just another language, and I mastered the syntax within a day. But the libraries are where the action is. I want to use Pythonista to teach kids how to write games, and the Scene class is documented in a way that only its implementors can understand. The problem is that there is an underlying structure that can only be inferred from the documentation, which is sparse. I somehow have to understand this well enough to organize a tutorial for 10-to-12-year-olds. And I can’t get the structure in my head from the sparse documentation. Any suggestions on how to make sense of 2D graphics?
Agree the docs can be a bit confusing on scene, partly because there are sort of two approaches supported : Sprite/Node based scenes, and render loop based.
In node based scenes , you basicslly tell the game engine your intent, via actions, and it handles the animation. In render loop, you draw the complete game state every cycle.
A good way to understand how it all works is probably by looking at fully worked examples, and taking them apart, etc.
Here is probably the most complete (and actually fun) game that has been posted publically.
There are several other community developed games here
This is a god example of a Node based game, complete with effects, etc
Most of the other examples are the old style render loop, which are maybe easier to understand conceptually, since there is very little magic going on behind the scene.
@dumdum, I am not only new to Pythonista/Python, but to programming all together and am in my late 40's. As already pointed out, Pythonista is not really advertised as a tutorial so much as a scripting environment. That said, I very much appreciate what Pythonista has to offer.
However; in terms of learning Python, I have found the following website to be the most valuable tool thus far:
In conjunction with that website, I use Thonny on my laptop as a simple yet very useful IDE to play around in.
Something to take note of. All of the IDE's I tried seemed to have an issue running different commands (including the one native to Python). The only issue I've come across so far with the Thonny IDE was that it would freeze when running script that used 'exitonclick'.
I hope this provides a bit of what you're looking for.