Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>python-helperNew to Visual Studio Code? Get it now.
python-helper

python-helper

cqh

|
3,348 installs
| (0) | Free
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

python-helper README

python import helper v2, because upgrade failed, so create a new repo .

cmd with binding

import-upgrade (alt+k u)

select-current-line

这个现在没有了

function_apply_self (alt+ -)

[//]: cqh_goto: proj/src/extension.ts||function_apply_self

目的:对于 func (self, name, value):

快速插入

self.name = name
self.value = value

cqh-python-import-helper.get_parent_args_dict ( alt+] )

[//]: cqh_goto: proj/src/extension.ts||get_parent_args_dict

examples:

  • func(self, name, value, **kwargs) => insert name=name, value=value, **kwargs
  • func(cls, name, value) => insert name=name, value=value

get_parent_name (alt +[)

[//]: cqh_goto: proj/src/extension.ts||get_parent_name

get parent function name

delegate_to_parent (alt+=)

because delegate to parent can complete by get_parent_name + press ( + get_parent_args_dict + press )

and i dont want add more command ,so ignoire

dict_unpack (alt+i)

examples:

  • a, d = d => a, b = d[a], d[b]

  • a,b = c => a, b = c.a, c.b

  • a, b = q_ => a, b = q_a, q_b

  • a, b = q(" => a, b = q("a"), q("n")

  • a, b = q(' => a, b = q('a'), q('n')

  • a, b = q( => a, b = q(a), q(b)

  • a, b = .c() => a, b = a.c(), b.c()

  • a, b = 10* => 10a, 10b

prepend (alt+u)

[//]: cqh_goto: proj/src/extension.ts||dict_prepend

get_left_pattern(alt+h)

[//]: cqh_goto: proj/src/extension.ts||get_left_pattern

get last if variable (alt + \)

[//]: cqh_goto: proj/src/extension.ts||get_last_if_variable

get last line variable (alt + `)

[//]: cqh_goto: proj/src/extension.ts||get_last_line_variable

show var list (alt +n )

show function var by dropdown list

[//]: cqh_goto: proj/src/extension.ts||show_var_list

get current file name (alt +k f)

[//]: cqh_goto: proj/src/extension.ts||get_current_filename

current class name (alt+k c)

[//]: cqh_goto: proj/src/extension.ts||get_current_classname

move op end (alt+ .)

node format (alt+k n)

[//]: cqh_goto: proj/src/extension.ts||node-format

handler var (alt +c )

select history cusor()

[//]: cqh_goto: proj/src/extension.ts||select-history-cusor

insert-last-import(alt+k l)

[//]: cqh_goto: proj/src/extension.ts||insert-last-import

run pytest in terminal

[//]: cqh_goto: proj/src/extension.ts||cqh_run_pytest_in_terminal

get var from comment (alt +b c)

[//]: cqh_goto: proj/src/extension.ts||get_var_from_comment

get var from model (alt+b m)

[//]: cqh_goto: proj/src/extension.ts||get_var_from_model

get peewee class path (alt+b p)

[//]: cqh_goto: proj/src/extension.ts||get_peewee_model

  • app.models.MUser.get_or_create(

  • app.models.MUser._get_or_raise(

  • app.models.MUser.select_with_expression(

  • * ==

    [app.models.MUser == ** => app.models.MUser

select_expression (alt+b w)

[//]: cqh_goto: proj/src/extension.ts||select_expression

  • 'name': app.models.MUser => app.models.MUser
  • 'name': app.models.MUser, => app.models.MUser

not support

  • 'name': app.models.MUser), => app.models.MUser

insert query vars list (alt+b q)

[//]: cqh_goto: proj/src/extension.ts||get_var_from_query

full example:

'''
# cqh_query?
name=test&age=18
'''

tag_name: # cqh_query

  • name={}&age={} => name, age

  • name=test&age=18 => name, age

context cmd

insert base

[//]: cqh_goto: proj/src/extension.ts||insert_base

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft