[英]How do I place a Python 3 file in the home folder of my Raspberry Pi
Hey I created some python files on Windows and would now like to run those files on my Raspberry Pi.嘿,我在 Windows 上创建了一些 python 文件,现在想在我的 Raspberry Pi 上运行这些文件。 I've installed Python 3 on the Raspberry Pi, and placed the python file on the SD card.
我已经在 Raspberry Pi 上安装了 Python 3,并将 Python 文件放在 SD 卡上。 When I go to the Python 3.7.3 Shell and go to File->Open and type the name of my python file, it says the file does not exist.
当我转到 Python 3.7.3 Shell 并转到 File->Open 并键入我的 python 文件的名称时,它说该文件不存在。 Is there a specific folder I have to place the python file in on the SD card?
我必须将python文件放在SD卡上的特定文件夹中吗?
/home/pi This is where I usually put my files. /home/pi 这是我通常放置文件的地方。 What OS version did you install on the Pi?
你在树莓派上安装了什么版本的操作系统? Python3 is usually part of the OS install.
Python3 通常是操作系统安装的一部分。
I don't know if you can place your files in some specific location of the SD and then access them from within the RasPi OS.我不知道您是否可以将文件放在 SD 的某个特定位置,然后从 RasPi 操作系统中访问它们。 I would recommend you to use a USB stick and copy the files that way.
我建议您使用 U 盘并以这种方式复制文件。 Handling USB is also easier and is possible wihtout rebooting the RasPi all the time.
处理 USB 也更容易,并且无需一直重新启动 RasPi。
Alternatively, you could establish an SFTP connection, when you are in the same wifi network or by connecting via ethernet.或者,当您在同一个 wifi 网络中或通过以太网连接时,您可以建立 SFTP 连接。 Here is a guide how you can transfer data via SCP, SFTP or Samba.
以下是如何通过 SCP、SFTP 或 Samba 传输数据的指南。 https://howchoo.com/pi/how-to-transfer-files-to-the-raspberry-pi
https://howchoo.com/pi/how-to-transfer-files-to-the-raspberry-pi
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.