.py (python)

Started by
5 comments, last by Trap 18 years, 11 months ago
okay, ive finished writing my game. I saved it as a .py file. Then i send the file to a friend to test it out. My friend said he cant open it. I know why, he does not have pythoin in his comp, so he cant open .py files How do i save it? i tried as a .exe, but an error occurs.
Advertisement
Give py2exe a try.
I believe it's because python is a so-called 'scripting' language. That is, something that isn't compiled. Much like html requires a browser to use, so does python require a program to run the source... unless they have another program like 'py2exe'

C++: A Dialog | C++0x Features: Part1 (lambdas, auto, static_assert) , Part 2 (rvalue references) , Part 3 (decltype) | Write Games | Fix Your Timestep!

Better yet, get him to install Python. He won't regret it.
Quote:Original post by nobodynews
I believe it's because python is a so-called 'scripting' language. That is, something that isn't compiled.
That makes it an interpreted language. It is not simply a "scripting" language.

Quote:Original post by nobodynews
Much like html requires a browser to use, so does python require a program to run the source... unless they have another program like 'py2exe'
py2exe simply wraps python with your source so that's its transparent to the user, it doesn't do anything magic (just to clarify).
Well, it wont really matter for him to download Python, as the main purpose of this is to present it in a science fair (they unfortunatly chose me to give a presentation) and I need the file to work in any computer. Basically, I have the code in C++ and Python, and I compare the two. However, C++ compiles the whole code, allowing me to use it in other computers (correct me if im wrong). But for Python, since its an interpreted language, I cant bring the code without Python itself. Ive tried using the py2exe, but im not really sure how to work it. I would read the instructions, but its confusing and I dont have the time to read it thoroughly. Can anyone help me? I just need the code to work in other computers, whether it has Python or not.

(note* I dont have time doesnt mean Im lazy, it means that my presentation is in 1 day...yikes!)
py2exe is a small addon to the distutils, look there, write a working distutil script, converting it to .exe is a piece of a cake then.

This topic is closed to new replies.

Advertisement