Best way to start Python?

A simple question in an academic science-field? Look no further for a place to ask.
Post Reply
User avatar
Orngrimm
Site Admin
Posts: 277
Joined: Wed Jul 29, 2020 8:02 am
Location: Switzerland
Contact:

Best way to start Python?

Post by Orngrimm »

Ahyeah... I licked enough on the candy called Python to finally budge and bite the bullet: I am starting python! :D

I already figured some well known and supported Python-IDEs:
PyCharm or Visual Studio Code
Or should i stick to IDLE which comes with Python bundled?

Good reads for starters?
Builder of stuff, creator of things, inventor of many and master of none.
Tinkerer by heart, archer by choice and electronics engineer by trade.
Downunder35m
Posts: 401
Joined: Sun Aug 16, 2020 5:32 am
Location: Australia
Contact:

Re: Best way to start Python?

Post by Downunder35m »

Let me know how you go and what provides the best learning experience.
I was quite good in the old 8 Bit days but when the time came to decide on some higher programming language I had to start working life :(
Python was something I tried a few times but never really found a liking, same with many other languages.
Not because it often takes a lot of time, I like learning by doing, so I work my way up here...
It is because once you do it for a few weeks it is already outdated, some better IDE, emulator to test and help you coding.
And well: If you can't find enough use then you forget quickly.
Exploring the works of the old inventors, mixng them up with a modern touch.
To tinker and create means to be alive.
Bringing the long lost back means history comes alive again.
User avatar
Orngrimm
Site Admin
Posts: 277
Joined: Wed Jul 29, 2020 8:02 am
Location: Switzerland
Contact:

Re: Best way to start Python?

Post by Orngrimm »

OK.... As IDE, I settled for Visual Studio Code as:
- it is free
- it has tons of plugins which are super easy to install/maintain
- it installs dependencies as well if you install a library like matlibplot
- has a good community on stackoverflow
See https://code.visualstudio.com/

Also it works very well with platformIO which i plan to use in my microprocessor-works for the future.
(https://platformio.org/install/ide?install=vscode)

As i have a very specific project in mind, i will storm ahead and do the stupid thing: Jump into the deep end and try to keep afloat!
The project:
Read a CSV-file with pressure-values from 6 sensors arranged in a "gem"-like shape. [DONE]
Display those values as a nice plot which is cubically interpolated. [DONE]
Allow for the location of the sensors to be arbitrary defined via X/Y-Location [DONE]
Allow for the location of the sensors to be shown on plot [DONE]
Annotate the value of the sensor at this time on the sensor-location [DONE]
The CSV holds about 2500 lines, each line is the pressure-set each 10ms. Add some way to animate the plot [Work in progress]

So: Currently, things go quite well to be honest. As resource, i used the manuals of the respective librarys and some threads over at stackoverflow to "lend" some code for the hairy stuff. Of course, heavy modding is always a topic if one lends code.
A quick list of the libs i use and where i had to read up:
NumPy (https://numpy.org/) for general array-handling and "number-magic"
Pandas (https://pandas.pydata.org/pandas-docs/s ... Frame.html) for importing and sorting CSV-Files
MatplotLib (https://matplotlib.org/) for the fancy graphs and all GFX-related
SciPy Interpolate (https://docs.scipy.org/doc/scipy/refere ... olate.html) for data-interpolation in a 2D-space +Z
MatplotLib animation (https://matplotlib.org/3.1.1/api/animation_api.html) to animate a Plot (Currently on it to learn the concept of "Artists" in a plot)
Quite proud with it already. From install of IDE to this in about 6h. Scratch to this. Nice. :)

For the basic stuff like exact syntax of a FOR-loop and such things, https://docs.python.org/3/ and especially https://docs.python.org/3/reference/index.html comes in handy.

If there is interest, i can post a thread with details, code and GFX in viewforum.php?f=6 . Just post here and i will open the thread
Until then, current status of the project "Learn python" is well underway with a good choice of IDE = Visual Studio Code and a questionable method of getting information. Given, i can ode in other languages so the base concepts arent new.

Currently, the dataset [ 0. 21. 6. 0. 0. 58.] becomes (with an interpolation to 100x100)
Image
with around 80 lines of code.
Builder of stuff, creator of things, inventor of many and master of none.
Tinkerer by heart, archer by choice and electronics engineer by trade.
Downunder35m
Posts: 401
Joined: Sun Aug 16, 2020 5:32 am
Location: Australia
Contact:

Re: Best way to start Python?

Post by Downunder35m »

Well done :)
Reminds me of my days of desperation when I had to learn new coding skills.
Exploring the works of the old inventors, mixng them up with a modern touch.
To tinker and create means to be alive.
Bringing the long lost back means history comes alive again.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest