Mike Driscoll Profile picture
Dec 11 β€’ 3 tweets β€’ 2 min read
You can use #wxPython to create a cross-platform #SQLite database viewer with #Python

🐍πŸ”₯πŸ’ͺ

Here's an example: ImageImage
The code for this example is from my book, Creating GUI Applications with wxPython.

You can get it here:
gum.co/Eogsr
You can get the code for this example on the book's GitHub code repo (see chapter 4):

github.com/driscollis/app…

β€’ β€’ β€’

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

Dec 10
Today I want to talk about #Python's special escape characters

Join me in another fun thread!

πŸ§΅πŸπŸ‘‡
Here is a list of the most common escape characters in #Python

🐍 \n - ASCII Linefeed or Newline
🐍 \t - Horizontal tab
🐍 \r - Carriage return
🐍 \b - Backspace
🐍 \f - Form feed
🐍 \' - Single Quote
🐍 \" - double quote
🐍 \\ -Backslash
🐍 \v -vertical tab
One of the most common escape characters in #Python is `\n` or the line feed character.

Line feed is not printable. It basically tells Python to add a newline on the end of your string.

The line feed is useful for formatting your output. You can add more than one too! ImageImage
Read 7 tweets
Dec 5
Let's talk about #Python introspection!

Introspection is the examination of Python objects. It gives you a window into your code that lets you learn about Python using Python itself!

Find out how in this mini-thread!

πŸ§΅πŸ‘‡πŸ
There are multiple ways to introspect #Python code. You will learn about the following tools you can use for introspection:

🐍 type()
🐍 dir()
🐍 help()
🐍 sys
You can use the `type()` function in #Python to learn about any object's type.

This can help you figure out what is going on in your code when you are debugging.

Here are some examples: Image
Read 8 tweets
Dec 3
#Python includes a `format()` function that is built-in. This function is very similar to the string's `format()` method, but is more low-level than that method

docs.python.org/3/library/func…

#python_builtins_by_driscollis

πŸ§΅πŸπŸ‘‡
Here are some examples of how you might use #Python's `format()` function: Image
The `format()` function uses the Format Specification Mini-Language. You can see this documented here:

docs.python.org/3/library/stri…

You can use the Format Specification Mini-Language to specify alignment, fill, width, precision and more.

Here are a couple of examples: Image
Read 4 tweets
Nov 29
Today I am going to show you how to create 7️⃣ different file types with #Python:

🐍 Text file
🐍 CSV
🐍 XML
🐍 JSON
🐍 Tar file
🐍 PDF
🐍 Excel

Join me for this fun πŸ§΅πŸ‘‡
1️⃣ Creating a text file with #Python is a breeze! The recommended method is to use Python's `with` statement as it will automatically close the file for you

That means you can create a text file with TWO lines of code if you want to:
2️⃣ Creating a CSV file with #Python can be accomplished using the `csv` module

Here's a small example:
Read 16 tweets
Nov 28
Let's talk about creating dictionaries with #Python 🐍

A dictionary is a key / value pair. The key must be of an immutable type, such as an integer or a string. The value can be of any type

πŸ§΅πŸ‘‡
You can create a #Python dictionary in several different ways.

The following shows the most common method of dictionary creation followed by using a dictionary comprehension
You can also create a #Python dictionary by using the `dict()` function
Read 4 tweets
Nov 27
#Python has several Easter eggs built in! 🐍πŸ₯šπŸ£πŸ‡

An Easter egg is a fun little surprise in a programming language, video game or movie.

Let's talk about some of Python's cool Easter eggs!

πŸ§΅πŸπŸ‘‡
πŸ₯š1️⃣ - The most famous #Python Easter egg is probably The Zen of Python, which you will see if you "import this"
πŸ₯š2️⃣ - What you might not know is that Zen of Python's source is really interesting too:

github.com/python/cpython…
Read 10 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

Don't want to be a Premium member but still want to support us?

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!

:(