简体   繁体   English

在Windows中使用Bash模块运行Python脚本

[英]Run Python Script with Bash modules in Windows

I have a Python script and I'm trying to run it from Windows or some online Python interpreter. 我有一个Python脚本,正在尝试从Windows或某些在线Python解释器运行它。 I would like my friend to test it but he doesn't have linux. 我想让我的朋友测试一下,但是他没有linux。

The conflict here is that I have modules such as "import os" in the script that is only native to the bash environment. 这里的冲突是,我在脚本中只有bash环境原生的模块,例如“ import os”。 So how can I get my friend to run my .py script in Windows? 那么,如何让我的朋友在Windows中运行我的.py脚本?

Thanks! 谢谢!

The cool thing about python is that you friend should be able to run your script with little to no change(hopefully), to quote the python os docs 关于python的一个很酷的事情是,您的朋友应该能够几乎没有变化地运行脚本(希望如此),引用python os docs

This module provides a portable way of using operating system dependent functionality. 该模块提供了使用依赖于操作系统的功能的便携式方法。

If your friend did have an issue you might have a another question to ask. 如果您的朋友确实有问题,则可能要问另一个问题。

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

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