Copy with imports¶
Copy with imports copies the selected Python code and prepends the import statements that are referenced inside that selection.
How to use it¶
Select Python code, then run Edit | Copy Special | Copy with Imports.
Notes¶
- The selected text is copied as-is, with only trailing whitespace trimmed.
- Import statements already inside the selection are not duplicated.
- The feature is gated by the Copy with imports setting under Settings | BetterPy | Productivity Actions | Copying.