Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Couple quick questions from a Python Noob

Reply
Thread Tools

Couple quick questions from a Python Noob

 
 
digitalsubjunctive@gmail.com
Guest
Posts: n/a
 
      07-21-2005
Hey, I just started on Python and have a few questions I couldn't find
answers to on the Python site or it's tutorial.

1. I notice a few "compiled python" files (indicated by reddish snake
icons), I thought Python didn't need to be compiled? This is my first
venture into programming, but if it doesn't need to be compiled why
compile it?

2. What is a .pwy file?

3. I want to save my first few programs as .exe files so I can show
them off to all my leet friends. Okay, so the only program I've made
takes your birthday and tells you what you're astrological sign is, but
I'm in rural Nebraska and we don't have all that much to do

Thanks for any help you guys!

 
Reply With Quote
 
 
 
 
bruno modulix
Guest
Posts: n/a
 
      07-21-2005
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:

> Hey, I just started on Python and have a few questions I couldn't find
> answers to on the Python site or it's tutorial.
>
> 1. I notice a few "compiled python" files (indicated by reddish snake
> icons), I thought Python didn't need to be compiled? This is my first
> venture into programming, but if it doesn't need to be compiled why
> compile it?


Just like Java, the Python interpreter runs python byte-code. The Python
compiler compile Python source code into Python byte-code. Now the
difference with Java is that you don't have to manually call the
compiler - the interpreter will do it for you if and when needed.

If you don't know what 'byte-code' is, it's just like a machine language
(op-codes and the like) for a processor that doesn't exists - in fact
this 'processor' is the interpreter (or 'Virtual Machine') itself.

The main purpose is to have something that execute faster than purely
interpreted languages (since parsing is already done), and is still
portable between platforms (which is not that much important with
Python, since we usually distribute the source files...).

> 2. What is a .pwy file?


(isn't that .pyw ?)
It's a Windows-only stuff that avoid the DOS shell window to be opened
when executing the script.

> 3. I want to save my first few programs as .exe files so I can show
> them off to all my leet friends.


'.exe' files are Windows-specific. Python doesn't handle this out of the
box. But there are programs like py2exe (and others, don't remember
their name) that 'freeze' your script, the interpreter and all needed
librairies in a .exe.

HTH
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in '(E-Mail Removed)'.split('@')])"
 
Reply With Quote
 
 
 
 
stringy
Guest
Posts: n/a
 
      07-21-2005
For compiling Python, http://effbot.org/zone/python-compile.htm appears
to have some information, although I've never done it myself, so I
wouldn't know any more on the matter.

Also http://starship.python.net/crew/theller/py2exe/ appears to have
something on Python-> .exe

 
Reply With Quote
 
digitalsubjunctive@gmail.com
Guest
Posts: n/a
 
      07-21-2005
Thanks you to.

Oh, and it is .pyw, you're right.

 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: A couple quick questions about Thunderbird v3,0 Peter Potamus the Purple Hippo Firefox 0 12-13-2009 12:55 AM
Python Noob - a couple questions involving a web app Kyle T. Jones Python 7 04-30-2009 04:46 PM
couple quick questions about YARV Joshua Haberman Ruby 5 02-19-2006 10:23 AM
Couple of quick questions. Dan MCSA 3 01-10-2004 02:31 AM
A couple more quick questions... messages@home.com A+ Certification 5 08-27-2003 11:34 PM



Advertisments