Home

Awesome

Python Path To Clipboard

Simple plugin to Sublime Text 2 editor to copy the Python import path of the working file to clipboard.

Install

The easiest way to install this is with Package Control.

Usage

To copy the Python import path of the working file press <kbd>Ctrl+Shift+C</kbd> or select an option from the context menu (right-click somewhere in the text area of the working file).

Note: to specify which files should be considered as "Python files" you can edit "python_extensions" variable in the settings.

Example

Suppose the following directory tree of your Python project:

x.py
A/
  __init__.py
  y.py
  B/
    __init__.py
    z.py
  

Depending on the current working file, the following paths will be stored in clipboard:

(current working file)  ->  (path copied to clipboard)

x.py                    ->  x
y.py                    ->  A.y
z.py                    ->  A.B.z
A/__init__.py           ->  A
A/B/__init__.py         ->  A.B