Skip to content

Modules

Basic Uses

# archivo que contiene codigo python
# pypi community https://pypi.org/
# pip3 install hashlib
# pip3 uninstall hashlib 
# pip3 cache purge

import math
import hashlib as hash   
from math import *

print(dir(math))
print(hashlib.file)

Modules

  • cfonts

    import cfonts 
    banner = cfonts.render("Welcome", colors=["red", "yellow"], align="left", font="chrome", space=False, )
    

  • datetime

    today= datetime.datetime.now()
    date = datetime.date(2002,02,02)
    hour = datetime.time(12,12,12)
    

  • re

    text = "the cat in the house"
    matches = re.findall("cat",text)
    matches = re.findall("\d{2}\/",text)
    patron = r'http://([\w]+\.onion)'
    patron = r'href="([\w./\-:]+)"'
    

  • os

    os.path.exists("file.com") 
    os.mkdir("my_directory")
    os.makedirs("dir1/dir2")
    os.listdir()
    os.remove("file.txt")
    os.rmdir("directory")
    os.rename("Name","newName")
    

  • argparse

    def get_arguments():
        parser = argparse.ArgumentParser(Description="description")
        parser.add_argument("-n", "--name", dest="name", help="name to continue")
        options = parser.parse_args()
    
        if not options.name:
            print("please enter the name")
            parser.print_help()
    
        return options.name