0
Code won`t launch in VS code but works fine if launched with python IDLE
zoom=locateCenterOnScreen("zoombar.png", confidence=0.7) zoombar.png is located at the same folder as .py This line of code behaves different if launched with VS code of with python IDLE If launched with VS code we get error: OSError: Failed to read zoombar.png because file is missing, has improper permissions, or is an unsupported or invalid format But if launched with IDLE it works fine How can i fix it to work in VS code, without typing full path of .png`s ( can`t do this because im going to send this code to another person who won`t have exact same path)
14 RĂ©ponses
+ 1
Is your visual studio the right version?
+ 1
Ok, have you got .vscode file in vs?
+ 1
Yeah, the only problem is that VS cant locate my file if i declare it like "123.png", must be "full_path//123.png".
If i run the code using python shell it works
+ 1
Ahhh
+ 1
Like this? -
________________________
| .vscode
| | file
| | main.py
| | example.png
_________________________
Can the img load?
+ 1
Wow, ty. I have 1 more question where do i need to create project to avoid manually dragging png's?
+ 1
Try creating a pyautogui bot to do it, np đ
0
In the terminal of VS code, go to the folder where Ur .Py and the image is and then run the code
0
I think so, installed it 10 days ago
0
Open vscode in full screen, open the file location of your png image, drag and drop it into your project folder (hope this helps đ)
0
project.py and .png's are located in the same folder
0
I made folder at desktop and put .py and png's here. After that i right click .py and open with Code
0
Ohh, drag and drop png into vs