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.
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.