skip to Main Content

I am using VS Code. I try to use a function called fitz.open which need me to declare a filename. But when i type fitz.open(‘ , it does not show me the paths of folders for me to select. Does anyone know what is the cause behind?

I tried ‘tab’ in cmd and it works. But it does not work in python script in VS code.

2

Answers


  1. I am unsure about your problem. As far as I understand, you are entering some command inside a .py file and expect VS Code to provide you with paths as auto complete (as in the terminal/shell?)?
    Not 100% sure however I think this is not possible in native VS Code (maybe there is a plugin).

    However you can right click on a folder or file in VS Code and select Copy Path or Copy Relative Path and than paste it into your .py file.

    Login or Signup to reply.
  2. Editing a .py file is not the same as using the command line: IntelliSense does not know directories/file system structure around your file.
    As far as your code editing is concerned, you are just inputting a string literal… The editor can not know in what directory the code/script will reside and be executed in the future.
    You could copy and paste the script file to another location and execute it there in the future (where your autocompleted paths/folders would be incorrect).

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search