Python is an interpreted, high-level, general-purpose programming language. Created by Guido van Rossum and first released in 1991, Python's design philosophy emphasizes code readability with its notable use of significant white space.
Guido van Rossum
Now a days python is not only used on web development but also widely used on data science field like machine learning.
- _tkinter.TclError: no display name and no $DISPLAY environment variable — If you face _tkinter.TclError when you run your python application based on MatPlotLib on CentOS 7, it might be caused by MatPlotLib choose Xwindows backend by default.
- Array as an HTML table with both the array key and the index value in Python
- Default module path in Python
- Django
- Easy Python Launcher based on PHP — You can run your python code easily based on your web browser if you have Apache+PHP server. Below code enable you to run your code by click
- Encode/decode JSON in Python
- Google Cloud Client Library for Python to run a query on BigQuery — You can use the Google Cloud Client Library for Python to run a query on BigQuery
- Install mysql.connector for Python on CentOS 7 — MySQL Connector/Python enables Python programs to access MySQL databases, using an API that is compliant with the Python Database API Specification v2.0 (PEP 249). It also contains an implementation of the X DevAPI, an Application Programming Interface for working with the MySQL Document Store.
- Install Pandas, NumPy and MatPlotLib on CentOS 7 — For data processing in Python, Pandas and NumPy are super useful. Before installing Pandas and NumPy, you should have pip on your CentOS 7.
- Install the Google Cloud SDK and the necessary components using yum on CentOS 7 — No, there is no official yum repository for the Google Cloud BigQuery Python module. You can install it manually using the wheel files as described in my previous answer, or you can use pip or easy_install to install it as part of the Google Cloud SDK.
- Install Tkinter on CentOS 7 — Tkinter is a Python binding to the Tk GUI toolkit. It is the standard Python interface to the Tk GUI toolkit, and is Python's de facto standard GUI.
- Keys (i.e., column names) of the records in the result set — The mysql.connector module in Python provides functions for connecting to a MySQL database and executing SQL statements. When you execute a SELECT statement that retrieves records from a table, you can use the cursor object's description property to get the keys (i.e., column names) of the records in the result set.
- Python Code Snippets
- Query result from mysql in Python — You can get the result of a query using Pythong mysql-connector-python library
- Query result from postgresql db in Python — You can run your query by psycopg2 that is widely used to use Postgresql database in Python
- Sample Class in Python
- Scrape web through BeautifulSoup in Python — A type of Python library called BeautifulSoup makes it simple to manage HTML objects. The real scraping is enabled by "requests. get(url)," and BeautifulSoup makes it possible to manage elements based on html.parser.
- Set default encoding method as UTF-8 in Python — Python is basically encoding in ascii mode, so you should declare your encoding method you want to use in the code.
- Simple HLS server in Python using the Flask web framework — In this example, the Flask application has two routes: /live/<stream_id>.m3u8 and /live/<stream_id>/<int:sequence>.ts. The first route uses the ffmpeg command-line tool to convert an RTMP stream into an HLS stream, and returns the contents of the .m3u8 playlist file. The second route returns the contents of individual .ts segments.
- Useful Heredoc in Python — Heredoc is frequently used when develop web app in various platform - it can be easily used by starting """ and ending """
Teaching Web Sites
- Teaching Python in Interactive mode - https://www.learnpython.org/
- Python Quizz (Beginner Level) - https://www.w3schools.com/python/python_quiz.asp
- Real Python (Interactive Quizz) - https://realpython.com/quizzes/
- Python online coding test - https://www.testdome.com/tests/python-online-test/45