Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Aug 30th, 2007, 11:16 PM   #1
ThatBuddyKid
Newbie
 
Join Date: Jul 2007
Posts: 5
Rep Power: 0 ThatBuddyKid is on a distinguished road
Question Compile/Interpreting question

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?
ThatBuddyKid is offline   Reply With Quote
Old Aug 31st, 2007, 5:56 AM   #2
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
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).
Arevos is offline   Reply With Quote
Old Aug 31st, 2007, 12:26 PM   #3
ThatBuddyKid
Newbie
 
Join Date: Jul 2007
Posts: 5
Rep Power: 0 ThatBuddyKid is on a distinguished road
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)
ThatBuddyKid is offline   Reply With Quote
Old Aug 31st, 2007, 1:26 PM   #4
titaniumdecoy
Expert Programmer
 
titaniumdecoy's Avatar
 
Join Date: Nov 2005
Posts: 856
Rep Power: 3 titaniumdecoy is on a distinguished road
Send a message via AIM to titaniumdecoy
If you're interested in writing games in Python, check out pygame.
titaniumdecoy is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:27 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC