我有一个字典dicts.py
中的字典:
#!/usr/bin/env python3
errors = {
'errorMessageNotSent' : 'Your message was not sent',
'errorConnectionLost' : 'The connection to the server was lost\nTry again later.'
'errorMessageMalformed' : 'Your message seems to have unwilling characters, Check for them and try again'
}
我在我的代码中以这种方式在文件action.py
中使用它:
#!/usr/bin/env python3
from dicts import errors
def doAction():
if error_happened_and_message_was_not_sent:
print(errors['errorMessageNotSent'])
else:
print(errors['errorMessageMalformed'])
过了一段时间,我想进行重构并将errorMessageMalformed
重命名为error_MalformedMessage
errors
字典中的dicts.py
字典及print
中的action.py
字典另一个文件中的语句(Caret should be positioned at a symbol to be refactored
)。
如何使用pycharm实现这一目标?
我试过 Shift + F6 ,但它告诉我if [ -z "$1" ]; then
read -p "supply x:" x
else
x="$1"
fi
。
这甚至可能吗?