树莓派是默认安装了 python 的那么来写一些 python 程序吧。 运行 python 有两种方式,一种是交互方式,一种文件运行方式。 交互方式例子 python 输出打印“世界,你好” print("hello,world") hello,world 数学运算 1+2+3 6 退出 python 交互程序 exit() 或者按键盘的 Ctrl + D 也可以退出 python 交互程序文件运行方式例子 nano hi.py 写入以下代码 print("hello,world") 保存退出 执行 python hi.py hello,world |