一定要先声明 py文件: args = '' def message_handle(): global args args = 'bytes' message_handle() print('全局变量已更改'+args)