简体   繁体   English

如何将 Python 3 文件放在 Raspberry Pi 的主文件夹中

[英]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.

相关问题 如何将 Raspberry Pi 上的 python 更新到至少 3.6? - How do I update python on my Raspberry Pi to at least 3.6? 我需要什么代码才能将树莓派的csv文件写入本地网络中的文件夹? - What code do I need to write a csv file from my raspberry pi to a folder in my local network? 我需要怎么做才能将.csv文件写入共享网络文件夹? (树莓派和Python) - What do I need to do to write a .csv file to a shared network folder? (Raspberry Pi & Python) 在Python(在Raspberry Pi上)中,如何在Tkinter窗口中创建嵌入式键盘 - In Python (on Raspberry Pi) how do I create an embedded keypad within my Tkinter window 如何在树莓派上将 python pip 更新到 3.4? - how do I update python pip to 3.4 on a raspberry pi? 如何在 Raspberry Pi 上使用 Python 更改主机名 - How do I change the hostname using Python on a Raspberry Pi 在我的Raspberry PI上使用Python和OpenCV未保存任何视频文件 - NO video file was saved by using Python and OpenCV on my Raspberry PI Python 文件未附加在 Raspberry Pi 上 - Python file not appending on Raspberry Pi 在树莓派中以python导入文件 - Importing a file in python in raspberry pi 我想在 python 中为 Raspberry pi 循环我的代码 - I want to loop my code in python for Raspberry pi
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM