This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def decorator(param_passed = None): | |
def real_dec(func): | |
def inner(a,b): | |
if param_passed: | |
print(f'Param Passed is {param_passed}') | |
print(f'Performing {func.__name__} on {a} and {b}') | |
return func(a,b) | |
return inner | |
return real_dec | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def decorator(param_passed = None): | |
def real_dec(func): | |
#on passing 0 | |
def inner_1(a,b): | |
print(f'Performing {func.__name__} on {a} and {b} with First Decoration') | |
return func(a,b) | |
#on passing 1 | |
def inner_2(a,b): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Monokai", | |
"foreground": "#FF7CBB", | |
"background": "#272822", | |
"colors": [ | |
"#272822", | |
"#F92672", | |
"#A6E22E", | |
"#F4BF75", | |
"#66D9EF", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import libarchive.public #Not Secure? | |
# Reading the archived 7z file as bytes | |
with open('csvarchive.7z','rb') as f: | |
archive_bytes = f.read() | |
# The function that you might want to use | |
def archive_bytes_to_file_bytes(archive_bytes): | |
global entry_var | |
with libarchive.public.memory_reader(archive_bytes) as reader: |
OlderNewer