What is the ouput of the code given above?
Anonymous Quiz
35%
[ (βoneβ, 1), (βtwoβ, 2), (βthreeβ, 3) ]
16%
Options: SyntaxError: invalid syntax
44%
{'one': 1, 'two': 2, 'three': 3}
5%
None
Taking Screenshots Using Pyscreenshot
πΈPyscreenshot is a cross-platform module that allows you to take a screenshot using Python. Also Pillow package needs to be installed.
βοΈInstallation
πGithub
πΈPyscreenshot is a cross-platform module that allows you to take a screenshot using Python. Also Pillow package needs to be installed.
βοΈInstallation
pip install pillow
pip install pyscreenshot
To create a screenshot simply use image =
pyscreenshot.grab()
function to capture the screen and then save the screenshot: image.save()
. If you want to capture specific part of the screen, provide the pixel position (bbox argument) in the grab() function.πGithub
Django & React - Full Stack Web App Tutorial πΊ
Learn how to create a full stack web app using python and Javascript with Django and React.
1. Full Stack Web App With Python & JavaScript [YouTube]
2. Django REST Framework [YouTube]
3. React Integration Using Webpack & Babel [YouTube]
4. React Router and Building Components [YouTube]
5. Handling POST Requests (Django REST) [YouTube]
...
17. Functional Components (useState, useEffect) [YouTube]
πFull YouTube playlist
#materials #django #web
Learn how to create a full stack web app using python and Javascript with Django and React.
1. Full Stack Web App With Python & JavaScript [YouTube]
2. Django REST Framework [YouTube]
3. React Integration Using Webpack & Babel [YouTube]
4. React Router and Building Components [YouTube]
5. Handling POST Requests (Django REST) [YouTube]
...
17. Functional Components (useState, useEffect) [YouTube]
πFull YouTube playlist
#materials #django #web
HTTP Requests
πΈRequests is an elegant and simple HTTP library for Python. It allows you to send HTTP/1.1 requests extremely easy, so you can focus on interacting with services and consuming data in your application.
βοΈInstallation
πDocs
πPythonβs Requests Library (Guide)
#requests
πΈRequests is an elegant and simple HTTP library for Python. It allows you to send HTTP/1.1 requests extremely easy, so you can focus on interacting with services and consuming data in your application.
βοΈInstallation
pip install requests
The most-commonly-used HTTP methods are GET and POST:requests.get(url)
requests.post(url, data=somedictdata)
Each of there functions returns a Response
. It's a really powerful object for inspecting the results of the request. We can get all the information we need from this object like text, status code or encoding.πDocs
πPythonβs Requests Library (Guide)
#requests
This media is not supported in your browser
VIEW IN TELEGRAM
Visualize code execution
Have you ever had a hard time understanding what is going on in your code? Python Tutor's online coding environment allows you to write code and visualize frame-by-frame how it gets executed by the computer. Besides Python, It's also supports Java, C/C++, JavaScript and Ruby.
Just pick a language, write some code, press the "Visualize Execution" button and youβll be redirected to a page, where all the magic happens. π«
πPython Tutor's homepage
#tools
Have you ever had a hard time understanding what is going on in your code? Python Tutor's online coding environment allows you to write code and visualize frame-by-frame how it gets executed by the computer. Besides Python, It's also supports Java, C/C++, JavaScript and Ruby.
Just pick a language, write some code, press the "Visualize Execution" button and youβll be redirected to a page, where all the magic happens. π«
πPython Tutor's homepage
#tools
What is the output of the code given above?
Anonymous Quiz
15%
[0, 1]
18%
[3, 4]
5%
[]
62%
[0, 1, -2]
Progress bar
πΈtqdm is a Python library that allows you to output a smart progress bar by wrapping around any iterable. A tqdm progress bar not only shows you how much time has elapsed, but also shows the estimated time remaining for the iterable.
βοΈInstallation
πGithub
#progressbar #tqdm
πΈtqdm is a Python library that allows you to output a smart progress bar by wrapping around any iterable. A tqdm progress bar not only shows you how much time has elapsed, but also shows the estimated time remaining for the iterable.
βοΈInstallation
pip install tqdm
To start using tqdm you just need to wrap the tqdm()
function around the iterable, which will generate a progress bar while our for-loop is running. We can also assign a name to the progress bar using the desc
keyword argument. The resulting tqdm progress bar gives us information that includes the task completion percentage, number of iterations complete, time elapsed, estimated time remaining, and the iterations completed per second.πGithub
#progressbar #tqdm
Getting user's password
πΈGetpass is a standard library module that provides a secure way to handle the password prompts where programs interact with the users via the terminal. Using this module, it is possible to accept passwords in Python programs and keep the passphrases safe.
The module provides two functions:
βͺοΈThe
βͺοΈThe
πDocs
π[GeeksForGeeks] getpass() and getuser() in Python
#getpass
πΈGetpass is a standard library module that provides a secure way to handle the password prompts where programs interact with the users via the terminal. Using this module, it is possible to accept passwords in Python programs and keep the passphrases safe.
The module provides two functions:
βͺοΈThe
getpass()
function is used to prompt to users using the string prompt and reads the input from the user as Password.βͺοΈThe
getuser()
function displays the login name of the user.πDocs
π[GeeksForGeeks] getpass() and getuser() in Python
#getpass
What is the output of the code given above?
Anonymous Quiz
15%
<class 'NoneType'>
35%
<class 'int'>
21%
<class 'function'>
29%
<class 'generator'>
Spellchecker
πΈHave you ever wondered how search engines make suggestions for correcting misspelled words so accurately? They are using "spelling correction" algorithms. And the pyspellchecker is a Python open-source package that implements such an algorithm.
βοΈInstallation
πGithub
πpyspellchecker documentation
#spellchecker
πΈHave you ever wondered how search engines make suggestions for correcting misspelled words so accurately? They are using "spelling correction" algorithms. And the pyspellchecker is a Python open-source package that implements such an algorithm.
βοΈInstallation
pip install pyspellchecker
As you can see in the screenshot above, pyspellchecker
is pretty straightforward to use. It also supports multiple languages including English, Spanish, German, French, and Portuguese.πGithub
πpyspellchecker documentation
#spellchecker
Underscore Trick
Many of Python developers don't typically know about all the functionalities of the underscore in Python. But actually, you can use the underscore
It saves a lot of time and keystrokes if you are using your Python shell as a calculator (just like me π).
#tricks
Many of Python developers don't typically know about all the functionalities of the underscore in Python. But actually, you can use the underscore
_
to refer to the result of the previously executed command. Check out the code above.It saves a lot of time and keystrokes if you are using your Python shell as a calculator (just like me π).
#tricks