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.h

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/ -- http://m

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

goto statement

2005-04-20 Thread praba kar
Dear All, In Python what is equivalent to goto statement regards, praba __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- http://mail.python.org/mailman/listinfo/python-list

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

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

2005-03-07 Thread Heiko Wundram
On Sunday 06 March 2005 14:26, Anthra Norell wrote: > 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 hav

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

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

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

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() -- http://mail.python.o

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 ge

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

2005-03-05 Thread Andrew Dalke
beliavsky wrote: > Goto is useful in breaking out of a nested loop and when there is a > clean-up section of a function that should be executed for various > error conditions. But much less useful in languages like Python which have exception handling. At rare times I've needed

GOTO (was Re: Appeal for python developers)

2005-03-05 Thread beliavsky
Torsten Bronger wrote: > Hallöchen! > > BOOGIEMAN <[EMAIL PROTECTED]> writes: > > > Please include "goto" command in future python realeses I know > > that proffesional programers doesn't like to use it, but for me as > > newbie it's too

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 Erik Bethke
At least I thought this was funny and cool! -Erik -- http://mail.python.org/mailman/listinfo/python-list

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-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

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 operati

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 p

Re: goto, cls, wait commands

2005-02-11 Thread jean-michel
"Jeff Shannon" <[EMAIL PROTECTED]> a écrit dans le message de news:[EMAIL PROTECTED] > 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

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 appl

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'.

Re: lambda and for that matter goto not forgetting sugar

2005-02-11 Thread bearophileHUGS
Nick Coghlan wrote: > Anyway, check out AlternateLambdaSyntax on the python.org Wiki It's an interesting page: http://www.python.org/moin/AlternateLambdaSyntax Some days ago I suggested something different: maybe def can become a function, then it can work as lambda (and still as the old def) too.

Re: lambda and for that matter goto not forgetting sugar

2005-02-11 Thread Richie Hindle
[Christos] > *Three* requests --check the thread "goto, cls, wait commands". I saw that too, and was too freaked out to respond. > BTW, my sincere congratulations for what I presume best computer related > April's > Fool joke of all time; I love double-bluffs. The

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 Pyt

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-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 don't.

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_

Re: lambda and for that matter goto not forgetting sugar

2005-02-10 Thread Carl Banks
ral code) functional features, like generator expressions, lambda is less useful than ever. I'd say it's dispensible and not worth the added complexity. [snip] > For that matter I would find implementing the classical algorithms far > easier if python had 'goto' (I'

Re: lambda and for that matter goto not forgetting sugar

2005-02-10 Thread John J. Lee
from goto.py ( http://entrian.com/goto/ ): .# Label: "label .x" XXX Computed labels. :-) John -- http://mail.python.org/mailman/listinfo/python-list

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

Re: lambda and for that matter goto not forgetting sugar

2005-02-10 Thread TZOTZIOY
On Thu, 10 Feb 2005 15:21:47 +, rumours say that Richie Hindle <[EMAIL PROTECTED]> might have written: > >[Philip] >> For that matter I would find implementing the classical algorithms far >> easier if python had 'goto' > >I can't believe it -

Re: goto, cls, wait commands

2005-02-10 Thread Brian van den Broek
--- BTW, I'm thinking to replace lines "time.sleep(3)" with something like "Press any key to guess again" How do I do that ? Also I wanted to put at the end something like "Do you want to guess again ?" and then "GOTO"

Re: goto, cls, wait commands

2005-02-10 Thread BOOGIEMAN
x27;m thinking to replace lines "time.sleep(3)" with something like "Press any key to guess again" How do I do that ? Also I wanted to put at the end something like "Do you want to guess again ?" and then "GOTO" start of program, but since there is no such command in Python what are my possible solutions ? -- http://mail.python.org/mailman/listinfo/python-list

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 conten

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 PRO

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" ? >> &

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.

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 $ cl

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!

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

Re: goto, cls, wait commands

2005-02-10 Thread TZOTZIOY
ython 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" ? goto for python: http://entrian.com/goto/index.html Please ignore the line in bold

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

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 t

goto, cls, wait commands

2005-02-10 Thread 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" ? Secondly, how do I clear screen (cls) from text and ot

Re: lambda and for that matter goto not forgetting sugar

2005-02-10 Thread Richie Hindle
[Philip] > For that matter I would find implementing the classical algorithms far > easier if python had 'goto' I can't believe it - first a request for COMEFROM and now one for GOTO, both on the same day. I should have put http://entrian.com/goto/ under a commercial lice

Re: lambda and for that matter goto not forgetting sugar

2005-02-10 Thread Nick Coghlan
ive way - it's more descriptive than anything. It's any language change that's designed to make common idioms easier to use. Cheers, Nick. No comment on the goto thing ;) -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --- http://boredomandlaziness.skystorm.net -- http://mail.python.org/mailman/listinfo/python-list

lambda and for that matter goto not forgetting sugar

2005-02-10 Thread Philip Smith
have no idea whether Lambda is of any relevance to eg client server programming. For that matter I would find implementing the classical algorithms far easier if python had 'goto' (I'll wait for the guffaws to subside before mentioning that no lesser guru than Donald Kn

Re: network programming without goto (refactoring)

2004-11-29 Thread Sibylle Koczian
Nick Coghlan schrieb: Roy Smith wrote: Jeff Shannon <[EMAIL PROTECTED]> wrote: In Python, exceptions use 'raise', not 'throw'... Doh! I guess it shows that I've been doing a lot of C++ lately :-) Heh. I'm working on a Python test harness that uses a C++ hardware interface module. I keep writing

Re: network programming without goto

2004-11-28 Thread Josiah Carlson
se() except: pass - Josiah > > --- Josiah Carlson <[EMAIL PROTECTED]> wrote: > > > > > kent sin <[EMAIL PROTECTED]> wrote: > > > > > > Please help: > > > > > > I was really blocked here. without goto I really > > d

<    1   2   3   4   5