Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Copy the python dotted path of the current file to clipboard

License

NotificationsYou must be signed in to change notification settings

kawamataryo/copy-python-path

Repository files navigation

installsE2E

An VS Code extension to copy python dotted paths to the clipboard.

Features

Would you like to get the python path, e.g. when running unittest?

When thecopy python path command is executed, it copies the python dotted path to the clipboard. It also works with context menus.

feature

Copying Imported Symbols

You can now also copy the full dotted path of symbols imported in your Python file. Just place your cursor on an imported symbol and run the command:

fromml_service.lms.models.course_builderimportCreateCourseQuizRequestdefgenerate_quiz_view(request:Request)->Response:data=CreateCourseQuizRequest(**json.loads(request.body))# Place cursor here and run the command# Will copy: ml_service.lms.models.course_builder.CreateCourseQuizRequest

Similarly, running the "Copy python import statement" command on an imported symbol will generate the appropriate import statement:

from ml_service.lms.models.course_builder import CreateCourseQuizRequest

Configuration

If you want to add the workspace folder name to the beginning of the dotted path, add the following setting to setting.json.

{  "copyPythonPath.addModuleRootName": true // default false}

If you want to omit a specific root path from the dotted path (e.g., if your path isroot.app.folder1.classFoo and you want to omitroot.app), add the following setting:

{  "copyPythonPath.omitRootPath": "root.app" // default empty string}

Notice

  • This extension works only with python3 files.

License

MIT

Contributing

Contributions are welcome 🎉
We accept contributions via Pull Requests.

About

Copy the python dotted path of the current file to clipboard

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors5


[8]ページ先頭

©2009-2025 Movatter.jp