Re: goto statement

2005-04-21 Thread Sergei Organov
Grant Edwards [EMAIL PROTECTED] writes: On 2005-04-21, Sergei Organov [EMAIL PROTECTED] wrote: Well, I'm writing for embedded realtime systems in C/C++ and have never encountered a single need to use goto. I have encountered situations in C programs where the best thing to use was a

Re: goto statement

2005-04-21 Thread Grant Edwards
On 2005-04-21, Sergei Organov [EMAIL PROTECTED] wrote: Grant Edwards [EMAIL PROTECTED] writes: On 2005-04-21, Sergei Organov [EMAIL PROTECTED] wrote: Well, I'm writing for embedded realtime systems in C/C++ and have never encountered a single need to use goto. I have encountered

Re: goto statement

2005-04-21 Thread Sergei Organov
Grant Edwards [EMAIL PROTECTED] writes: On 2005-04-21, Sergei Organov [EMAIL PROTECTED] wrote: Grant Edwards [EMAIL PROTECTED] writes: On 2005-04-21, Sergei Organov [EMAIL PROTECTED] wrote: Well, I'm writing for embedded realtime systems in C/C++ and have never encountered a

Re: goto statement

2005-04-21 Thread Peter Maas
Maxim Kasimov schrieb: but what if i just can't to do this becouse i'm working thrue ssh, and have to use only installed editors (such as vi) - at first line of block enter: ma (mark line as 'a') - go to last line of block - enter :'a,.s/^/###/ (insert 3 comment chars at begin of line, starting

Re: goto statement

2005-04-21 Thread Grant Edwards
On 2005-04-21, Sergei Organov [EMAIL PROTECTED] wrote: Well, I'm writing for embedded realtime systems in C/C++ and have never encountered a single need to use goto. I have encountered situations in C programs where the best thing to use was a goto. Those situations have always been

Re: goto statement

2005-04-21 Thread Grant Edwards
On 2005-04-21, Peter Maas [EMAIL PROTECTED] wrote: Maxim Kasimov schrieb: but what if i just can't to do this becouse i'm working thrue ssh, and have to use only installed editors (such as vi) - at first line of block enter: ma (mark line as 'a') - go to last line of block - enter

Re: goto statement

2005-04-21 Thread Roy Smith
Grant Edwards [EMAIL PROTECTED] wrote: Sure, but what about the case where his program is on paper tape and all he has for an editor is an ice pick? Can't you emulate that in emacs with M-X inclusive-or-overwrite-mode? -- http://mail.python.org/mailman/listinfo/python-list

Re: goto statement

