Python useful snippets

In this post you can find useful and frequently used Python snippets. Just copy and paste it!

Creating new directory (folder)

Writing to a file

Create a new folder and write a file inside it

How to write a long multi line text into a file

Creating a list and loop through it

Creating a nested list and loop through it again

Do you like this post? Consider a donation 😀

Published by


Habibie is an Indonesian freelance frontend-backend web programmer and cross platform mobile app developer. He's also good at graphics design, video editing, visual effects and animation.

Leave a Reply

Your email address will not be published. Required fields are marked *