Python Universe
1.99K subscribers
103 photos
1 video
1 file
55 links
Everything you need to know about Python programming.

Admin: @haraisen
Feedback: @pythontg_feedbackbot
Download Telegram
How to Measure Code Execution Time in Python?

The timeit module provides a simple way to time small bits of Python code. It has both a Command-Line Interface as well as a callable one. It avoids a number of common traps for measuring execution times.

To measure the execution time of a statement, simply use the timeit.timeit() function. It accepts the following input parameters:
▪️stmt – String containing the code snippets for your test case.
▪️setup – Initial code that will be executed once.
▪️timer – The timer instance. It is defaulted to time.perf_counter(), which returns a float.
▪️number – Number of executions to be carried out. The default value is 1,000,000.
▪️globals – Specifies a namespace in which to execute the code.

#tips
70+ Python Project Ideas 💡

♦️Adding a side project or two to your portfolio can be a big plus if you don’t have much working experience yet, helping to convince the employer to hire you.

♦️In this article you'll find example projects with step-by-step instructions, tutorials and source code that will take you though building real-world Python projects from scratch.

👁Read the article

#materials
You can share your own project via the feedback bot: @pythontg_feedbackbot. I'll publish the most interesting ones :)
Also don't forget about our chatroom: @pythontg_chat 👈
Wikipedia

🔸Wikipedia is a Python library that makes it easy to access and parse data from Wikipedia webpages.

⚙️Installation
pip install wikipedia

Yes, you can now import Wikipedia in Python using Wikipedia module. Use the incessant flow of knowledge with Python for daily needs. Search Wikipedia, get article summaries, get data like links and images from a page, and more.

🔗Docs
🔗GitHub

#wikipedia #parsing
Learning to program with Python 3 📺

If you want to deal with basics as little as possible and just jump into actual Python projects, you should try to learn Python with Introduction to Python 3 series by sentdex – one of the most popular Python content creator on YouTube. This series is aiming to help you quickly run through the basics and get started with your first Python project.

1. Introduction to Python 3 Programming Tutorial [YouTube]
2. Tuples, Strings, Loops [YouTube]
3. Lists & Tic Tac Toe Game [YouTube]
...
15. Conclusion [YouTube]

🔗Full playlist

#materials
Turtle🐢

🔸Turtle is a pre-installed Python library that enables users to create pictures and shapes by providing them with a virtual canvas. It was part of the original Logo programming language developed by Wally Feurzig and Seymour Papert in 1966.

Imagine a robotic turtle starting at (0, 0) in the x-y plane. After an import turtle, give it the command turtle.forward(15), and it moves (on-screen!) 15 pixels in the direction it is facing, drawing a line as it moves. Give it the command turtle.right(25), and it rotates in-place 25 degrees clockwise. By combining together these and similar commands, intricate shapes and pictures can easily be drawn.

🔗Docs
🔗The Beginner's Guide to Python Turtle (RealPython)

#turtle #graphics
What is the output of the code given above?
Anonymous Quiz
15%
0
30%
Infinite recursion
6%
6
43%
24
6%
120
​​Python Learning Courses provided by Microsoft 📚

Recently, I found out that Microsoft provides quality online courses related to Python on Microsoft Learn.
Microsoft Learn is a free online platform that provides access to a set of training courses for the acquisition and improvement of digital skills. Each course is designed as a module, each module contains different lessons and exercises. Below are the modules related to Python learning.

🟢Beginner
1
. What is Python?
2. Introduction to Python
3. Take your first steps with Python
4. Set up your Python beginner development environment with Visual Studio Code
5. Branch code execution with the if...elif...else statement in Python
6. Manipulate and format string data for display in Python
7. Perform mathematical operations on numeric data in Python
8. Iterate through code blocks by using the while statement
9. Import standard library modules to add features to Python programs
10. Create reusable functionality with functions in Python
11. Manage a sequence of data by using Python lists
12. Write basic Python in Notebooks
13. Count the number of Moon rocks by type using Python
14. Code control statements in Python
15. Introduction to Python for space exploration
16. Install coding tools for Python development
17. Discover the role of Python in space exploration
18. Crack the code and reveal a secret with Python and Visual Studio Code
19. Introduction to object-oriented programming with Python
20. Use Python basics to solve mysteries and find answers
21. Predict meteor showers by using Python and Visual Studio Code
22. Plan a Moon mission by using Python pandas

🟠Intermediate
1. Create machine learning models
2. Explore and analyze data with Python
3. Build an AI web app by using Python and Flask
4. Get started with Django
5. Architect full-stack applications and automate deployments with GitHub

#materials
What is the output of the code given above?
Anonymous Quiz
28%
BIG Python
20%
small Python
23%
Error: comparision is not supported
29%
Python!
Video editing with Python 🎞

🔸MoviePy is a Python module for video editing, which can be used for basic operations (like cuts, concatenations, title insertions), video processing, or to create advanced effects. It can read and write the most common video formats, including GIF.

⚙️Installation
pip install moviepy

The key objects in MoviePy are VideoClips, which contains video and sound. In a typical MoviePy script, you load video or audio files, modify them, put them together, and write the final result to a new video file.

🔗Docs
🔗GitHub
🔗Editing Video with Python + MoviePy Tutorial

#moviepy #graphics
PyQt5 GUI Thursdays 📺

PyQt
is a Python interface for Qt, one of the most powerful, and popular cross-platform GUI library. PyQt is a blend of Python programming language and the Qt library. In this video series you will learn how to create basic graphical applications with the help of PyQt.

1. How To Install PyQt5 And Build Simple GUI App [YouTube]
2. How To Create Combo Boxes [YouTube]
3. How To Create Spin Boxes [YouTube]
...
20. CheckBoxes [YouTube]

🔗Full Playlist

#materials