2005-04-21 Thread Sergei Organov
Grant Edwards [EMAIL PROTECTED] writes: On 2005-04-21, Peter Maas [EMAIL PROTECTED] wrote: Maxim Kasimov schrieb: but what if i just can't to do this becouse i'm working thrue ssh, and have to use only installed editors (such as vi) - at first line of block enter: ma (mark line as

Re: goto statement

2005-04-21 Thread pythonUser_07
Hi, Have you tried the triple quote comment technique? I am assuming you want to skip some code for the time being. Here is an example print hello world ''' COMMENT OUT FOR NOW someFunction() someOtherFunction() ''' print goodbye world This means that you have only two locations to remove the

Re: goto statement

2005-04-21 Thread Maxim Kasimov
pythonUser_07 wrote: Hi, Have you tried the triple quote comment technique? I am assuming you want to skip some code for the time being. Here is an example print hello world ''' COMMENT OUT FOR NOW someFunction() someOtherFunction() ''' print goodbye world This means that you have only two

Re: goto statement

2005-04-21 Thread Fredrik Lundh
Maxim Kasimov wrote: how do use this here: are you still claiming you're not a troll? *plonk* /F -- http://mail.python.org/mailman/listinfo/python-list

Re: goto statement

2005-04-21 Thread Mage
Maxim Kasimov wrote: how do use this here: print hello world There are cases when you can't do it in any language. php: /* this is a debug comment function1(); function2(); /* this is a normal multiline comment block it ends here */ function3(); */ end of debug comment / if

Re: goto statement

2005-04-21 Thread R. C. James Harlow
On Thursday 21 April 2005 17:42, Maxim Kasimov wrote: Have you tried the triple quote comment technique? how do use this here: Simple. sql = ''' some long query ''' Change this to: sql = some long query since you shouldn't be using multiple quoting styles in one module, any more

Re: goto statement

2005-04-21 Thread Grant Edwards
On 2005-04-21, Roy Smith [EMAIL PROTECTED] wrote: Grant Edwards [EMAIL PROTECTED] wrote: Sure, but what about the case where his program is on paper tape and all he has for an editor is an ice pick? Can't you emulate that in emacs with M-X inclusive-or-overwrite-mode? Heck, emacs probably has

Re: goto statement

2005-04-21 Thread Grant Edwards
On 2005-04-21, Sergei Organov [EMAIL PROTECTED] wrote: Grant Edwards [EMAIL PROTECTED] writes: On 2005-04-21, Peter Maas [EMAIL PROTECTED] wrote: Maxim Kasimov schrieb: but what if i just can't to do this becouse i'm working thrue ssh, and have to use only installed editors (such as vi)

Re: goto statement

2005-04-21 Thread Ivan Van Laningham
Hi All-- Fredrik Lundh wrote: Maxim Kasimov wrote: how do use this here: are you still claiming you're not a troll? *plonk* Oh, I don't think he's a troll, but his license to use Python should be revoked. I think RPG would be a good language for him, don't you? Metta, Ivan

Re: goto statement

2005-04-21 Thread Ron
Grant Edwards wrote: On 2005-04-21, Sergei Organov [EMAIL PROTECTED] wrote: Well, I'm writing for embedded realtime systems in C/C++ and have never encountered a single need to use goto. I have encountered situations in C programs where the best thing to use was a goto. Those situations have

Re: goto statement

2005-04-21 Thread John Roth
praba kar [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Dear All, In Python what is equivalent to goto statement Sheesh! It took 20 days for this to get to my mail server! John Roth regards, praba -- http://mail.python.org/mailman/listinfo/python-list

Re: goto statement

2005-04-20 Thread Mage
praba kar wrote: Dear All, In Python what is equivalent to goto statement You shouldn't use goto in high-level languages. Mage -- http://mail.python.org/mailman/listinfo/python-list

Re: goto statement

2005-04-20 Thread Simon Brunning
On 4/20/05, praba kar [EMAIL PROTECTED] wrote: In Python what is equivalent to goto statement http://docs.python.org/tut/node6.html See, it's those dratted node numbers again. ;-) -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ --

Re: goto statement

2005-04-20 Thread Maurice Caret
Simon Brunning a écrit : On 4/20/05, praba kar [EMAIL PROTECTED] wrote: In Python what is equivalent to goto statement http://docs.python.org/tut/node6.html See, it's those dratted node numbers again. ;-) other equivalents are in http://docs.python.org/tut/node10.html --

Re: goto statement

2005-04-20 Thread Simon Brunning
On 4/20/05, Maurice Caret [EMAIL PROTECTED] wrote: other equivalents are in http://docs.python.org/tut/node10.html I also missed http://docs.python.org/tut/node5.html#SECTION00520, for the while statement. Those URLs just keeg getting better... -- Cheers, Simon B, [EMAIL

Re: goto statement

2005-04-20 Thread Maxim Kasimov
Mage wrote: praba kar wrote: Dear All, In Python what is equivalent to goto statement You shouldn't use goto in high-level languages. it would be quite useful for debuging porposes -- Best regards, Maxim Kasimov mailto: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: goto statement

2005-04-20 Thread Simon Brunning
On 4/20/05, Maxim Kasimov [EMAIL PROTECTED] wrote: it would be quite useful for debuging porposes How does goto help you to remove bugs? I can certainly see how it helps you put them in in the first place... -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ --

Re: goto statement

2005-04-20 Thread John Bokma
Mage wrote: praba kar wrote: Dear All, In Python what is equivalent to goto statement You shouldn't use goto in high-level languages. Nonsense -- John MexIT: http://johnbokma.com/mexit/ personal page:

Re: goto statement

2005-04-20 Thread Reinhold Birkenfeld
John Bokma wrote: Mage wrote: praba kar wrote: Dear All, In Python what is equivalent to goto statement You shouldn't use goto in high-level languages. Nonsense Thank you! Above all your claim is well justified. These brilliant arguments you have put forth really explain in a

Re: goto statement

2005-04-20 Thread Maxim Kasimov
Simon Brunning wrote: On 4/20/05, Maxim Kasimov [EMAIL PROTECTED] wrote: it would be quite useful for debuging porposes How does goto help you to remove bugs? I can certainly see how it helps you put them in in the first place... if you need to comment a couple of code (and then uncomment ), what

Re: goto statement

2005-04-20 Thread Robert Kern
Maxim Kasimov wrote: Simon Brunning wrote: On 4/20/05, Maxim Kasimov [EMAIL PROTECTED] wrote: it would be quite useful for debuging porposes How does goto help you to remove bugs? I can certainly see how it helps you put them in in the first place... if you need to comment a couple of code (and

Re: goto statement

2005-04-20 Thread Maxim Kasimov
Robert Kern wrote: Maxim Kasimov wrote: Simon Brunning wrote: On 4/20/05, Maxim Kasimov [EMAIL PROTECTED] wrote: it would be quite useful for debuging porposes How does goto help you to remove bugs? I can certainly see how it helps you put them in in the first place... if you need to comment a

Re: goto statement

2005-04-20 Thread Reinhold Birkenfeld
Maxim Kasimov wrote: Robert Kern wrote: Maxim Kasimov wrote: Simon Brunning wrote: On 4/20/05, Maxim Kasimov [EMAIL PROTECTED] wrote: it would be quite useful for debuging porposes How does goto help you to remove bugs? I can certainly see how it helps you put them in in the first

Re: goto statement

2005-04-20 Thread Mage
Maxim Kasimov wrote: WOW, just greate! ... but i'd like to relax at some more interesting way than to comment each of rows There are editors that can comment and uncomment blocks. In worst case you can use to comment blocks (not elegant but works). Mage --

RE: goto statement

2005-04-20 Thread Sander Steffann
On 4/20/05, praba kar [EMAIL PROTECTED] wrote: In Python what is equivalent to goto statement An old user-friendly cartoon that might be relevant: http://ars.userfriendly.org/cartoons/?id=2506 Have fun :-) Sander -- http://mail.python.org/mailman/listinfo/python-list

Re: goto statement

2005-04-20 Thread Simon Brunning
On 4/20/05, Maxim Kasimov [EMAIL PROTECTED] wrote: WOW, just greate! ... but i'd like to relax at some more interesting way than to comment each of rows Get a decent text editor. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ --

Re: goto statement

2005-04-20 Thread Do Re Mi chel La Si Do
+1 Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: goto statement

2005-04-20 Thread Torsten Bronger
Hallchen! Maxim Kasimov [EMAIL PROTECTED] writes: [...] WOW, just greate! ... but i'd like to relax at some more interesting way than to comment each of rows Then just use a good editor. Tsch, Torsten. -- Torsten Bronger, aquisgrana, europa vetus --

Re: goto statement

2005-04-20 Thread Michael Hoffman
praba kar wrote: In Python what is equivalent to goto statement http://groups-beta.google.com/group/comp.lang.python/msg/98264a0daa007c46 -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: goto statement

2005-04-20 Thread Maxim Kasimov
Use multi-line string literals. ''' it will not help if there is another ''' or/and inside of code block This whole 'code' is commented out, and you can use every type of quote except three singles. ''' Or, if you really like the spirit of goto, use if 0:. ... and add tabs to each string Reinhold

Re: goto statement

2005-04-20 Thread Maxim Kasimov
Torsten Bronger wrote: Hallchen! Maxim Kasimov [EMAIL PROTECTED] writes: [...] WOW, just greate! ... but i'd like to relax at some more interesting way than to comment each of rows but what if i just can't to do this becouse i'm working thrue ssh, and have to use only installed editors (such as

Re: goto statement

2005-04-20 Thread Simon Brunning
On 4/20/05, Maxim Kasimov [EMAIL PROTECTED] wrote: Or, if you really like the spirit of goto, use if 0:. ... and add tabs to each string Get a decent text editor. What are you using? Notepad? -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ --

Re: goto statement

2005-04-20 Thread Peter Hansen
Maxim Kasimov wrote: Torsten Bronger wrote: Hallchen! Maxim Kasimov [EMAIL PROTECTED] writes: WOW, just greate! ... but i'd like to relax at some more interesting way than to comment each of rows but what if i just can't to do this becouse i'm working thrue ssh, and have to use only installed

Re: goto statement

2005-04-20 Thread Maxim Kasimov
Peter Hansen wrote: Maxim Kasimov wrote: Torsten Bronger wrote: Hallchen! Maxim Kasimov [EMAIL PROTECTED] writes: WOW, just greate! ... but i'd like to relax at some more interesting way than to comment each of rows but what if i just can't to do this becouse i'm working thrue ssh, and have to

Re: goto statement

2005-04-20 Thread Reinhold Birkenfeld
Maxim Kasimov wrote: Use multi-line string literals. ''' it will not help if there is another ''' or/and inside of code block Yes, but how often do you use them? And aren't you consistent in the choice of your quotes? This whole 'code' is commented out, and you can use every type of

Re: goto statement

2005-04-20 Thread Reinhold Birkenfeld
Maxim Kasimov wrote: f..., i don't requesting that goto was available in next versions of python, but i'm saying if it will be so, it will be easy and quickly _debug_ some skripts, _not only_ for commenting If you want, you can always use the goto module. Reinhold, no, I will

Re: goto statement

2005-04-20 Thread TZOTZIOY
On Wed, 20 Apr 2005 14:58:35 +0300, rumours say that Maxim Kasimov [EMAIL PROTECTED] might have written: if you need to comment a couple of code (and then uncomment ), what are you doing then? Use comments? WOW, just greate! ... but i'd like to relax at some more interesting way than to

Re: goto statement

2005-04-20 Thread TZOTZIOY
On Wed, 20 Apr 2005 16:13:32 +0300, rumours say that Maxim Kasimov [EMAIL PROTECTED] might have written: but what if i just can't to do this becouse i'm working thrue ssh, and have to use only installed editors (such as vi) If you use plain vi (not vim) and you want to comment e.g. 5 lines of

Re: goto statement

2005-04-20 Thread Simon Brunning
On 4/20/05, Christos TZOTZIOY Georgiou [EMAIL PROTECTED] wrote: If you need more help, I would gladly send you the output of `man vi' from a non-GNU Unix. I can also send you the output of `man vim' from a GNU system. It'll probably be easier to convince Guido to introduce a 'goto' statement

Re: goto statement

2005-04-20 Thread Maxim Kasimov
Christos TZOTZIOY Georgiou wrote: On Wed, 20 Apr 2005 16:13:32 +0300, rumours say that Maxim Kasimov [EMAIL PROTECTED] might have written: but what if i just can't to do this becouse i'm working thrue ssh, and have to use only installed editors (such as vi) If you use plain vi (not vim) and you

Re: goto statement

2005-04-20 Thread Maxim Kasimov
by the way, goto statement will be useful for writing more powerful obfuscators -- Best regards, Maxim Kasimov mailto: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: goto statement

2005-04-20 Thread Peter Hansen
Maxim Kasimov wrote: f..., i don't requesting that goto was available in next versions of python, but i'm saying if it will be so, it will be easy and quickly _debug_ some skripts, _not only_ for commenting Then we go right back to Simon Brunning's question for you: How does goto help you

Re: goto statement

2005-04-20 Thread Peter Hansen
praba kar wrote: In Python what is equivalent to goto statement The group has been remiss, starting mainly with Mage's unfortunately dogmatic response. What we meant to ask was this: why do you want it? There are better, simpler, cleaner, more readable ways to accomplish what you are trying to

Re: goto statement

2005-04-20 Thread TZOTZIOY
On Wed, 20 Apr 2005 18:38:40 +0300, rumours say that Maxim Kasimov [EMAIL PROTECTED] might have written: If you need more help, I would gladly send you the output of `man vi' from a non-GNU Unix. I can also send you the output of `man vim' from a GNU system. is it wrong to debug python

Re: goto statement

2005-04-20 Thread TZOTZIOY
On Wed, 20 Apr 2005 18:47:37 +0300, rumours say that Maxim Kasimov [EMAIL PROTECTED] might have written: by the way, goto statement will be useful for writing more powerful obfuscators At this point in time you might want to reconsider what are the true reasons you like python (if you really do

Troll? was: Re: goto statement

2005-04-20 Thread André Roberge
Maxim Kasimov wrote: by the way, goto statement will be useful for writing more powerful obfuscators Let me get that clear: you want a goto to help with debugging. And you want to obfuscate your code even more? !? Perhaps you need to write in Perl, or some other similar language. Writing in

Re: goto statement

2005-04-20 Thread TZOTZIOY
On Wed, 20 Apr 2005 16:24:19 +0100, rumours say that Simon Brunning [EMAIL PROTECTED] might have written: On 4/20/05, Christos TZOTZIOY Georgiou [EMAIL PROTECTED] wrote: If you need more help, I would gladly send you the output of `man vi' from a non-GNU Unix. I can also send you the output of

Re: goto statement

2005-04-20 Thread Philippe C. Martin
I do not want to pollute the debate but: -) I remember a software QA managanager responsible for C coding rules also not allowing us to use 'break', 'continue', or 'return' (in the middle of a function). Although I find them 'cleaner' than goto, would not use goto, and certainly do use 'return'

Re: goto statement

2005-04-20 Thread Grant Edwards
On 2005-04-20, Philippe C. Martin [EMAIL PROTECTED] wrote: Although I find them 'cleaner' than goto, would not use goto, and certainly do use 'return' in the middle of functions, I also agree that some people might think the former do reduce code readibility - ex: I , somehow, do not feel

Re: goto statement

2005-04-20 Thread Philippe C. Martin
Loop bodies (for break) Grant Edwards wrote: On 2005-04-20, Philippe C. Martin [EMAIL PROTECTED] wrote: Although I find them 'cleaner' than goto, would not use goto, and certainly do use 'return' in the middle of functions, I also agree that some people might think the former do reduce

Re: Troll? was: Re: goto statement

2005-04-20 Thread Maxim Kasimov
André Roberge wrote: Maxim Kasimov wrote: by the way, goto statement will be useful for writing more powerful obfuscators Let me get that clear: you want a goto to help with debugging. And you want to obfuscate your code even more? !? Perhaps you need to write in Perl, or some other similar

Re: Troll? was: Re: goto statement

2005-04-20 Thread Robert Kern
Maxim Kasimov wrote: André Roberge wrote: Maxim Kasimov wrote: by the way, goto statement will be useful for writing more powerful obfuscators Let me get that clear: you want a goto to help with debugging. And you want to obfuscate your code even more? !? Perhaps you need to write in Perl, or

Re: Troll? was: Re: goto statement

2005-04-20 Thread Bill Mill
On 4/20/05, Robert Kern [EMAIL PROTECTED] wrote: Maxim Kasimov wrote: André Roberge wrote: Maxim Kasimov wrote: by the way, goto statement will be useful for writing more powerful obfuscators Let me get that clear: you want a goto to help with debugging. And you want to

Re: goto statement

2005-04-20 Thread Steve Holden
Philippe C. Martin wrote: I do not want to pollute the debate but: -) I remember a software QA managanager responsible for C coding rules also not allowing us to use 'break', 'continue', or 'return' (in the middle of a function). And I once worked (back in the 1970's) in a software shop where

Re: goto statement

2005-04-20 Thread Philippe C. Martin
I guess the point could be where do you draw the line: you can break and continue in Python, but you cannot goto. Some people, so it seems ;-) , would like to see gotos in Python whereas other think breaks and continues should be excluded ...; Regards, Philippe Steve Holden wrote: Philippe

Re: Troll? was: Re: goto statement

2005-04-20 Thread Fredrik Lundh
Bill Mill wrote: I believe he meant obfuscating bytecode for a commercial product, to try and avoid decompilation, which is often a desirable function for commercial entities. there is no shortage of jump instructions on the bytecode level, so if he wants to obfuscate bytecode, all he has to do

Re: goto statement

2005-04-20 Thread Matt Feinstein
On Wed, 20 Apr 2005 10:23:58 +0100 (BST), praba kar [EMAIL PROTECTED] wrote: Dear All, In Python what is equivalent to goto statement I'd like to that implemented in an interpreted language. Requires some time travel. Matt Feinstein -- There is no virtue in believing something that can be

Re: goto statement

2005-04-20 Thread Robert Kern
Matt Feinstein wrote: On Wed, 20 Apr 2005 10:23:58 +0100 (BST), praba kar [EMAIL PROTECTED] wrote: Dear All, In Python what is equivalent to goto statement I'd like to that implemented in an interpreted language. Requires some time travel. Yes, to 2004-04-01. -- Robert Kern [EMAIL PROTECTED] In

Re: goto statement

2005-04-20 Thread Cameron Laird
In article [EMAIL PROTECTED], Maxim Kasimov [EMAIL PROTECTED] wrote: Simon Brunning wrote: On 4/20/05, Maxim Kasimov [EMAIL PROTECTED] wrote: it would be quite useful for debuging porposes How does goto help you to remove bugs? I can certainly see how it helps you put them in in the

Re: goto statement

2005-04-20 Thread Cameron Laird
In article [EMAIL PROTECTED], Maxim Kasimov [EMAIL PROTECTED] wrote: . . . if you need to comment a couple of code (and then uncomment ), what are you doing then? Use comments? WOW, just greate! ... but i'd like to

Re: Troll? was: Re: goto statement

2005-04-20 Thread Steve Holden
Maxim Kasimov wrote: André Roberge wrote: Maxim Kasimov wrote: by the way, goto statement will be useful for writing more powerful obfuscators Let me get that clear: you want a goto to help with debugging. And you want to obfuscate your code even more? !? Perhaps you need to write in Perl, or

Re: GOTO (was Re: Appeal for python developers)

2005-03-07 Thread Heiko Wundram
On Sunday 06 March 2005 14:26, Anthra Norell wrote: snip long goto explanation Wow, I never thought I'd say this, but this certainly is an ingenious use of goto... But, nevertheless, I don't think this is applicable to Python as a way of justifying goto in the language, as your program doesn't

Re: GOTO (was Re: Appeal for python developers)

2005-03-07 Thread Anthra Norell
Heiko wrote: SETUP = object() ELSE = object() BREAK = object() machine = {"WAITING FOR ACTION": {customer_drops_coin:"COIN HAS BEEN DROPPED", customer_selects_beverage:"ORDER RECEIVED", customer_cancels_order:"ACCOUNT CLOSURE IS DUE" ELSE:"WAITING FOR ACTION"}, "COIN HAS

Re: GOTO (was Re: Appeal for python developers)

2005-03-06 Thread Anthra Norell
Please include "goto" command in future python realeses know that proffesional programers doesn't like to use it, but for me as newbie it's too hard to get used replacing it with "while", "def" or other commands -- I believe the bad reputation of 'goto' goes back to the originators of

Re: GOTO (was Re: Appeal for python developers)

2005-03-06 Thread Andrew Dalke
Paul McGuire wrote: At the risk of beating this into the Pythonic ground, here is a generator version which collapses the original nested loop into a single loop, so that break works just fine: Indeed. For some things I'm still in the pre-generator days of Python. If I worked at it I think I

Re: GOTO (was Re: Appeal for python developers)

2005-03-05 Thread Paul McGuire
At the risk of beating this into the Pythonic ground, here is a generator version which collapses the original nested loop into a single loop, so that break works just fine: .def getCombinations(*args): .if len(args) 1: .for a0 in args[0]: .for remainder in

Re: GOTO (was Re: Appeal for python developers)

2005-03-05 Thread Leif K-Brooks
[EMAIL PROTECTED] wrote: Goto is useful [...] when there is a clean-up section of a function that should be executed for various error conditions. Like this? def foo(): f = open('foo.txt') try: # do stuff with f finally: f.close() --

Re: GOTO (was Re: Appeal for python developers)

2005-03-05 Thread Steven Bethard
Dennis Lee Bieber wrote: On 5 Mar 2005 08:00:23 -0800, [EMAIL PROTECTED] declaimed the following in comp.lang.python: explicit GOTO'. Goto's are less dangerous when they are in the forward direction, to code appearing later. UGH... That is the one direction I always avoid (in FORTRAN 77). Typical

Re: goto, cls, wait commands

2005-02-14 Thread Michael Hoffman
Erik Bethke wrote: At least I thought this was funny and cool! -Erik Thanks. ;) -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: goto, cls, wait commands

2005-02-13 Thread Fredrik Lundh
Mike Meyer wrote: Secondly, how do I clear screen (cls) from text and other content ? That depends on A: What type of display device you're using B: What type of interface is being rendered on that display (command line, GUI, IDE, etc) C: Perhaps what operating system you are using. D:

Re: goto, cls, wait commands

2005-02-13 Thread Lars
You sir are a troll for sure. QBasic?! When was the last time you did any programming, 1989? Gave me a laugh though. Lars -- http://mail.python.org/mailman/listinfo/python-list

Re: goto, cls, wait commands

2005-02-12 Thread Fredrik Lundh
jean-michel [EMAIL PROTECTED] wrote: And it was not possible to remove GOTO, because that would really need to rewrite manually the programs really? converting GOTO messes to structured programs has been a solved problem for many years (you can buy commercial products that does this, and I

Re: goto, cls, wait commands

2005-02-12 Thread Mike Meyer
Alan Kennedy [EMAIL PROTECTED] writes: Secondly, how do I clear screen (cls) from text and other content ? That depends on A: What type of display device you're using B: What type of interface is being rendered on that display (command line, GUI, IDE, etc) C: Perhaps what operating system

Re: goto, cls, wait commands

2005-02-11 Thread Dan Bishop
Harlin wrote: No goto needed. If this makes no sense (which it may not if all you've been exposed to is BASIC) it wouldn't be a bad idea to Google why you should never use a goto statement. GOTO isn't even needed in QBasic (except for ON ERROR GOTO). --

Re: goto, cls, wait commands

2005-02-11 Thread jean-michel
BOOGIEMAN [EMAIL PROTECTED] a écrit dans le message de news:[EMAIL PROTECTED] I've just finished reading Python turtorial for non-programmers and I haven't found there anything about some usefull commands I used in QBasic. First of all, what's Python command equivalent to QBasic's goto ?

Re: goto, cls, wait commands

2005-02-11 Thread Nick Craig-Wood
Grant Edwards [EMAIL PROTECTED] wrote: I forgot to mention try/except. When I do use goto in C programming it's almost always to impliment what would have been a try/except block in Python. Yes I'd agree with that. No more 'goto out'. There is this also for (i = 0; ...) {

Re: goto, cls, wait commands

2005-02-11 Thread Jeff Shannon
jean-michel wrote: Hi all, I saw a lot of comments saying GOTO is not usefull, very bad, and we should'nt use it because we don't need it. I think that's true, but only if you *create* programs. But if the goal is to provide some kind of converter to automatically take an old application written

Re: goto, cls, wait commands

2005-02-10 Thread Fouff
BOOGIEMAN a écrit : I've just finished reading Python turtorial for non-programmers and I haven't found there anything about some usefull commands I used in QBasic. First of all, what's Python command equivalent to QBasic's goto ? I had a professor that told me that using goto in prog is that

Re: goto, cls, wait commands

2005-02-10 Thread Duncan Booth
BOOGIEMAN wrote: I've just finished reading Python turtorial for non-programmers and I haven't found there anything about some usefull commands I used in QBasic. First of all, what's Python command equivalent to QBasic's goto ? There isn't one. Why do you think you need this? Secondly, how

Re: goto, cls, wait commands

2005-02-10 Thread TZOTZIOY
On Thu, 10 Feb 2005 16:59:04 +0100, rumours say that BOOGIEMAN [EMAIL PROTECTED] might have written: Best advice: try to forget QBasic, and try again reading the tutorial. That, if your post is serious. If it isn't, keep reading my reply :) I've just finished reading Python turtorial for

Re: goto, cls, wait commands

2005-02-10 Thread Grant Edwards
On 2005-02-10, BOOGIEMAN [EMAIL PROTECTED] wrote: First of all, what's Python command equivalent to QBasic's goto ? There isn't one. One defines functions and calls them. One uses for and while loops. One uses list comprehensions. One uses if/elif/else. Secondly, how do I clear screen

Re: goto, cls, wait commands

2005-02-10 Thread Alan Kennedy
[BOOGIEMAN] I've just finished reading Python turtorial for non-programmers and I haven't found there anything about some usefull commands I used in QBasic. First of all, what's Python command equivalent to QBasic's goto ? Oh no! You said the G word! That's a dirty word in computer science

Re: goto, cls, wait commands

2005-02-10 Thread Bruno Desthuilliers
Duncan Booth a écrit : BOOGIEMAN wrote: (snip) Secondly, how do I clear screen (cls) from text and other content ? That depends on your computer, and how you are running your program. One way which *might* work is: import os os.system(cls) *might* work... !-) [EMAIL PROTECTED] modulix $ cls

Re: goto, cls, wait commands

2005-02-10 Thread Bruno Desthuilliers
Grant Edwards a écrit : On 2005-02-10, BOOGIEMAN [EMAIL PROTECTED] wrote: First of all, what's Python command equivalent to QBasic's goto ? There isn't one. One defines functions and calls them. One uses for and while loops. One uses list comprehensions. One uses if/elif/else. and even

Re: goto, cls, wait commands

2005-02-10 Thread Grant Edwards
On 2005-02-10, Bruno Desthuilliers [EMAIL PROTECTED] wrote: Grant Edwards a écrit : On 2005-02-10, BOOGIEMAN [EMAIL PROTECTED] wrote: First of all, what's Python command equivalent to QBasic's goto ? There isn't one. One defines functions and calls them. One uses for and while

Re: goto, cls, wait commands

2005-02-10 Thread Ulf Göransson
Bruno Desthuilliers wrote: Duncan Booth a écrit : BOOGIEMAN wrote: Secondly, how do I clear screen (cls) from text and other content ? That depends on your computer, and how you are running your program. One way which *might* work is: import os os.system(cls) *might* work... !-) [EMAIL

Re: goto, cls, wait commands

2005-02-10 Thread Pekka Niiranen
import os if os.name == nt: os.system(cls) # Works in w2k else: os.system(clear)# Works in cygwin's Bash Ulf Göransson wrote: Bruno Desthuilliers wrote: Duncan Booth a écrit : BOOGIEMAN wrote: Secondly, how do I clear screen (cls) from text and other content ?

Re: goto, cls, wait commands

2005-02-10 Thread BOOGIEMAN
OK, thanks all Here's presentation of my advanced programming skills :) import os import time os.system(cls) number = 78 guess = 0 while guess != number: guess = input(Guess number: ) if guess number: print Lower

Re: goto, cls, wait commands

2005-02-10 Thread Brian van den Broek
BOOGIEMAN said unto the world upon 2005-02-10 16:06: OK, thanks all Here's presentation of my advanced programming skills :) import os import time os.system(cls) number = 78 guess = 0 while guess != number: guess = input(Guess number: ) if

Re: goto, cls, wait commands

2005-02-10 Thread Harlin
No goto needed. If this makes no sense (which it may not if all you've been exposed to is BASIC) it wouldn't be a bad idea to Google why you should never use a goto statement. To do a clear screen you'll need to use the method that your command shell uses. The shortcut to this is for Windows,

Re: goto, cls, wait commands

2005-02-10 Thread Michael Hoffman
BOOGIEMAN wrote: First of all, what's Python command equivalent to QBasic's goto ? You can only use the goto function if you use Python with line numbers, thusly: 10 import sys 20 real_stdout = sys.stdout 30 class fake_stdout(object): pass 40 fake_stdout.write = lambda x, y: None 50 sys.stdout =

Re: goto, cls, wait commands

2005-02-10 Thread James
On Windows, I use WConio http://newcenturycomputers.net/projects/wconio.html It provides other screen functions you might have gotten used to in QBasic as well. On unix/cygwin, use curses. I am not aware of any portable library though. I used to use cls a lot in my QBasic days. Now I just

<    1   2   3