GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Vahab-Programmer/Python-Addons: Some Python Addons Python Don`t Have

BranchesTags
Open more actions menu

Latest commit

 

History

8 Commits
8 Commits

Folders and files

NameName
Last commit message
Last commit date
addons
addons
 
 
README.md
README.md
 
 
setup.py
setup.py
 
 

Repository files navigation

Python Add-ons

I programmed This Module for python which
add some ability python don`t have
like Overloading

Overloading

the class uses Type Hints for Overloading sample of Overloading in python

from addons import Overload

@Overload # Always Need Type Hint
def printer(data:str)->None:
    print("String Data:",data)

@printer.overload # automate overloading using Type Hint
def printer_int(data:int)->None:
    print("Integer Data:",data)

@printer.overload_manual(float) # manual function overloading
def printer_float(data)->None:
    print("Float Data:",data)

@printer.default
def printer_default(data)->None:
    print("Other Data:",data)

printer("123")   # output: String Data: 123
printer(123)     # output: Integer Data: 123
printer(12.3)    # output: FLoat Data: 12.3
printer([1,2,3]) # output: Other Data: [1,2,3]

Logging

sample of logging in python using Logger

from addons import Logger,DEBUG,INFO,WARNING,ERROR,CRITICAL,UNKNOWN

logger=Logger("Python addons",log_level=DEBUG)
logger.log("This is A Debug Message",level=DEBUG)
logger.log("This is A Info Message")
logger.log("This is A Warning Message",level=WARNING)
logger.log("This is A Error Message",level=ERROR)
logger.log("This is A Critical Message",level=CRITICAL)
logger.log("This is A Unknown Message",level=UNKNOWN)
logger.log("multiply","Message",123,[1,2,3],level=DEBUG)

Thread With Return

sample of creating and getting the Thread return using ThreadReturn

from addons import ThreadReturn

def pow(x:int,y:int)->int:
    return x**y

thread=ThreadReturn(target=pow,args=(2,16))
thread.start()
thread.join()
print(thread.return_value) # output: 65536

Creator

Author: Vahab Programmer
Github Page: Vahab-Programmer
Email: [email protected]
Telegram: Vahab Programmer Channel

About

Some Python Addons Python Don`t Have

Topics

awesomeawesome-listawesome-listsawesomewmcolordecoratorsdecorators-pythonloggerloggingoopoverloadoverloadingpythonpython-addonspython3type-hintingutilitiesutilityvahab-repo

Resources

Readme
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.