Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python

User-defined variables / compilation

 

 

Python python RSS feed   Index | Next | Previous | View Threaded


jant at igd

Apr 20, 1999, 7:44 AM

Post #1 of 2 (62 views)
Permalink
User-defined variables / compilation

Hello,

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

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.
Another question is: How do I *compile* the lines I have written to an
*.exe-file?

Thanks in advance,

Jan Thomczek


--
o---------------------------------------------------o
| JAN THOMCZEK |
o---------------------------------------------------o
| Marketing und Kommunikation |
o---------------------------------------------------o
| Telefon: +49 (0)6151 / 155-437 |
| Fax: +49 (0)6151 / 155-446 |
| E-mail: jant [at] igd |
| jant [at] zgdv |
| URL: http://www.igd.fhg.de/~jant |
o---------------------------------------------------o
| Scientists have shown that the moon is moving |
| away a small measurable distance from the earth |
| every year. You can calculate that 65 million |
| years ago the moon was orbiting the earth at a |
| distance of about 10 meters from the surface... |
| This would explain the death of the dinosaurs. |
o---------------------------------------------------o


ivnowa at hvision

Apr 20, 1999, 3:14 PM

Post #2 of 2 (63 views)
Permalink
User-defined variables / compilation [In reply to]

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

>Hello,
>
>I=B4m new to this newsgroup and maybe you=B4ll say "Wow! What a stupid
>question..." I think you=B4re right-

No way... There are no stupid questions... Although that "why no +=3D" que=
stion
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=B4m 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, Pyt=
hon
has raw_input for this, and you just call it like this:

myname =3D 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 int=
o
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!

Python python RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.