From: ivnowa at hvision.nl (Hans Nowak)
Date: Tue, 20 Apr 1999 22:14:50 GMT
Subject: User-defined variables / compilation
In-Reply-To: <371C92BA.2C6C883F@igd.fhg.de>
References: <371C92BA.2C6C883F@igd.fhg.de>
Message-ID: <199904202112.XAA21411@axil.hvision.nl>
Content-Length: 1369
X-UID: 1687                                                  

On 20 Apr 99, Ce'Nedra took her magical amulet and heard Jan Thomczek say:

>Hello,
>
>I?m new to this newsgroup and maybe you?ll say "Wow! What a stupid
>question..." I think you?re right-

No way... There are no stupid questions... Although that "why no +=" question 
comes pretty close... ;^)

>I used to program in Turbo-Pascal 6. I installed Python on my NT
>4.0-machine.
>
>I wonder how is the procedure to define the varibles by a user like
>"readln(x);" I?m sure there is a simple way to do so.

I'm not sure what you mean... do you mean, how to write a function that is 
able to change the value of x? Since that's what ReadLn does...

Th answer is: you can't. You can use a function instead; in this case, Python 
has raw_input for this, and you just call it like this:

myname = raw_input("Hi! What's your name? ")

which is more or less equivalent to Turbo's

Write('What''s your name? '); ReadLn(MyName);

>Another question is: How do I *compile* the lines I have written to an
>*.exe-file?

There are some tools for this... I never used them myself though. Look into 
DejaNews for 'freeze'. I'm sure others can tell you more about this.


+  Hans Nowak  (Zephyr Falcon)
+  Homepage (under construction): http://www.cuci.nl/~hnowak/
+  You call me a masterless man. You are wrong. I am my own master.
+  May a pirate chase you for your mashed potatoes!




