我有一个运行着raspbmc的rPi,我创建了在启动时运行的autoexec.py。在autoexec.py中,我放置了以下代码:
import os
import shutil
shutil.copyfile(/mnt/usb/scripts/guisettings.xml, /home/pi/.xbmc/userdata/guisettings.xml)但是,每当我尝试运行这个脚本时,我都会得到一个错误。我已经检查了日志文件,它只显示了以下内容:
-->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.SyntaxError'>
Error Contents: ('invalid syntax', ('autoexec.py', 4, 17, 'shutil.copyfile(/mnt/usb/scripts/guisettings.xml, /home/pi$
SyntaxError: ('invalid syntax', ('autoexec.py', 4, 17, 'shutil.copyfile(/mnt/usb/scripts/guisettings.xml, /home/pi/.x$
-->End of Python script error report<--我在这里做错什么了?我已经尝试了一个小时了。
发布于 2014-02-19 03:38:21
您需要引用Python中的文字字符串:
shutil.copyfile('/mnt/usb/scripts/guisettings.xml',
'/home/pi/.xbmc/userdata/guisettings.xml')https://stackoverflow.com/questions/21870483
复制相似问题