Python is very powerful and it is well worth your time to learn how to use it to create your own customized software. The main advantage of Python is the huge number of open-source software libraries available that leverage your time into focusing on your specific application code rather than having to write code for each calculation that you need to do. Another advantage is the quality of Google search results when you type in "Python <topic>". Pretty much everything you need to learn how to do shows up with code examples.
Some of the challenges of using Python are:
- You have to learn how to code in Python
- The ecosystem is rich but complex and it takes a while to understand it
- Version control and backwards compatibility is ad-hoc in the open-source community which can lead to your code breaking when you update what you think is an unrelated code library
- It can be hard to share and collaborate with non-programmers
If you are willing to take the jump into bullet one, we will provide some tips on the other items below. We will add separate articles in this section to highlight code libraries useful for LED applications under the Data Analysis category.
Python Ecosystem
The first choice is what version of Python to use. The current version of Python is 3.10.1 and that version provides the most advanced features. However, the code libraries that you want to use will affect the best version choice since these libraries were probably written in an older version of Python and open-source software contributors do not always choose to provide backward compatibility when the release a new version. You can run multiple versions of Python on your computer but doing that efficiently requires an understanding of Environments. The code development platform you choose use will usually have a virtual environment management tool built in.
Choosing a code development platform. You can write Python code in any text editor and run it with an interface (IDLE) provided with the Python installation. A lot of code examples found on the internet use IDLE output in the code snippets they show. This is fine for code snippets but for serious work, you need to use a code development platform with more features. There are basically three types of code platforms:
1) code module editing tools which are traditional code files that run as an executable,
2) notebooks where the code development platform interweaves code segments with formatted text and code output, and
3) web app platforms for code that runs in browsers with a user interface and no user exposed code. Below is a short list of possible platforms.
- Code Module Development - Anaconda Spyder, Microsoft Visual Studio Code, Microsoft Visual Studio Community, PyCharm
- Notebook Development - Jupyter Notebook, Datalore, Google Colab
- Pure Python Web Apps - Anvil Works, Plotly Dash
Collaboration with other programmers is enabled by a network of code repos. These all use a protocol named Git which stores code in the cloud and allows a structured way for multiple people to work on code elements with tracking and version control. Python code libraries are downloaded using Git commands from code repos. A popular code repo is GitHub, but there are many others.
Sharing your results with non-programmers used to be a major drawback of using Python. This is no longer the case. Online notebooks such as Datalore and Google Colab allow the insertion of input boxes and "Go Buttons" or other GUI elements in the notebook and can provide a comprehensible user experience by just sharing a hyperlink. Pure Python app development tools such as Anvil Works and Plotly Dash allow you to design and host a webpage without also having to learn (much) of the intricacies of website development languages.
This is just a brief introduction to using Python to serve as background for upcoming articles on code libraries useful for LED design and data analysis.
----------------------------------------------------------------------------------------------------------------
These links are being provided as a convenience and for informational purposes only; they do not constitute an endorsement or an approval by Luminus of any of the products, services or opinions of the corporation or organization or individual. Luminus bears no responsibility for the accuracy, legality or content of the external site or for that of subsequent links. Contact the external site for answers to questions regarding its content.
Comments
0 comments
Please sign in to leave a comment.