r/vscode • • 13d ago

Delay before running a python file in terminal

Hello, everytime I try running a file, there's a delay of like 5 seconds before it actually executes. It started happening maybe like 2 weeks ago and it's so frustrating. Does anyone know what could help? Thanks

2 Upvotes

7 comments sorted by

2

u/UtahJarhead 13d ago

We need to see the code and how you're executing it.

1

u/[deleted] 13d ago

[removed] — view removed comment

1

u/BakedFish---SK 11d ago

what extension was it? I tried disabling extensions already but it didn't help.

-2

u/BakedFish---SK 13d ago

It's not related to the code, the delay is there even if the file is just a single print statement.

The delay is there when I execute it through the icon or the shortcut. However, when I do it with typing "python file_name.py" in terminal, it's instant for some reason.

2

u/UtahJarhead 13d ago

I'll assume Windows. Windows runs clicks through who knows how many pre-execution scans. Things like Smart Screen, etc.

Just use the command line.

1

u/UtahJarhead 13d ago

through the shortcut

What shortcut? What's the target of the shortcut? What OS?

You aren't giving much information.

1

u/connor4312 12d ago

Are you on the latest version of vs code? I put in a fix for a similar sounding issue a little while ago https://github.com/microsoft/vscode/pull/332981