Untitled

mail@pastecode.io avatar
unknown
python
2 years ago
308 B
2
Indexable
Never
from some_decorators import run

""" Running 'main' function in the script when running with __name__ == '__main__' """



""" Traditional way """
def main():
    print('Some action...')
    

if __name__ == '__main__':
    main()
    
    

""" Decorator way """
@run
def main():
    print('Some action...')