This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
print('The command line arguments are:') | |
for i in sys.argv: | |
print(i) | |
print('\n\nThe PYTHONPATH is', sys.path, '\n') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def total(a=5, *numbers, **phonebook): | |
print('a', a) | |
#遍历元组中的所有项目 | |
for single_item in numbers: | |
print('single_item', single_item) | |
#遍历词典中的所有项目 | |
for first_part, second_part in phonebook.items(): | |
print(first_part, second_part) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ "keys": ["enter"], "command": "insert_space", "context": | |
[ | |
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, | |
{ "key": "following_text", "operator": "not_regex_contains", "operand": "^\\}", "match_all": true }, | |
{ "key": "selector", "operator": "equal", "operand": "(source.c, source.c++, source.python, source.cs)", "match_all": true }, | |
{ "key": "panel_has_focus", "operator": "not_equal", "operand": true}, | |
{ "key": "auto_complete_visible", "operator": "equal", "operand": false}, | |
] | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sublime, sublime_plugin | |
req_single_op_all = '(([\+\-\*/%=<>\|&\^\?]|(<<)|(>>))(=)|(!=))|((?<=[\w ])((<<)|(>>)|(&&)|(\|\|)|[\+\-\*/%=<>\|&\^\?])(?=[\w ]))' | |
#这个正则表达式匹配: | |
#+ - * / % = < > | & ^ ? << >> && || != += -= *= /= %= &= ^= |= <<= >>= | |
reg_tri_op = '\?[\w ]*:' | |
#三目运算符?:,需要特殊处理,因为':'号在switc case语句中前后不需要加空格 | |
reg_comma = '(,|;)(?=[\w])' | |
#','';'运算符,需要特殊处理,因为一般','';'前面不加空格,而后面加空格 | |
char_to_ins = ' ' | |