Re: Foxpro goto command and deleted records

2012-07-18 Thread Ed Leafe
On Jul 18, 2012, at 12:57 PM, MRAB wrote: >> #4 is probably the most Pythonic approach. The calling code can then >> decide how to react to attempting to access a deleted record. Even if you're >> accessing data stored in VFP tables, your module should be as Pythonic as >> possible. >> >

Re: Foxpro goto command and deleted records

2012-07-18 Thread MRAB
On 18/07/2012 18:28, Ed Leafe wrote: On Jul 18, 2012, at 12:16 PM, Ethan Furman wrote: Your memory is good! I typed it in wrong. Well, I was an MVP for Visual Foxpro for 10 years, so... ;-) I see four other options: 0) don't move the pointer (listed for completeness) 1) g

Re: Foxpro goto command and deleted records

2012-07-18 Thread Ed Leafe
On Jul 18, 2012, at 12:16 PM, Ethan Furman wrote: > Your memory is good! I typed it in wrong. Well, I was an MVP for Visual Foxpro for 10 years, so... ;-) > I see four other options: > > 0) don't move the pointer (listed for completeness) > 1) go to that record anyway > 2) go

Re: Foxpro goto command and deleted records

2012-07-18 Thread Ethan Furman
Ed Leafe wrote: On Jul 17, 2012, at 5:57 PM, Ethan Furman wrote: In Foxpro if you do a GOTO 7 with deleted off and record 7 is deleted, the record pointer doesn't move (at least in version 6). I don't like that. I see four other options: 0) don't move the pointer (listed f

Re: Foxpro goto command and deleted records

2012-07-18 Thread Ed Leafe
On Jul 17, 2012, at 5:57 PM, Ethan Furman wrote: > In Foxpro if you do a > > GOTO 7 > > with deleted off and record 7 is deleted, the record pointer doesn't > move (at least in version 6). > > I don't like that. > > I see four other options: &g

Re: Foxpro goto command and deleted records

2012-07-18 Thread Grant Edwards
On 2012-07-17, Ethan Furman wrote: > In Foxpro if you do a Foxpro? -- Grant Edwards grant.b.edwardsYow! I am NOT a nut at gmail.com -- http://mail.python.org/mailman/listinfo/p

Re: Foxpro goto command and deleted records

2012-07-17 Thread Ethan Furman
MRAB wrote: On 18/07/2012 03:19, Ethan Furman wrote: MRAB wrote: On 17/07/2012 23:57, Ethan Furman wrote: In Foxpro if you do a GOTO 7 with deleted off and record 7 is deleted, the record pointer doesn't move (at least in version 6). I don't like that. I see four other options:

Re: Foxpro goto command and deleted records

2012-07-17 Thread MRAB
On 18/07/2012 03:19, Ethan Furman wrote: MRAB wrote: On 17/07/2012 23:57, Ethan Furman wrote: In Foxpro if you do a GOTO 7 with deleted off and record 7 is deleted, the record pointer doesn't move (at least in version 6). I don't like that. I see four other options: 0) don&

Re: Foxpro goto command and deleted records

2012-07-17 Thread Ethan Furman
MRAB wrote: On 17/07/2012 23:57, Ethan Furman wrote: In Foxpro if you do a GOTO 7 with deleted off and record 7 is deleted, the record pointer doesn't move (at least in version 6). I don't like that. I see four other options: 0) don't move the pointer (listed for complet

Re: Foxpro goto command and deleted records

2012-07-17 Thread Ethan Furman
Ian Kelly wrote: On Tue, Jul 17, 2012 at 4:57 PM, Ethan Furman wrote: In Foxpro if you do a GOTO 7 with deleted off and record 7 is deleted, the record pointer doesn't move (at least in version 6). I don't like that. I see four other options: 0) don't move the poin

Re: Foxpro goto command and deleted records

2012-07-17 Thread MRAB
On 17/07/2012 23:57, Ethan Furman wrote: In Foxpro if you do a GOTO 7 with deleted off and record 7 is deleted, the record pointer doesn't move (at least in version 6). I don't like that. I see four other options: 0) don't move the pointer (listed for completeness) 1) go

Re: Foxpro goto command and deleted records

