Python tutorials

Using Python’s pathlib Module

Have you struggled with file path handling in Python? With the pathlib module, the struggle is now over! You no longer need to scratch your head over code like this: >>> >>> path.rsplit(”, maxsplit=1)[0] And you don’t have to cringe at the verbosity of something like this: >>> >>> os.path.isfile(os.path.join(os.path.expanduser(‘~’), ‘realpython.txt’)) In this video course, you’ll learn how to: Work with file    

Read more

Iterations on the Modern Data Stack

You might have noticed the dust on images in the icons and AWS UI. These are screenshot from 2016 (gulp), so reproducing these exact steps will be challenging to say the least. For example, at the time I felt generous enough to try Atom as my text editor — the redeeming value is that at least it was an Electron app. But S3 explorer? Fast forward five years, and, with some minor exceptions, it can still server as a valid […]

Read more

How to Get a List of All Files in a Directory With Python

Getting a list of all the files and folders in a directory is a natural first step for many file-related operations in Python. When looking into it, though, you may be surprised to find various ways to go about it. When you’re faced with many ways of doing something, it can be a good indication that there’s no one-size-fits-all solution to your problems. Most likely, every solution will have its own advantages and trade-offs. This is the case when it […]

Read more
1 50 51 52 53 54 181