No project description provided
Project description
minhas funções mais utilizadas
def TipoArquivo():
try:
a = (__file__[-2:])
return 'py'
except:
a = os.getcwd()[-2:]
return 'jupter'
def LimparTela(self):
if self.TipoArquivo() != 'py':
pass
else:
os.system('cls')
def DeletarArquivo(caminho_arquivo):
if os.path.exists(caminho_arquivo):
os.remove(caminho_arquivo)
def CriarPasta(caminho_da_pasta):
os.makedirs(caminho_da_pasta)
def Pasta_do_Arquivo(caminho_arquivo):
return os.path.dirname(caminho_arquivo)
def Juntar(a, b):
return os.path.join(a, b)
def Escrever_json(nomedodicionario, nomedoarquivo):
if nomedoarquivo[-4:] != 'json':
nomedoarquivo = nomedoarquivo+'.json'
with open(nomedoarquivo, 'w') as f2:
json.dump(nomedodicionario, f2, indent=4)
def Ler_json(nomedoarquivo): # retorna um dicionário
if nomedoarquivo[-4:] != 'json':
nomedoarquivo = nomedoarquivo+'.json'
with open(nomedoarquivo, 'r') as f2:
try:
a = json.load(f2)
return a
except json.JSONDecodeError as e:
print(f"Erro ao decodificar JSON: {e}")
return {}
def Data():
current_time = datetime.now()
formatted_time = current_time.strftime('%d-%m-%Y-%H:%M:%S')
return formatted_time
def SalvarPickle(var, nome):
if nome[-3:] != 'plk':
nome = nome+'.plk'
with open(nome+'.plk', 'wb') as arquivo:
pickle.dump(var, arquivo)
def LerPickle(nome):
if nome[-3:] != 'plk':
nome = nome+'.plk'
with open(nome+'.plk', 'rb') as arquivo:
return pickle.load(arquivo)
def IniciarThread(funcao, argu = ''):
if argu == '':
Thread(target=funcao, daemon=True).start()
else:
Thread(target=funcao, arqgs = argu, daemon=True).start()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
funcoes_leo-0.1.2.tar.gz
(2.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file funcoes_leo-0.1.2.tar.gz.
File metadata
- Download URL: funcoes_leo-0.1.2.tar.gz
- Upload date:
- Size: 2.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.2 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
72e61e66b732342e9de8b7e4a5d7e96d0532e9ba355c0eef2112077df988e576
|
|
| MD5 |
89a328a34ecbaedfc20ff33f47f689dd
|
|
| BLAKE2b-256 |
443e83ecd2045c8eb044ad299a47a940e0545dca685337a5406f2c297135160f
|
File details
Details for the file funcoes_leo-0.1.2-py3-none-any.whl.
File metadata
- Download URL: funcoes_leo-0.1.2-py3-none-any.whl
- Upload date:
- Size: 2.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.2 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
861e1a6f0ec55159f547006cb76e4d758229ad63dfbb4db3188f07371f52be5f
|
|
| MD5 |
d649f3b8e8cb991508b01fe6ffc455f7
|
|
| BLAKE2b-256 |
42108d5865480c9c9545ed1038a5b9d0b9f99f6840cae7e4ba51d5bc0d784973
|