raspberrypi 開機自動執行程式 與 在terminal開啟第二個terminal執行python

raspberrypi 開啟另一個terminal執行程式


在terminal輸入:
lxterminal -e python3 demo.py



參考自:https://www.raspberrypi.org/forums/viewtopic.php?t=65607

-------------------------------------------------------------------------------------------------------------------------------------------------------



raspberrypi 開機自動執行程式

在terminal中輸入以下指令,開啟檔案:
sudo nano /etc/rc.local


以下是加入執行python程式
#!/bin/sh -e
# 
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# Print the IP address _IP=$(hostname -I) || true
if [ "$_IP" ]; then
   printf "My IP address is %s\n" "$_IP"
fi

sudo python /home/pi/demo.py        <==加入在這邊

exit 0

參考自:http://dirtypig8.blogspot.tw/2016/12/python.html#!/tcmbck

留言

這個網誌中的熱門文章

C# 模擬鍵盤滑鼠控制電腦

python nn 聲音辨識 -1 傅立葉轉換

android 定時通知(永久長期的) 本篇只講AlarmManager使用

python pyautogui 簡介

python opencv 基本讀取、轉換、顯示、儲存等