Update Prompt para GUI.txt
Browse files- Prompt para GUI.txt +1 -44
Prompt para GUI.txt
CHANGED
|
@@ -1,44 +1 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
id_dataset = "flytech/python-codes-25k"
|
| 4 |
-
|
| 5 |
-
response = requests.get(
|
| 6 |
-
f"https://huggingface.co/api/datasets/{id_dataset}",
|
| 7 |
-
params={"full": "True"},
|
| 8 |
-
headers={"Authorization": "Bearer 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"}
|
| 9 |
-
)
|
| 10 |
-
|
| 11 |
-
# Verifique se a solicitação foi bem-sucedida
|
| 12 |
-
if response.status_code == 200:
|
| 13 |
-
data = response.json()
|
| 14 |
-
siblings = data.get("siblings", [])
|
| 15 |
-
|
| 16 |
-
# Imprima os nomes dos arquivos enumerados
|
| 17 |
-
for index, sibling in enumerate(siblings, start=1):
|
| 18 |
-
print(f"{index}. {sibling.get('rfilename')}")
|
| 19 |
-
|
| 20 |
-
# Pergunte ao usuário qual arquivo ele deseja abrir
|
| 21 |
-
choice = int(input("Escolha um arquivo para abrir (digite o número): ")) - 1
|
| 22 |
-
|
| 23 |
-
if 0 <= choice < len(siblings):
|
| 24 |
-
chosen_file = siblings[choice].get('rfilename')
|
| 25 |
-
file_url = f"https://huggingface.co/datasets/{id_dataset}/resolve/main/{chosen_file}" # Ajuste a URL conforme necessário
|
| 26 |
-
|
| 27 |
-
# Solicite o arquivo
|
| 28 |
-
file_response = requests.get(file_url)
|
| 29 |
-
|
| 30 |
-
if file_response.status_code == 200:
|
| 31 |
-
# Obtenha o conteúdo do arquivo diretamente na memória
|
| 32 |
-
file_content = file_response.text # Para arquivos de texto
|
| 33 |
-
|
| 34 |
-
# Imprima o conteúdo do arquivo
|
| 35 |
-
print(file_content)
|
| 36 |
-
|
| 37 |
-
else:
|
| 38 |
-
print(f"Erro ao acessar o arquivo: {file_response.status_code}")
|
| 39 |
-
else:
|
| 40 |
-
print("Escolha inválida.")
|
| 41 |
-
else:
|
| 42 |
-
print(f"Erro ao acessar a API: {response.status_code}")
|
| 43 |
-
|
| 44 |
-
|
|
|
|
| 1 |
+
Crie uma interface gráfica para um aplicativo de gerenciamento de tarefas. A GUI deve permitir que os usuários adicionem, editem, excluam e visualizem suas tarefas diárias.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|