2012-07-17 Thread Ian Kelly
On Tue, Jul 17, 2012 at 4:57 PM, Ethan Furman wrote: > In Foxpro if you do a > > GOTO 7 > > with deleted off and record 7 is deleted, the record pointer doesn't > move (at least in version 6). > > I don't like that. > > I see four other options: &

Foxpro goto command and deleted records

2012-07-17 Thread Ethan Furman
In Foxpro if you do a GOTO 7 with deleted off and record 7 is deleted, the record pointer doesn't move (at least in version 6). I don't like that. I see four other options: 0) don't move the pointer (listed for completeness) 1) go to that record anyway 2) go to the next und

Re: question about a command like 'goto ' in Python's bytecode orit's just a compiler optimization?

2009-06-18 Thread JanC
Hendrik van Rooyen wrote: > It is my opinion that it is not possible to make a useful machine, > virtual or real, which executes instructions sequentially, if the > instruction set does not contain a conditional jump of some sort. > > I have tried doing it using conditional calls, and it fails on

Re: question about a command like 'goto ' in Python's bytecode or it's just a compiler optimization?

2009-06-17 Thread higer
On Jun 17, 8:29 pm, John Machin wrote: > On Jun 17, 1:40 pm, higer wrote: > > > My Python version is 2.5.2; When I reading the bytecode of some pyc > > file, I always found that there are many jump command from different > > position,but to the same position. You can see this situation in > > fol

Re: question about a command like 'goto ' in Python's bytecode or it's just a compiler optimization?

