How To Run Multiple Python Versions On Windows?

Summary: You can run multiple versions of Python on Windows using one of the following methods: Using entire path to execute the code. Creating A Shortcut or Symbolic Link to the executable files. Using Pylauncher: Use Shebang (#) in The Script Run Pylauncher Command Using Virtual Environments. ➠ Problem Formulation: You might have two versions … Read more

How to Extract Text from Images in Python using OpenCV and EasyOCR

You can extract text from images with EasyOCR, a deep learning-based OCR tool in Python. EasyOCR performs very well on invoices, handwriting, car plates, and public signs. First released in 2007, PyTesseract [1] is the to-go library for extracting text from images. It uses classical computer vision methods to perform optical character recognition (OCR), then … Read more

Python IDLE Syntax Highlighting

Python’s IDLE code editor comes with every standard Python installation in Windows, Linux, and macOS. You can use it right out of the box after installing Python on your computer. Related Article: How to Install Python? IDLE has a useful syntax highlighting feature that highlights different Python language features to help you grasp source code … Read more

Python iter() — A Simple Illustrated Guide with Video

Python’s built-in iter() function returns an iterator for the given object. For example, iter([1, 2, 3]) creates an iterator for the list [1, 2, 3]. You can then iterate over all elements in the iterator, one element at a time, in a for or while loop such as: for x in iter([1, 2, 3]). Basic … Read more

Check if All Characters of a String are Uppercase

Problem Formulation: How to check if all characters of a string are uppercase? Background: A string is a sequence of characters, and is amongst the most commonly used and popular data types in Python. Strings can be enclosed by either single or double quotes and are β€˜immutable’, meaning they can’t be changed once created. There … Read more

What’s the Double Colon :: Operator in Python?

Problem Formulation: What does the double colon string[::2] or sequence[3::4] mean in Python? >>> string[::2] You can observe a similar double colon :: for sequences: >>> lst = [1, 2, 3, 4, 5, 6, 7, 8, 9] >>> lst[::2] Answer: The double colon is a special case in Python’s extended slicing feature. The extended slicing … Read more

Best LLC Services for Your Freelance Business

If you don’t protect your castle, they’ll come after you. From teaching thousands of freelancer students, we know that many freelance developers fear that unhappy clients come after their personal assets. Everyone makes mistake and these mistakes can become quite costly when submitting freelance work to a client. You may wonder: Can you protect against … Read more

Python Float Decimal to Octal

Problem Formulation: Given a float number. How to convert it to octal representation? Examples: Consider the following desired conversions from float decimal numbers to their converted float octal numbers. input: 3.14 output: 3.1075 input: 0.01 output: 0.005 input: 12.325 output: 14.246 You can play with some examples here: Solution: The following code function float_to_octal() takes … Read more

Python open() Function — An 80/20 Guide By Example

Python’s built-in open() function opens a file and returns a file object. The only non-optional argument is a filename as a string of the file to be opened. You can use the file object to access the file content. For example, file_obj.readlines() reads all lines of such a file object. Here’s a minimal example of … Read more