Python–start document-loop–call

February 26, 2009 at 08:40:08
Specs: win xp 5.1.2600, 3mhz/2 gig
Hi guys…
3 Python questions. Any assistance is appreciated. Thank you.

How do I:
Start a text document in Python?
Ie: “start c:\projects\newdocument.txt”

Create a simple loop?
Ie: loop
If ans == 1:
Print “1”
Print “2”
Print “entry invalid… please retry”
Goto loop

Call a sub-routine?
Ie: if ans == 1:
Call sub1
Call sub2

See More: Python–start document-loop–call

Report •

February 27, 2009 at 04:54:08
Does anyone here use Python???


Report •

February 27, 2009 at 05:27:04
I have used python a little.....

Because it is a "proper programming language" goto is non-existent(except for a library that was supposedly intended as a joke - haven't used it though). A while loop is normally the way to go.

You may want to have a look at the "spawn" function and it's derivatives for starting the document or possibly the options the system library offers.

As for the subroutine you may need to make function, class or something similar.

I can't help much more than that because my experience with python is lacking...

Report •

February 27, 2009 at 05:32:10
Thanks Judago.
I will look up Functions, classes and Spawn.

Who knows... it could be exactly what I need!


Report •

Related Solutions

Ask Question