Dipping my toe into Python

I have explored Django a bit in the past and some nice people seem to be using Python rather than Ruby so I think I’ll explore it again, I have a spare hour, you see.

I started this as a threaded tweet:

“Pythonistas — if I start learning a little, do I avoid 2.7 and go straight to 3? TIA // cc’ing Graham Ashton & Brad Wright

and then I gave myself a stern talking to, at least this Medium makes it easier to read, even if it’s no more likely to be around in 10 years.

My memory of Django is that I liked the focus on URLs, the admin system that comes with it and the attitude of most pythonistas.

I started by going into my macOS cmd line, type python — version and get 2.7.

but typing python3 also works -> 3.5.2 — that’ll do

I started here: http://www.diveintopython3.net/your-first-python-program.html

I look at this and it feels wrong to me, I have to test first, right ? ( maybe not, but stay with me)

Actually, I’m going to start here, I think. https://docs.python.org/3/library/unittest.html

Now, what do I want to test ?

It dawns on me that I’m a web fan, not a super focussed business logic person, so off to a web framework I go http://flask.pocoo.org

I follow the simple example.

pip install Flask seems to be using python2.7.

If you hit the same then use pip3, not pip to install Flask.

Next up, I need data, so http://www.sqlalchemy.org/ ?

or http://sqlobject.org/ https://storm.canonical.com

or is it easier just to go straight to Django?

https://hellowebapp.com/tutorial/what-building/ looks handy to get a basic understanding.

Then I realise this exact route is the one I followed last time I tried Python and ended up trying Django.

Putting this out there as a reminder for me next time I do the same :-)

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.