如何在没有任何安装的情况下在Windows上运行脚本

时间:2016-03-09 10:50:01

标签: python python-2.7

如果我用.py创建python代码,我希望我的朋友得到代码,它将在主题计算机上工作(打开文件并打印出来)。

如果没有安装我怎么能这样做。

我的意思是我不会让他们安装python。

我可以用.exe或其他东西吗?

谢谢!

我的代码很愚蠢,但这里需要 -

    #!/usr/bin/python

    # Open a file
    fo = open("foo.txt", "r+")
    str = fo.read(10);
    print "Read String is : ", str
    # Close opend file
    fo.close()

1 个答案:

答案 0 :(得分:1)

我会使用Py2exe

但这里有更多的解决方案是两个链接 link 1 link 2