简体   繁体   English

如何在Windows中运行python脚本

[英]How to run python script in windows

I need to write a python code which enables me to verify whether the received SSL certificate from a website is valid or not. 我需要编写一个python代码,使我能够验证从网站收到的SSL证书是否有效。 the code snippet is gonna be executed in windows platform. 代码片段将在Windows平台上执行。 I've been using Editra to code python recently which is equipped with PyStudio plugin. 我最近一直在使用Editra编写python代码,它配备了PyStudio插件。 I got confused if it's a possible idea or not. 如果这是一个可能的想法,我感到困惑。 Does anyone have any idea how to make it work? 有谁知道如何让它工作?

If you want to distribute a Python script on Windows, (which doesn't have Python installed by default), you can use py2exe . 如果要在Windows上分发Python脚本(默认情况下没有安装Python),可以使用py2exe py2exe converts your Python script into an executable that Windows users can run without them needing to install Python. py2exe将您的Python脚本转换为Windows用户无需安装Python即可运行的可执行文件。

如果您担心在Windows下安装好的Python,包括许多有用的,预先配置的软件包,请考虑使用Python XY

Assuming it's just a plain script you want to execute, you can do so by invoking the python runtime in the command line, and issuing it to execute the script. 假设它只是一个你想要执行的普通脚本,你可以通过在命令行中调用python运行时并发出它来执行脚本来实现。

For instance: 例如:

python myscript.py

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM