简体   繁体   English

使用另一台计算机的 python 脚本在新计算机上安装 Python?

[英]Installing Python on a fresh new computer using a python script from another one?

So, for example, I have two Windows PCs that are not connected to same network.因此,例如,我有两台未连接到同一网络的 Windows PC。 Let's name them Computer 1 and Computer 2. Computer 2 already has python installed in it and Computer 1 is brand new让我们将它们命名为计算机 1 和计算机 2。计算机 2 已经安装了 python,计算机 1 是全新的

I want to be able to install python environment on Computer 1 using the.exe file that we can get from python.org while sitting at Computer 2我希望能够在计算机 1 上安装 python 环境,使用我们可以从 python.org 获得的 .exe 文件坐在计算机 2 上

Suppose Computer 1 has a.exe file that it received from me.假设计算机 1 有一个从我那里收到的 .exe 文件。 When that exe is run, I want it to install python in their PC当该 exe 运行时,我希望它在他们的 PC 中安装 python

  1. You will need a way to transfer the file form local machine to remote.您将需要一种将文件从本地机器传输到远程的方法。
  2. Execute a script on remote machine.在远程机器上执行脚本。

On Linux, you can use scp for step 1在 Linux 上,您可以在步骤 1 中使用 scp

scp local_python_file_or_script.sh  remote-user@remote_machine_ip:/path_on_remote/

After this you can use ssh to execute the script on remote machine之后,您可以使用 ssh 在远程机器上执行脚本

ssh user@remote_machine_ip  /path_on_remote/local_python_file_or_script.sh

PS. PS。 If the file is not executable on remote machine, you will need to use ssh and change chmod +x PS2.如果该文件在远程机器上不可执行,则需要使用 ssh 并更改 chmod +x PS2。 You will need to find the equivalent for these tools on windows.您需要在 windows 上找到这些工具的等效工具。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 相同的 python 脚本在一台计算机上工作,但在另一台计算机上不起作用 - Same python script works in one computer but not in another 从另一台计算机运行python脚本,而无需安装软件包/设置环境? - Run python script from another computer without installing packages/setting up environment? 使用python从一台计算机向另一台计算机发送UDP - Sending UDP from one computer to another in python 在客户端计算机上安装和使用python - Installing and using python on a client computer 将Python脚本移动到另一台计算机 - Moving a Python script to another computer 如何将带有 mysql 数据库的 python 脚本部署到另一台计算机 - how does one deploy a python script with a mysql database to another computer 在新计算机上使用 Django 和 Djongo 时出现 Python 错误 - Python error when using Django and Djongo on fresh computer 在另一个 python 脚本中使用 output.csv 文件 - Using output .csv file from one python script in another 将文件从一个文件夹复制到另一个文件夹,然后使用当前日期/时间重命名,并使用PowerShell或Python脚本重命名新文件 - Copy file from one folder to another and then rename using current date/time and new file ext using PowerShell or Python script 错误:从计算机安装 Python 库 - Error: Installing Python libraries from the computer
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM