简体   繁体   中英

Change settings on VS Code to be like Sublime Text

I am a beginner programmer so please bear with me. In Sublime Text, pygame finds the images on the folder (which can be specified) in which the.py file is located in. Example:

pygame.image.load("data/magnifying_glass.png")

In VS Code, you have to set the current working directory to a folder, which would be where your images (or.tiff) files are located. It would look messy if image files from every projects are located in one folder. Tried os.path.join but didn't work.

You need to open a folder . It can be done from File -> Open Folder from the top menu. You can also use the key combination Ctrl + K, Ctrl + O . Then choose your current working directory (not file). Click open and your files should be here. It means you need a project folder.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM