microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.46k stars 28.96k forks source link

No output from my script #216516

Closed LordSilverX closed 3 months ago

LordSilverX commented 3 months ago

Type: Bug

this file is called check_name.py

import requests import itertools from time import sleep

def check_name(name): url = f"https://api.mojang.com/users/profiles/minecraft/{name}" res = requests.get(url)

if res.status_code == 204:
    return True
elif res.status_code == 200:
    return False
elif res.status_code == 429:
    sleep(5)
    return check_name(name)

names = [] for i in itertools.product("abcdefghijklmnopqrstuvwxyz_0123456789", repeat=3): name = "".join(i) names.append(name)

with open("names.txt", "w") as f: for name in names: if check_name(name): f.write(f"{name}\n") print(f"Le nom {name} est disponible.")

print("Le script a terminé l'exécution.")

Here's my code, but first while I tried to execute it : Step 1 : i needed to change my directory which at first didn't worked but after it did (i'm lost honestly) : PS C:\Users\MyName> E:\Mc (if i use it like this "cd E:\Mc" it doesn't work)

Step 2 : After that i run this command to execute the script above like this : PS E:\Mc> python check_name.py

Step 3 : After execution of the terminal, PowerShell no longer works and the terminal freezes.

the names.txt file is supposed to have the output of the script. I would greatly appreciate help from your support as soon as possible, i can send you screenshots, videos even starting a call on discord and show you everything directly. Thanks for reading my report. Yann

VS Code version: Code 1.90.1 (611f9bfce64f25108829dd295f54a6894e87339d, 2024-06-11T21:01:24.262Z) OS version: Windows_NT x64 10.0.19045 Modes:

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i5-10400F CPU @ 2.90GHz (12 x 2904)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|15.89GB (5.56GB free)| |Process Argv|--crash-reporter-id c9c3af6c-fd3b-4b49-9b58-d887b619507b| |Screen Reader|no| |VM|0%|
Extensions (4) Extension|Author (truncated)|Version ---|---|--- debugpy|ms-|2024.6.0 python|ms-|2024.8.1 vscode-pylance|ms-|2024.6.1 indent-rainbow|ode|8.3.1
A/B Experiments ``` vsliv368:30146709 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscorecescf:30445987 vscod805cf:30301675 binariesv615:30325510 vsaa593cf:30376535 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyone:30548225 962ge761:30959799 f8hc8238:30694864 pythongtdpath:30769146 welcomedialogc:30910334 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 pythontestfixt:30902429 pythonregdiag2:30936856 pythonmypyd1:30879173 h48ei257:31000450 pythontbext0:30879054 accentitlementst:30995554 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 jchc7451:31067544 chatpanelt:31048053 dsvsc021:30996838 0ee40948:31013168 pythoncenvpt:31062603 a69g1124:31058053 dvdeprecation:31068756 pythonprt:31056678 dwnewjupyter:31046869 [names.txt](https://github.com/user-attachments/files/15889231/names.txt) [names.txt](https://github.com/user-attachments/files/15889233/names.txt) impr_priority:31077527 ```
roblourens commented 3 months ago

This sounds like an issue with your code or system setup, sorry

LordSilverX commented 3 months ago

This sounds like an issue with your code or system setup, sorry

Do you know something that can execute the script without being complicated ? I installed three different things none of them, including VS Code, cant be simple to just run a script...just running it nothing more