![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Jul 2007
Posts: 5
Rep Power: 0
![]() |
Ok this question is gona sounds dumb but I'm new to programming. I'm learning python and downloaded some thing off the official website. I got to writing a shell all well and good but how do I compile the thing? Is there a compiler I downloaded when i got the rest of the stuff or is it something separate i need to get and if so whats the best one?
|
|
|
|
|
|
#2 |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 4
![]() |
The short answer is that Python is not a compiled language: it's interpreted. To run your application, type "python thenameofyourapp.py" at the command line, or double-click on the Python script in explorer (assuming you're using Windows).
The longer answer is that Python compiles code on the fly into a custom bytecode format, similar to .NET or Java, and caches this bytecode in pyc files. This makes Python applications faster than they would be in a purely interpreted language. But the Python interpreter is still needed to run these bytecode formats. In addition, there are the IronPython and JPython projects which integrate with the .NET and Java environments, respectively. IronPython applications can be compiled into executables that only require the .NET libraries to run. There is also py2exe, which is an application that can turn your Python code into an stand-alone executable by wrapping your code up with a Python interpreter. This allows people without Python installed to run your application. The exes produced tend to have an overhead of about 1 Meg, but I've heard that UPX can shrink them by quite a bit (though I haven't tried it myself). |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Jul 2007
Posts: 5
Rep Power: 0
![]() |
thanks a bunch after looking back though, over some books i figured out python was interpreted more than compiled but thanks for the stuff bout how to make it a .exe because I'm going to be making games and would like to bring it over other peoples computers. (working on making a tetris clone now)
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Virtual pet site MySQL question | proudnerd | PHP | 6 | May 13th, 2006 7:22 PM |
| Attitudes | Oddball | Coder's Corner Lounge | 29 | Mar 18th, 2006 9:34 PM |
| How to post a question | nnxion | C++ | 10 | Jun 3rd, 2005 11:53 AM |
| How to post a question | nnxion | C++ | 0 | Jun 3rd, 2005 8:55 AM |
| How to post a question | nnxion | C | 0 | Jun 3rd, 2005 8:55 AM |