2009-06-17 Thread John Machin
On Jun 17, 1:40 pm, higer wrote: > My Python version is 2.5.2; When I reading the bytecode of some pyc > file, I always found that there are many jump command from different > position,but to the same position. You can see this situation in > following code(this bytecode is just from one .pyc file

Re: question about a command like 'goto ' in Python's bytecode orit's just a compiler optimization?

2009-06-17 Thread pdpi
On Jun 17, 9:01 am, "Hendrik van Rooyen" wrote: >  "Diez B. Roggisch" wrote: > > > Getting a depression because of a compiler is a bit strong... > > > However, yes, bytecode is similar to assembler, and in that respect > > higher-level control-structures are created using (conditional) jumps. > >

Re: question about a command like 'goto ' in Python's bytecode orit's just a compiler optimization?

2009-06-17 Thread Diez B. Roggisch
higer wrote: > Hi,all: > > I'm sorry that I did not make my question clear. What I mean is that > what the souce code would look like that will be compiled to such > bytecodes. >>> import dis >>> def foo(): ... for i in xrange(10): ... if i == 5: ...break ... if i

Re: question about a command like 'goto ' in Python's bytecode orit's just a compiler optimization?

2009-06-17 Thread higer
Hi,all: I'm sorry that I did not make my question clear. What I mean is that what the souce code would look like that will be compiled to such bytecodes. Regards, higer -- http://mail.python.org/mailman/listinfo/python-list

Re: question about a command like 'goto ' in Python's bytecode orit's just a compiler optimization?

2009-06-17 Thread Hendrik van Rooyen
"Diez B. Roggisch" wrote: > Getting a depression because of a compiler is a bit strong... > > However, yes, bytecode is similar to assembler, and in that respect > higher-level control-structures are created using (conditional) jumps. > > The same is true for other bytecode-languages, see here f

Re: question about a command like 'goto ' in Python's bytecode or it's just a compiler optimization?

2009-06-16 Thread Tim Roberts
d I don't >have its source .py file): >... >From the above bytecode,we know that line 574 is the point that many >position jumps to.So,it just looks like the 'goto' function in C, but >we know that there is none such function in Python. >... >But ,the question is,

Re: question about a command like 'goto ' in Python's bytecode or it's just a compiler optimization?

2009-06-16 Thread Diez B. Roggisch
_0 COME_FROM '' 574_1 COME_FROM '' 574_2 COME_FROM '' 574_3 COME_FROM '' ... From the above bytecode,we know that line 574 is the point that many position jumps to.So,it just looks like the 'goto' function

question about a command like 'goto ' in Python's bytecode or it's just a compiler optimization?

2009-06-16 Thread higer
'' 574_1 COME_FROM '' 574_2 COME_FROM '' 574_3 COME_FROM '' ... >From the above bytecode,we know that line 574 is the point that many position jumps to.So,it just looks like the 'goto' function in C, but we know

Re: Good python equivalent to C goto

2008-08-18 Thread Matthew Fitzgibbons
Paul McGuire wrote: On Aug 17, 1:09 pm, Matthew Fitzgibbons <[EMAIL PROTECTED]> wrote: Kurien Mathew wrote: Hello, Any suggestions on a good python equivalent for the following C code: while (loopCondition) { if (condition1) goto next; if (condition2) goto next;

Re: Good python equivalent to C goto

2008-08-18 Thread Paul McGuire
On Aug 17, 1:09 pm, Matthew Fitzgibbons <[EMAIL PROTECTED]> wrote: > Kurien Mathew wrote: > > Hello, > > > Any suggestions on a good python equivalent for the following C code: > > > while (loopCondition) > > { > >     if (condition1) > >        

RE: Good python equivalent to C goto

2008-08-18 Thread Reedick, Andrew
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of Kurien Mathew > Sent: Saturday, August 16, 2008 5:21 PM > To: python-list@python.org > Subject: Good python equivalent to C goto > > Hello, > > Any suggestio

Re: Good python equivalent to C goto

2008-08-18 Thread Robin Becker
Kurien Mathew wrote: Hello, Any suggestions on a good python equivalent for the following C code: while (loopCondition) { if (condition1) goto next; if (condition2) goto next; if (condition3) goto next; stmt1; stmt2; next: stmt3; stmt4

Re: Good python equivalent to C goto

2008-08-18 Thread Chuck Rhode
d *come from* construct proposed for *fortran*? Here there be typos (abject apologies): o Clark, R. Lawrence. "A Linguistic Contribution to GOTO-less Programming." _Datamation_ Dec. 1973. 18 Aug. 2008 <http://www.fortranlib.com/gotoless.htm>. -- .. Be Seeing You, .. Chuck Rhod

Re: Good python equivalent to C goto

2008-08-17 Thread Matthew Fitzgibbons
as mentioned 'in complex code the goto statement is still the easiest to code and understand'. The examples are very small and do not require that at all. I agree it's ugly. Just to show a way to do it. A very few functions where I use goto in C or C# are a few hundred lines of

Re: Good python equivalent to C goto

2008-08-17 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: The goto code is the simpler way to do it. We are not talking about simple if-else, but let say 20 if-else. Many nested if-else are more difficult to understand and do not fit better the semantics. let's see... $ cd ~/svn/python25 $ grep goto */*.c | wc

Re: Good python equivalent to C goto

2008-08-17 Thread info
ython equivalent for the following C code: > >>> while (loopCondition) > >>> { > >>>     if (condition1) > >>>         goto next; > >>>     if (condition2) > >>>         goto next; > >>>     if (condition3) &

Re: Good python equivalent to C goto

2008-08-17 Thread Paul Hankin
On Aug 16, 11:20 pm, Kurien Mathew <[EMAIL PROTECTED]> wrote: > Hello, > > Any suggestions on a good python equivalent for the following C code: > > while (loopCondition) > { >         if (condition1) >                 goto next; >         if (condition2) >    

Re: Good python equivalent to C goto

2008-08-17 Thread Matthew Fitzgibbons
[EMAIL PROTECTED] wrote: On Aug 17, 8:09 pm, Matthew Fitzgibbons <[EMAIL PROTECTED]> wrote: Kurien Mathew wrote: Hello, Any suggestions on a good python equivalent for the following C code: while (loopCondition) { if (condition1) goto next; if (condition2) got

Re: Good python equivalent to C goto

2008-08-17 Thread info
On Aug 17, 8:09 pm, Matthew Fitzgibbons <[EMAIL PROTECTED]> wrote: > Kurien Mathew wrote: > > Hello, > > > Any suggestions on a good python equivalent for the following C code: > > > while (loopCondition) > > { > >     if (condition1) > >        

Re: Good python equivalent to C goto

2008-08-17 Thread Matthew Fitzgibbons
Kurien Mathew wrote: Hello, Any suggestions on a good python equivalent for the following C code: while (loopCondition) { if (condition1) goto next; if (condition2) goto next; if (condition3) goto next; stmt1; stmt2; next: stmt3; stmt4

Re: Good python equivalent to C goto

2008-08-17 Thread Grant Edwards
ing C code: >> >> while (loopCondition) >> { >> if (condition1) >> goto next; >> if (condition2) >> goto next; >> if (condition3) >> goto next; >> stmt1; >> stmt2; >> next: >> stmt3; >>

Re: Good python equivalent to C goto

2008-08-17 Thread Marc 'BlackJack' Rintsch
On Sat, 16 Aug 2008 23:20:52 +0200, Kurien Mathew wrote: > Any suggestions on a good python equivalent for the following C code: > > while (loopCondition) > { > if (condition1) > goto next; > if (condition2) > goto next

Re: Good python equivalent to C goto

2008-08-17 Thread info
as an oldtimer, I know that in complex code the goto statement is still the easiest to code and understand. I propose this solution using exception. The string exception is deprecated but is simpler for this example. # DeprecationWarning: raising a string exception is deprecated def

Re: Good python equivalent to C goto

2008-08-16 Thread Carl Banks
On Aug 17, 12:35 am, Michael Torrie <[EMAIL PROTECTED]> wrote: > However it's not necessary in python to do any of this, since you can > define nested functions that have access to the parent scope.  Anytime > you need to clean up, just call the nested cleanup function and then return. That is unn

Re: Good python equivalent to C goto

2008-08-16 Thread Michael Torrie
Michael Torrie wrote: > I think the most direct translation would be this: Nevermind I forgot about the while loop and continuing on after it. Guess the function doesn't quite fit this use case after all. -- http://mail.python.org/mailman/listinfo/python-list

Re: Good python equivalent to C goto

2008-08-16 Thread Michael Torrie
Kurien Mathew wrote: > Hello, > > Any suggestions on a good python equivalent for the following C code: > > while (loopCondition) > { > if (condition1) > goto next; > if (condition2) > goto next; > if (cond

Re: Good python equivalent to C goto

2008-08-16 Thread Michael Torrie
Dennis Lee Bieber wrote: > Nasty code even for C... I've never used goto in C... Options: > convert the statements of next into a function, and put in an else > clause... I think the parent post's pseudocode example was too simple to show the real benefits and use

Re: Good python equivalent to C goto

2008-08-16 Thread Christian Heimes
Kurien Mathew wrote: Hello, Any suggestions on a good python equivalent for the following C code: There are various ways to write your example in Python. For example while loopCondition: condition = 1 while condition: if condition1: break if condition2:

Re: Good python equivalent to C goto

2008-08-16 Thread Thomas Mlynarczyk
Kurien Mathew schrieb: Any suggestions on a good python equivalent for the following C code: while (loopCondition) { if (condition1) goto next; if (condition2) goto next; if (condition3) goto next; stmt1; stmt2; next: stmt3; stmt4; } while

Re: Good python equivalent to C goto

2008-08-16 Thread Fredrik Lundh
Kurien Mathew wrote: Any suggestions on a good python equivalent for the following C code: while (loopCondition) { if (condition1) goto next; if (condition2) goto next; if (condition3) goto next; stmt1; stmt2; next: stmt3; stmt4; } seems

Re: Good python equivalent to C goto

2008-08-16 Thread Jean-Paul Calderone
On Sat, 16 Aug 2008 23:20:52 +0200, Kurien Mathew <[EMAIL PROTECTED]> wrote: Hello, Any suggestions on a good python equivalent for the following C code: while (loopCondition) { if (condition1) goto next; if (condition2) goto next;

Good python equivalent to C goto

2008-08-16 Thread Kurien Mathew
Hello, Any suggestions on a good python equivalent for the following C code: while (loopCondition) { if (condition1) goto next; if (condition2) goto next; if (condition3) goto next; stmt1; stmt2; next

Re: Goto

2007-06-17 Thread Neil Cerutti
On 2007-06-17, Tina I <[EMAIL PROTECTED]> wrote: > Back then I took a course in structured BASIC programming (now > there is a contradiction in terms) and the instructor warned > about goto time and time again. But his biggest mistake was to > tell us that if we had to use goto

Re: Goto

2007-06-17 Thread John Machin
On Jun 14, 4:32 pm, "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: [snip] > > Anything more fancy is "Verboten" - except, that, if you ask nicely, > John Machin might explain his comefrom construct. > > And maybe I will understand it this time around... Hendrik, if you google for 'comefrom' in th

Re: Goto

2007-06-17 Thread Tina I
Daniel Nogradi wrote: >> How does one effect a goto in python? I only want to use it for debug. >> I dasn't slap an "if" clause around the portion to dummy out, the >> indentation police will nab me. > > > http://entrian.com/goto/ LOL!! * major fla

Re: Goto

2007-06-14 Thread Hendrik van Rooyen
"HMS Surprise" <[EMAIL PROTECTED]> wrote: > > How does one effect a goto in python? I only want to use it for debug. > I dasn't slap an "if" clause around the portion to dummy out, the > indentation police will nab me. I use a global boolean called

Re: Goto

2007-06-13 Thread HMS Surprise
Thanks folks! jh -- http://mail.python.org/mailman/listinfo/python-list

Re: Goto

2007-06-13 Thread Carsten Haese
On Wed, 2007-06-13 at 12:20 -0700, HMS Surprise wrote: > How does one effect a goto in python? One doesn't. > I only want to use it for debug. > I dasn't slap an "if" clause around the portion to dummy out, the > indentation police will nab me. If you want

Re: Goto

2007-06-13 Thread Daniel Nogradi
> How does one effect a goto in python? I only want to use it for debug. > I dasn't slap an "if" clause around the portion to dummy out, the > indentation police will nab me. http://entrian.com/goto/ -- http://mail.python.org/mailman/listinfo/python-list

Goto

2007-06-13 Thread HMS Surprise
How does one effect a goto in python? I only want to use it for debug. I dasn't slap an "if" clause around the portion to dummy out, the indentation police will nab me. Thanx, jh -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] no goto (WAS: Python code written in 1998...)

2006-01-20 Thread Hans Georg Krauthaeuser
Steven Bethard schrieb: > Carl Cerecke wrote: > >> Python has no goto. > > > Not in the standard library. You have to download the module: > http://www.entrian.com/goto/ > > ;) > > STeVe This remerbers me to VATICAL, a famous programming language fro

Re: [OT] no goto (WAS: Python code written in 1998...)

2006-01-19 Thread Carl Cerecke
Steven Bethard wrote: > Carl Cerecke wrote: > >> Python has no goto. > > > Not in the standard library. You have to download the module: > http://www.entrian.com/goto/ Haha! Sure. But have you seen how it's implemented? I don't think it will win many pe

Goto in python - NO! (was Re: Python code written in 1998, how to improve/change it?)

2006-01-19 Thread Carl Cerecke
Dave Hansen wrote: > On Fri, 20 Jan 2006 10:27:58 +1300 in comp.lang.python, Carl Cerecke > <[EMAIL PROTECTED]> wrote: > > [...] > >>Python has no goto. > > > +1 > > [...] > >>We want a goto. > > > -1 I agree entirely. My

[OT] no goto (WAS: Python code written in 1998...)

2006-01-19 Thread Steven Bethard
Carl Cerecke wrote: > Python has no goto. Not in the standard library. You have to download the module: http://www.entrian.com/goto/ ;) STeVe -- http://mail.python.org/mailman/listinfo/python-list

Re: Goto XY

2005-11-09 Thread Richie Hindle
[ale.of.ginger] > WConio.gotoxy(10,10) > error: GetConOut Failed Are you running at a Windows Command Prompt, or in an IDE? As I understand it, WConio will only work in a Windows Command Prompt. -- Richie Hindle [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Goto XY

2005-11-09 Thread ale . of . ginger
OK - I added the import WConio line. But when I run import WConio print "going to x10,y10..." WConio.gotoxy(10,10) print "Done" the above, I get the following error: WConio.gotoxy(10,10) error: GetConOut Failed I installed the WConio to the ../site-packages/ folder in Python24, and when it did

Re: Goto XY

2005-11-08 Thread Chris F.A. Johnson
On 2005-11-09, Grant Edwards wrote: > On 2005-11-09, Chris F.A. Johnson <[EMAIL PROTECTED]> wrote: >> >>> Is there some command in python so that I can read a key's input and >>> then use a gotoxy() function to move the cursor on screen? e.g.: >>> (psuedo-code) >> >> You can use curses, but that m

Re: Goto XY

2005-11-08 Thread Chris F.A. Johnson
On 2005-11-09, Jean-Paul Calderone wrote: > On Tue, 8 Nov 2005 22:33:47 -0500, "Chris F.A. Johnson" <[EMAIL PROTECTED]> > wrote: >> [snip] >> >> To read a single keystroke, see Claudio Grondi's post in the >> thread "python without OO" from last January. >> >> Function and cursor keys

Re: Goto XY

2005-11-08 Thread Grant Edwards
On 2005-11-09, Chris F.A. Johnson <[EMAIL PROTECTED]> wrote: > >> Is there some command in python so that I can read a key's input and >> then use a gotoxy() function to move the cursor on screen? e.g.: >> (psuedo-code) > > You can use curses, but that may be more trouble than it's worth. In whic

Re: Goto XY

2005-11-08 Thread Jean-Paul Calderone
On Tue, 8 Nov 2005 22:33:47 -0500, "Chris F.A. Johnson" <[EMAIL PROTECTED]> wrote: > [snip] > > To read a single keystroke, see Claudio Grondi's post in the > thread "python without OO" from last January. > > Function and cursor keys return more than a single character, so > more w

Re: Goto XY

2005-11-08 Thread Chris F.A. Johnson
On 2005-11-09, [EMAIL PROTECTED] wrote: > Is there some command in python so that I can read a key's input and > then use a gotoxy() function to move the cursor on screen? e.g.: > (psuedo-code) You can use curses, but that may be more trouble than it's worth. If you don't mind limiting y

Re: Goto XY

2005-11-08 Thread jmdeschamps
Like David said above... ;-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Goto XY

2005-11-08 Thread jmdeschamps
Like David said below, you need to import WConio but then repemeber when you *import someLib* you have to use qualified names such as WConio.getkey() Example: import WConio s=WConio.getkey() if s == "right": WConio.gotoxy(10,10) WConio.putch("W") s=WConio.getch() -- http://mail.pytho

Re: Goto XY

2005-11-08 Thread David Wahler
[EMAIL PROTECTED] wrote: > I assume I have to use a header somewhere (import WConio ?). If you had tried it, you would have discovered that "import WConio" is exactly what you need. Don't be afraid to experiment! -- David -- http://mail.python.org/mailman/listinfo/python-list

Re: Goto XY

2005-11-08 Thread ale . of . ginger
Thanks -- I downloaded WConio. When I just tried it out in the IDLE, it said: NameError: name 'WConio' is not defined I assume I have to use a header somewhere (import WConio ?). Or is there something I'm missing (I downloaded the Python 2.4 (I have 2.4.2) auto installer and it ran fine...) --

Re: Goto XY

2005-11-08 Thread jmdeschamps
WConio does this for Windows. See... getkey() and gotoxy() http://newcenturycomputers.net/projects/wconio.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Goto XY

2005-11-08 Thread Mike Meyer
[EMAIL PROTECTED] writes: > Is there some command in python so that I can read a key's input and > then use a gotoxy() function to move the cursor on screen? e.g.: > (psuedo-code) > > When the right arrow is pushed, cursor gotoxy(x+1,y) You want curses. A version is included in the standard libr

Re: Goto XY

2005-11-08 Thread David Wahler
[EMAIL PROTECTED] wrote: > Is there some command in python so that I can read a key's input and > then use a gotoxy() function to move the cursor on screen? e.g.: > (psuedo-code) > > When the right arrow is pushed, cursor gotoxy(x+1,y) > > Thanks. On Unix-like platforms, this functionality is pr

Re: Goto XY

2005-11-08 Thread Jean-Paul Calderone
On 8 Nov 2005 17:27:24 -0800, [EMAIL PROTECTED] wrote: >Is there some command in python so that I can read a key's input and >then use a gotoxy() function to move the cursor on screen? e.g.: >(psuedo-code) > >When the right arrow is pushed, cursor gotoxy(x+1,y) > You can uses curses for this, on

Goto XY

2005-11-08 Thread ale . of . ginger
Is there some command in python so that I can read a key's input and then use a gotoxy() function to move the cursor on screen? e.g.: (psuedo-code) When the right arrow is pushed, cursor gotoxy(x+1,y) Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: goto

2005-07-22 Thread Mike Meyer
Rocco Moretti <[EMAIL PROTECTED]> writes: >> My "favorite" infinte loop with while is: >>i = 0 >>while i < 20: >> do_process(i) >> Note the prominent *lack* of any change to i here? >> Oh, for: >> from i = 0 >> invariant 0 <= i <= 20 >> variant 21 - i >> until i >

Re: goto

2005-07-21 Thread Michael Hudson
[EMAIL PROTECTED] writes: > >>> what is the equivalent of C languages' goto statement in python? > > >> You really shouldn't use goto. > >> Fortunately you can't. > > Steven> Of course you can :-) > > Steven&g

Re: goto

2005-07-21 Thread Rocco Moretti
> My "favorite" infinte loop with while is: > >i = 0 >while i < 20: > do_process(i) > > Note the prominent *lack* of any change to i here? > > Oh, for: > > from i = 0 > invariant 0 <= i <= 20 > variant 21 - i > until i > 19 > loop > do_process(i) >

Re: goto

2005-07-20 Thread Mike Meyer
Peter Hansen <[EMAIL PROTECTED]> writes: > Sybren Stuvel wrote: >> Mike Meyer enlightened us with: >> >>>>I dislike gotos because it is too easy to inadvertently create >>>>infinite loops. <10 WINK; 20 GOTO 10> >>> >>>And it

Re: goto

2005-07-20 Thread Peter Hansen
Sybren Stuvel wrote: > Mike Meyer enlightened us with: > >>>I dislike gotos because it is too easy to inadvertently create >>>infinite loops. <10 WINK; 20 GOTO 10> >> >>And it's impossible without them? > > > I thought the same

Re: goto

2005-07-20 Thread Sybren Stuvel
Mike Meyer enlightened us with: >> I dislike gotos because it is too easy to inadvertently create >> infinite loops. <10 WINK; 20 GOTO 10> > > And it's impossible without them? I thought the same thing, but then I read it again and thought about the "inadverte

Re: goto

2005-07-19 Thread Mike Meyer
Rocco Moretti <[EMAIL PROTECTED]> writes: > Leif K-Brooks wrote: >> rbt wrote: >> >>>IMO, most of the people who deride goto do so because they heard or read >>> where someone else did. >> 1 GOTO 17 >> 2 mean,GOTO 5 >> 3

Re: goto

2005-07-19 Thread Terry Hancock
On Monday 18 July 2005 06:48 am, Hayri ERDENER wrote: > hi, > what is the equivalent of C languages' goto statement in python? > best regards For the only valid uses of C's "goto", you should use the "try-except" or the "for/while-break-else" idi

Re: goto

2005-07-19 Thread Fernando Perez
Steven Bethard wrote: > Fernando Perez wrote: >> Steven Bethard wrote: >> >>>Download the goto module: >>> http://www.entrian.com/goto/ >>>And you can use goto to your heart's content. And to the horror of all >>>your friends/cowork

Re: goto

2005-07-19 Thread rbt
(http://tinyurl.com/dnazs) is also in favor > >> of goto. > >> > >> Coming next from rbt: "Pointer arithmetic in python ?". > >> > >> George > >> > >> > > > > I have moments of brilliance and moments of ign

Re: goto

2005-07-19 Thread Steven D'Aprano
On Tue, 19 Jul 2005 11:29:58 -0400, rbt wrote: >> It should not really come as a shock that the same fellow who came up with a >> brilliant efficient way >> to generate all permutations (http://tinyurl.com/dnazs) is also in favor of >> goto. >> >> Coming n

Re: goto

2005-07-19 Thread rbt
On Tue, 2005-07-19 at 10:02 -0400, George Sakkis wrote: > "rbt" <[EMAIL PROTECTED]> wrote: > > > On Mon, 2005-07-18 at 12:27 -0600, Steven Bethard wrote: > > > Hayri ERDENER wrote: > > > > what is the equivalent of C languages' goto sta

Re: goto

2005-07-19 Thread George Sakkis
"rbt" <[EMAIL PROTECTED]> wrote: > On Mon, 2005-07-18 at 12:27 -0600, Steven Bethard wrote: > > Hayri ERDENER wrote: > > > what is the equivalent of C languages' goto statement in python? > > > > Download the goto module: > > http

Re: goto

2005-07-19 Thread Rocco Moretti
Leif K-Brooks wrote: > rbt wrote: > >>IMO, most of the people who deride goto do so because they heard or read >>where someone else did. > > > 1 GOTO 17 > 2 mean, GOTO 5 > 3 couldGOTO 6 > 4 with GOTO 7 > 5 what GO

Re: goto

2005-07-19 Thread Steven D'Aprano
On Tue, 19 Jul 2005 02:33:02 +, Leif K-Brooks wrote: > rbt wrote: >> IMO, most of the people who deride goto do so because they heard or read >> where someone else did. > > 1 GOTO 17 > 2 mean,GOTO 5 > 3 couldGOTO 6 [snip] That's great,

Re: goto

2005-07-19 Thread Robert Kern
rbt wrote: > IMO, most of the people who deride goto do so because they heard or read > where someone else did. Or perhaps, like me, they have had to maintain FORTRAN code written by a scientist who apparently hadn't heard of subroutines. "Spaghetti" doesn't quite de

Re: goto

2005-07-19 Thread Sybren Stuvel
rbt enlightened us with: > Many of the world's most profitable software companies (MS for > example) have thousands of goto statements in their code... oh the > horror of it all. Why aren't these enlightened-by-the-gods > know-it-alls as profitable as these obviously ign

Re: goto

2005-07-18 Thread Steven Bethard
Fernando Perez wrote: > Steven Bethard wrote: > >>Download the goto module: >> http://www.entrian.com/goto/ >>And you can use goto to your heart's content. And to the horror of all >>your friends/coworkers. ;) > > That is actually a _really_ cool p

Re: goto

2005-07-18 Thread rbt
10 PRINT "YOU'RE NOT RIGHT IN THE HEAD." 20 GOTO 10 On Tue, 2005-07-19 at 02:33 +, Leif K-Brooks wrote: > rbt wrote: > > IMO, most of the people who deride goto do so because they heard or read > > where someone else did. > > 1 GOTO 17 > 2 mean,

Re: goto

2005-07-18 Thread Leif K-Brooks
rbt wrote: > IMO, most of the people who deride goto do so because they heard or read > where someone else did. 1 GOTO 17 2 mean, GOTO 5 3 could GOTO 6 4 with GOTO 7 5 what GOTO 3 6 possibly GOTO 24 7 you! GOTO 21 8 that GOTO 18 9

Re: goto

2005-07-18 Thread D H
Mike Meyer wrote: > rbt <[EMAIL PROTECTED]> writes: > >>Many of the world's most profitable software companies (MS for example) >>have thousands of goto statements in their code... oh the horror of it >>all. Why aren't these enlightened-by-the-gods know-it

Re: goto

2005-07-18 Thread Fernando Perez
Steven Bethard wrote: > Hayri ERDENER wrote: >> what is the equivalent of C languages' goto statement in python? > > Download the goto module: > http://www.entrian.com/goto/ > And you can use goto to your heart's content. And to the horror of all > you

Re: goto

2005-07-18 Thread Mike Meyer
rbt <[EMAIL PROTECTED]> writes: > Many of the world's most profitable software companies (MS for example) > have thousands of goto statements in their code... oh the horror of it > all. Why aren't these enlightened-by-the-gods know-it-alls as profitable > as these

Re: goto

2005-07-18 Thread Steven D'Aprano
On Mon, 18 Jul 2005 16:37:57 -0400, rbt wrote: > Shouldn't that be "to the horror of all your goto-snob friends." > > IMO, most of the people who deride goto do so because they heard or read > where someone else did. Or because they actually programmed in langua

Re: goto

2005-07-18 Thread Steven Bethard
rbt wrote: > Steven Bethard wrote: > >>Download the goto module: >> http://www.entrian.com/goto/ >>And you can use goto to your heart's content. And to the horror of all >>your friends/coworkers. ;) > > Shouldn't that be "to the horror of

<    1   2   3   4   5   >