A lot of people use #Python for automation. Let's talk about some of the packages you can use this task!

๐Ÿงต๐Ÿ๐Ÿ‘‡
PyAutoGUI is useful if you need to control the mouse and keyboard on your PC with Python

You can use PyAutoGUI to fill out forms, take screenshots and much more

pyautogui.readthedocs.io/en/latest/
Pywinauto is also for controlling the mouse and keyboard, but is specifically targeted at Windows

pywinauto.readthedocs.io/en/latest/
If you need to automate a web browser, then you have several tools you can use with #Python:

๐Ÿ Selenium
๐Ÿ Splinter
๐Ÿ Windmill
๐Ÿ ScraPy (web crawler / scraping)
๐Ÿ BeautifulSoup (web scraping)
For Test Automation with #Python you can use:

๐Ÿ Robot Framework
๐Ÿ Pytest
๐Ÿ Lettuce
If you need to automate working with PDFs with Python, then you should check out the following packages:

๐Ÿ ReportLab (creating PDFs)
๐Ÿ borb (creating PDFs)
๐Ÿ pdfrw (splitting, rotating, merging)
๐Ÿ PyPDF2 - PyPDF4 (splitting, rotating)
๐Ÿ PDFMiner - (PDF text extraction)
If you want to automate working with Excel files with Python, then check out the following packages:

๐Ÿ OpenPyXL
๐Ÿ xlwings
๐Ÿ PyXLL
๐Ÿ XslxWriter
I hope you enjoyed learning about just some of the neat Python packages you can use to help you automate your work life.

Follow me for more about Python!

โ€ข โ€ข โ€ข

Missing some Tweet in this thread? You can try to force a refresh
ใ€€

Keep Current with Mike Driscoll

Mike Driscoll Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @driscollis

3 Dec
I wrote a book about creating GUIs with #Python a couple of years ago.

In it, I created a SQLite database viewer application with #wxPython in under 100 lines of code

๐Ÿงต๐Ÿ๐Ÿ‘‡
Here is the SQLite database viewer I created with #Python and #wxPython for the book

Note: This code should work fine on Windows, Mac and Linux
You can get the code for my SQLite database viewer on GitHub here:

github.com/driscollis/appโ€ฆ
Read 5 tweets
3 Dec
Let's talk about type hinting in #Python

๐Ÿงต๐Ÿ๐Ÿ‘‡
Type hinting is not enforced by Python. You can enforce it with outside packages, such as Mypy or with your Python IDE
Type hinting is most useful when you have a large team you are working with or with a large codebase.

Type hinting is also useful for introspection when creating Python packages
Read 6 tweets
19 Nov
Today we are going to talk about the basics of unit testing in #Python

๐Ÿงต๐Ÿ๐Ÿ‘‡
The Python programming language includes built-in packages for testing:

๐Ÿ doctest
๐Ÿ unittest
I already did a thread on Python's `doctest`:

Read 13 tweets
18 Nov
Python comes with its own built-in debugger called `pdb`.

Let's talk about that in a mini-thread!

๐Ÿงต๐Ÿ๐Ÿ‘‡
`pdb` stands for Python debugger. It is a built-in part of Python's standard library

Here is a link to the documentation:

docs.python.org/3/library/pdb.โ€ฆ
To start debugging code with `pdb`, you need to write some code.

Here's the code you'll be using:
Read 17 tweets
17 Nov
One big gotcha when it comes to #Python decorators is that the decorator will covertly replace the function's name and docstring with its own (๐Ÿงต๐Ÿ๐Ÿ‘‡)

Check out the following example Image
When you run the decorated code in the previous tweet, you will see that the decorated function's name and docstring have disappeared! Image
You may be wondering, why do I care if a function's name and docstring are replaced?

The reason this is important is that your introspection won't work correctly anymore. If you run Python's `help()` built-in against your decorated function, it will give you the wrong info
Read 7 tweets
17 Nov
#Python has had the concept of context managers for a loooong time!

Let's talk about context managers again!

๐Ÿงต๐Ÿ๐Ÿ‘‡
The `with` statement, which is the normal way for working with context managers, was added back in Python 2.5!

Here is a pretty common example of using a context manager: Image
The beauty of a context manager is that they allow you to do some setup and teardown automatically.

The downside is that is abstracted away and can sometimes make the code less obvious when debugging
Read 8 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(