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
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
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
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
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
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
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
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
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
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
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
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
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
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
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)
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
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
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
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
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/
--
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
--
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
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
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/
--
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:
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
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
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
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
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
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
--
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
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/
--
+1
Michel Claveau
--
http://mail.python.org/mailman/listinfo/python-list
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
--
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
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
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
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/
--
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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'
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
[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()
--
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
Erik Bethke wrote:
At least I thought this was funny and cool! -Erik
Thanks. ;)
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
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:
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
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
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
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).
--
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
?
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; ...)
{
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
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
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
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
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
[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
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
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
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
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
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 ?
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
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
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,
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 =
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
201 - 299 of 299 matches
Mail list logo