I'm new to programming and have been practicing python for a few months now. One problem that I keep facing is when vscode executes old code. I have autosave on and have tried closing the program and opening it again. Currently, I have a totally different file open and its showing me TypeError associated with another file I was working on yesterday. The file that I'm running works perfectly fine in other text editors. Thanks in advance!
From my experience, assuming you are using Run(Ctrl+F5 or F5)
, you are probably building off an old project. In Solution Explorer, when you choose or open the project/repository. It will run and build off of that project until you choose a new one. Just opening another file in the same window/solution will not change the build path.
Another solution you could try is to execute the program file from cmd line in the terminal(ctrl + `)
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.