Back to Browse

Python useful Modules and Functions

4.1K views
Feb 4, 2018
5:56

Here are some useful python modules and functions which are very useful while working on projects. Stay connected and share. 10. eval This inbuilt function help us to calculate multiple mathematical calculations in one line with string as a parameter. a=eval('10+2/2*5-6+5*59') 9. getpass this function help us to get the password without showing it into a screen Syntax import getpass n=getpass.getpass('Enter your password: ') 8. console To set the size of a console of your program just import os module and type os.system('mode con: cols=50 lines=50') 7. ASCII to get ascii characters in python just type ord('character-name') to print ascii and chr(ascii-no) to print it. 6. range To store and print a number just type a=range(0,100) 5. Strip To remove unwanted characters type n.strip('your-character') 4. lambda To call multiple function create lambda, a=lambda x,y:x+y , it return x+y 3. Threading To execute multiple things simultaneously you can use this, see the documentation and explore it. 2. progressbar To show progressbar in your program just install the module and pass it in your program 1. Tables To store your values in a table format python has a module named as prettytable and store the value according to format and print it. So these are some useful modules and functions in python. If you have any, let me know in comments.

Download

1 formats

Video Formats

360pmp410.1 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

Python useful Modules and Functions | NatokHD