📄 mymod.py
字号:
#########################################################
# C runs Python code in this module in embedded mode.
# Such a file can be changed without changing the C layer.
# There is just standard Python code (C does conversions).
# You can also run code in standard modules like string.
#########################################################
import string
message = 'original string'
message =message+message
msg_error=""
try:
text_file = open("text.txt", "r")
whole_thing = text_file.read()
text_file.close()
except IOError, (errno, strerror):
print "I/O error(%s): %s" % (errno, strerror)
def transform(input):
#input = string.replace(input, 'life', 'Python')
return string.upper(input)
def change_msg(nul):
global message #如果没有此行,message是函数里头的局部变量
message='string changed'
return message
def r_file(nul):
return whole_thing
def get_msg(nul):
return message
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -