Mx_PyTips's profile picture. mildly interesting tips and tricks you may or may not know about the programming language Python, from your new favourite trans geek girl

python tips from olivia

@Mx_PyTips

mildly interesting tips and tricks you may or may not know about the programming language Python, from your new favourite trans geek girl

did you know, you can also apply type annotations to variables?

Mx_PyTips's tweet image. did you know, you can also apply type annotations to variables?

you can check the __name__ of a module to make some code only run when the module is ran directly, instead of being imported

Mx_PyTips's tweet image. you can check the __name__ of a module to make some code only run when the module is ran directly, instead of being imported
Mx_PyTips's tweet image. you can check the __name__ of a module to make some code only run when the module is ran directly, instead of being imported

python has type annotations which helps you know what sort of values the function can accept, some IDEs (such as visual studio code depicted here) can show them to you as you write

Mx_PyTips's tweet image. python has type annotations which helps you know what sort of values the function can accept, some IDEs (such as visual studio code depicted here) can show them to you as you write

"The Zen of Python" by Tim Peters is a always a good read, try importing 'this'


python's pickle module can be used for arbitrary code execution, never use it in an unsecured way, especially for elevated programs

Mx_PyTips's tweet image. python's pickle module can be used for arbitrary code execution, never use it in an unsecured way, especially for elevated programs
Mx_PyTips's tweet image. python's pickle module can be used for arbitrary code execution, never use it in an unsecured way, especially for elevated programs

starting from Python 3.9 you can merge dictionaries with the bitwise or ( "|" ) operator

Mx_PyTips's tweet image. starting from Python 3.9 you can merge dictionaries with the bitwise or ( "|" )  operator

Loading...

Something went wrong.


Something went wrong.