热门

最新

红包

立Flag

投票

同城

我的

发布
weixin_61391002
月满长安
2 年前
trueweixin_61391002

在使用doc命令运行Java程序时,使用Javac编译过源代码(后缀为.java的文件)后,会生成.class文件,使用Java命令运行.class文件时只需要输入文件名即可,不需要再输入.class后缀。

CSDN App 扫码分享
分享
评论
点赞
打赏
  • 复制链接
  • 举报
下一条:
try: while True: # 读取一行数据(假设每次发送的数据以换行符结尾) #data = ser.readline().decode("uint8").strip() data = ser.read().decode() # 判断接收到的数据并执行相应操作 print(data) if data=='X': print("666666666666666666")# 执行你的Python文件,这里假设要执行的文件为example.py #execute_python_file("testCSI.py") execute_shell_file("example.sh") #subprocess.run(["bash",script_path], check=True) #except Exception as e: # print(f"Error executing the shell script: {e}") #print() elif data=='Y': print('3333333333333333333') execute_shell_file("example2 .sh") else: print(f"Received: {data}") except KeyboardInterrupt: pass finally: # 关闭串口 ser.close() print("Serial port closed.")if __name__ == "__main__": main()
立即登录