Skip to content

Latest commit

 

History

History
92 lines (55 loc) · 8.07 KB

File metadata and controls

92 lines (55 loc) · 8.07 KB

What is Python

Python is a popular progamming language used for many things. People build, for instance, web applications, robots, games, and machine learning solutions. It is easy to start learning Python. With the right focus and documentation, you can learn the basics of Python online or at a Python bootcamp.

Python is an interpreted, object-oriented, high-level programming language. It's versatile and comfortable for developers to read and write. As you'll see below in the Python guiding principles, Python programming emphasizes readability, encourages simplicity, and allows for a lot of flexibility.

Python has guiding principles known as The Zen of Python. In a Python file or in your Python interpreter, run import this. It should show the following in your terminal:

The Zen of Python, by Tim Peters

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!

One reason Python is so popular is because it feels familiar even to non-programmers. This is because some of the syntax mimics spoken languages. Here is an example. If you want to know whether a Python list named theList contains a value of 79, and if so, print True, you can simply write the following:

theList = [59, 69, 79]

if 79 in theList:
    print(True)

Before you know it, you can build real-world solutions that people rely upon in their daily lives. To help jumpstart your imagination, here is some dicussion of what you can build with Python.

The possibilies are huge. You can use Python to build web applications, automate tasks on your computer, program robots, build games, analyze data, process images, and so much more. You can also build graphical user interfaces, applications that convert filenames and sizes, and projects that work with audio, video and text files. Originally known for rapid prototyping and connecting other applications, Python is maturing from its original reputation into a go-to solution in general.

Build Python web applications that users interact with online. For instance, many people use Python to build blogs, content management systems, and virtual classrooms. With Python web frameworks like Flask and Django, and with the countless libraries and packages to support Python web development, building a web application using Python is possible for beginners and experts alike.

In simple terms, you write your server in Python code. Then, for a frontend, you have several options. For instance, you can write it using Flask's or Django's built-in frontend templating engines. Or you can build your frontend in a separate application (like vanilla JavaScript, React, Angular, or Vue) that communicates with your server like a microservice.

For a database, you can choose between SQL, no-SQL, and third-party services that work like databases (like Google Docs, Google Sheets, and other services). Flask and Django ship with built-in SQL capabilities. Though helpful third-party libraries exist for interacting with no-SQL options, like MongoDB and Google Firebase.

By building your web application using Python, your web application may more easily interact with other Python projects, like machine learning and robotics.

Build Python applications that interact with users on social media. For instance, build a Twitter bot that tweets, retweets, likes messages, and follows users based on a pre-set schedule. This can be a great way to automate some of the ways you engage with your audience. It is not just Twitter you can automate. You can write Python bots for Instagram, Facebook, Discord, Telegram, and more. A real project I built is a weather station that Tweets the humidity and temperature readings from a Raspberry Pi and also provides the weather information on-demand from Telegram.

You also can write Python projects that livestream video. For instance, livestream to Facebook, YouTube Live, Periscope, and Twitch. By creating a Python application that assists you with livestreaming your content, you can interact with your audience in more effective ways.

To make a bot or to livestream, write a Python script and connect it to the API for the social media platform of your choice. Plenty of third-party packages and tutorials are online for making Python bots and for livestreaming. You can even connect your Python script to a web application or automate it using crontab or some other scheduler.

Build games using Python. For instance, build games that slide across the screen and serve hours of entertainment to its users. Build classic games like solitaire, pong, and tic-tac-toe. Or build educational games that engage students in exciting ways. Teach students how to read, do math, or write programs! Several Python packages are available for building games.

Two popular Python gaming packages ar named PyGame and PyArcade. You can build full-featured video games using PyGame or PyArcade. They are free to use and have a lot of downloads. Plus, both PyGame and PyArcade have many helpful tutorials and documentation online to help get you started and to inspire your next great game.

Write software that controls hardware. Python is one of the most popular languages for writing software for the Raspberry Pi and other microcontrollers. Build robots, weather stations, and home automation hardware that run on Python software. For instance, build a miniature car that follows a line drawn on the floor. Build a weather station that monitors your garden. Build a motion-activated security camera that emails you when it detects movement.

Three of the most popular ways to write Python for IoT and robotics is using the Raspberry Pi, Circuit Python, and MicroPython. The internet has enough documentation and guides to get you started. Beware, however, that merging hardware and software is very addicting!

Build data science Python projects. Data science covers a broad range of topics. Examples include machine learning, natural language processing, image recognition, deep learning, and data visualization. Many python packages exist for helping you build your Python data science projects. For instance, Pandas, NumPy, SciPy, Matplotlib, Seaborn, and Datashader help you analyze data. Other packages, such as Scikit-Learn, StatsModels, Keras, TensorFlow, and others, help you with machine learning. The OpenCV package is popular for working with images.

Regardless of your data science project, you should strongly consider writing it in Python.

Python has built-in data structures and dynamic typing. As mentioned above, Python makes it easy to import code into a project in the form of modules and packages. Modules and packages are pre-written code (by you or others) that you can incorporate into your project. Using modules and packages saves you time and resources by providing functionality that you do not have to write the code for. You can find modules and packages using Python’s Package Index. You can manage packages for your projects using pip -- the recommended Python package manager. With pip, you can, among other things, instal, upgrade, and remove packages.