Re: Print statement

2020-01-28 Thread Frank Millman
On 2020-01-28 12:14 PM, L A Smit wrote: Please help me with this. squares =input("\nSquares: ") print(float((squares) *float(.15)) *(1.3)) Cant print answer.   print(float((squares) * float(.15)) *(1.3)) TypeError: can't multiply sequence by non-int of type 'float' You have some superfluo

Print statement

2020-01-28 Thread L A Smit
Please help me with this. squares =input("\nSquares: ") print(float((squares) *float(.15)) *(1.3)) Cant print answer. print(float((squares) * float(.15)) *(1.3)) TypeError: can't multiply sequence by non-int of type 'float' Thx L Smit -- https://mail.python.org/mailman/listinfo/python-lis

Re: Is there a limit to the characters used in a print statement?

2016-01-16 Thread Steven D'Aprano
On Sun, 17 Jan 2016 12:49 am, Robert James Liguori wrote: > I'm doing a data conversion and all is garbled when I add an extra hundred > lines to the print in my for loop. Is there a limit? Is this the same problem as the "print size limit" thread you started one minute earlier, or a different

Re: Is there a limit to the characters used in a print statement?

2016-01-16 Thread Mark Lawrence
On 16/01/2016 13:49, Robert James Liguori wrote: I'm doing a data conversion and all is garbled when I add an extra hundred lines to the print in my for loop. Is there a limit? This will probably get answered under the thread with subject "print size limit" that arrived one minute before th

Is there a limit to the characters used in a print statement?

2016-01-16 Thread Robert James Liguori
I'm doing a data conversion and all is garbled when I add an extra hundred lines to the print in my for loop. Is there a limit? -- https://mail.python.org/mailman/listinfo/python-list

Re: concat string and dict in print statement

2014-12-05 Thread Ian Kelly
On Fri, Dec 5, 2014 at 10:31 AM, wrote: > > Hi Guys, > > I am trying to combine string and dict in the print statement, however getting an error. Would someone let me know what will be correct way to do that. > > stats={'lname': 'shah', 'fname': &#x

Re: concat string and dict in print statement

2014-12-05 Thread Peter Otten
gaurangns...@gmail.com wrote: > I am trying to combine string and dict in the print statement, however > getting an error. Would someone let me know what will be correct way to do > that. > > stats={'lname': 'shah', 'fname': 'gaurang'}

concat string and dict in print statement

2014-12-05 Thread gaurangnshah
Hi Guys, I am trying to combine string and dict in the print statement, however getting an error. Would someone let me know what will be correct way to do that. stats={'lname': 'shah', 'fname': 'gaurang'} a=test print "%s %(fname)s %(lname)s&quo

Re: print to screen and file with one print statement

2014-08-27 Thread Chris Angelico
On Thu, Aug 28, 2014 at 8:23 AM, KS wrote: > Can you please let me know where do I add flush(self) and get > sys.stdout.flush() to work? Check the dates. You're responding to a 2013 response to a 2003 post. If you have a question about something this old, it's probably best to start a new thread

Re: print to screen and file with one print statement

2014-08-27 Thread KS
Hi Mike/Ami, Can you please let me know where do I add flush(self) and get sys.stdout.flush() to work? Thanks, KS -- https://mail.python.org/mailman/listinfo/python-list

Re: Print statement not printing as it suppose to

2013-09-20 Thread Dave Angel
On 20/9/2013 17:57, Sam wrote: > > print("\nThe total amount required is ", total ) > > > ('\nThe total amount required is ', 3534) > > ===> the problem is obviously on the last print statement that is supposed to > print the outut Others have poin

Re: Print statement not printing as it suppose to

2013-09-20 Thread Chris Angelico
On Sat, Sep 21, 2013 at 7:57 AM, Sam wrote: > car=int(input("Lamborghini tune-up:")) > print("\nThe total amount required is ", total ) > OUTPUT > ('\nThe total amount required is ', 3534) As others have said, this output indicates that you're running under a Python 2.x interpreter. I strongly re

Re: Print statement not printing as it suppose to

2013-09-20 Thread John Gordon
In <05bbf1a3-6480-48ee-8984-2482b90c7...@googlegroups.com> Sam writes: > print("\nThe total amount required is ", total ) > OUTPUT > ('\nThe total amount required is ', 3534) In older versions of python (like the one you are using), 'print' is a statement instead of a function. In other word

Re: Print statement not printing as it suppose to

2013-09-20 Thread Emiliano Carlos de Moraes Firmino
Remove both brackets in last line, You are creating a tuple in last statement not making a function call. 2013/9/20 Sam > hi everybody i am just starting to learn python, i was writing a simple > i/o program but my print statement is acting weird. here is my code i want > to know why

Re: Print statement not printing as it suppose to

2013-09-20 Thread Tim Delaney
On 21 September 2013 07:57, Sam wrote: > hi everybody i am just starting to learn python, i was writing a simple > i/o program but my print statement is acting weird. here is my code i want > to know why it prints this way. thank you > > print("\nThe total amount

Print statement not printing as it suppose to

2013-09-20 Thread Sam
hi everybody i am just starting to learn python, i was writing a simple i/o program but my print statement is acting weird. here is my code i want to know why it prints this way. thank you car=int(input("Lamborghini tune-up:")) rent=int(input('\nManhatan apartment: '

Re: print to screen and file with one print statement

2013-04-09 Thread amiwinter
On Thursday, February 13, 2003 2:51:02 PM UTC+2, Mike Müller wrote: > "Mark McEahern" wrote in message > news:... > > Same basic idea: > > > > #!/usr/bin/env python > > > > import sys > > > > class MyWriter: > > > > def __init__(self, stdout, filename): > > self.stdout = stdout >

Re: help with simple print statement!

2012-08-26 Thread Hans Mulder
On 24/08/12 21:59:12, Prasad, Ramit wrote: > Also, print doesn't work inside a class. It works for me: > python3 Python 3.3.0a1 (v3.3.0a1:f1a9a6505731, Mar 4 2012, 12:26:12) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more informati

RE: help with simple print statement!

2012-08-24 Thread Bruce Krayenhoff
ython-list-bounces+wbrucek=gmail@python.org] On Behalf Of Chris Kaynor Sent: August-24-12 12:54 PM To: python-list@python.org Subject: Re: help with simple print statement! On Fri, Aug 24, 2012 at 12:43 PM, Willem Krayenhoff mailto:wbru...@gmail.com> > wrote: Any idea why print is

proper reply format [was Re: help with simple print statement!]

2012-08-24 Thread Ethan Furman
Prasad, Ramit wrote: Willem Krayenhoff Any idea why print isn't working here? I tried restarting my Command prompt. Also, print doesn't work inside a class. Ramit, The standard for attribution is something along the lines of: Prasad, Ramit wrote: or Willem Kayenhoff wrote: Just havi

RE: help with simple print statement!

2012-08-24 Thread Prasad, Ramit
Willem Krayenhoff Any idea why print isn't working here?   I tried restarting my Command prompt.  Also, print doesn't work inside a class. -- Best Wishes,      Bruce      C: 604-441-5791      My Availability  Just as a note, this is a usenet group that can be accessed via email; a good po

Re: help with simple print statement!

2012-08-24 Thread Zero Piraeus
: On 24 August 2012 15:43, Willem Krayenhoff wrote: > Any idea why print isn't working here? http://docs.python.org/release/3.0.1/whatsnew/3.0.html#print-is-a-function Also, pasting images into emails to this list is unlikely to gain you many friends ... -[]z. -- http://mail.python.org/mailm

Re: help with simple print statement!

2012-08-24 Thread Rob Day
On Fri, 2012-08-24 at 12:43 -0700, Willem Krayenhoff wrote: > Any idea why print isn't working here? You're using Python 3.2, but trying Python 2.7 syntax - http://docs.python.org/release/3.0.1/whatsnew/3.0.html#print-is-a-function should explain the problem adequately. (Incidentally - you can

Re: help with simple print statement!

2012-08-24 Thread Chris Kaynor
On Fri, Aug 24, 2012 at 12:43 PM, Willem Krayenhoff wrote: > Any idea why print isn't working here? > > I tried restarting my Command prompt. Also, print doesn't work inside a > class. > > [image: Inline image 2] > In Python 3, print was made into a function rather than a statement for various r

Re: Parsing a large number of parms to a print statement.

2009-10-22 Thread KB
Excuse the top-post, but thanks to all, the tuple was the way to go. On Oct 22, 2:16 pm, KB wrote: > Hi, > > I have to pass over 150 parameters to a print statement ala: > > print "%s %s %s <150'th unique text> %s" % (v > [0], v[1], ... v[150]) >

Re: Parsing a large number of parms to a print statement.

2009-10-22 Thread Andre Engels
On Thu, Oct 22, 2009 at 11:16 PM, KB wrote: > Hi, > > I have to pass over 150 parameters to a print statement ala: > > print "%s %s %s <150'th unique text> %s" % (v > [0], v[1], ... v[150]) > > I can't use a for loop like I normally w

Re: Parsing a large number of parms to a print statement.

2009-10-22 Thread Paul Rubin
KB writes: > I have to pass over 150 parameters to a print statement ala: > > print "%s %s %s <150'th unique text> %s" % (v > [0], v[1], ... v[150]) > > I can't use a for loop like I normally would over the list "v" due to >

Re: Parsing a large number of parms to a print statement.

2009-10-22 Thread Benjamin Kaplan
On Thu, Oct 22, 2009 at 5:16 PM, KB wrote: > Hi, > > I have to pass over 150 parameters to a print statement ala: > > print "%s %s %s <150'th unique text> %s" % (v > [0], v[1], ... v[150]) > > I can't use a for loop like I normally w

Re: Parsing a large number of parms to a print statement.

2009-10-22 Thread MRAB
KB wrote: Hi, I have to pass over 150 parameters to a print statement ala: print "%s %s %s <150'th unique text> %s" % (v [0], v[1], ... v[150]) I can't use a for loop like I normally would over the list "v" due to the different text fragments

Re: Parsing a large number of parms to a print statement.

2009-10-22 Thread Ethan Furman
KB wrote: Hi, I have to pass over 150 parameters to a print statement ala: print "%s %s %s <150'th unique text> %s" % (v [0], v[1], ... v[150]) I can't use a for loop like I normally would over the list "v" due to the different text fragments

Parsing a large number of parms to a print statement.

2009-10-22 Thread KB
Hi, I have to pass over 150 parameters to a print statement ala: print "%s %s %s <150'th unique text> %s" % (v [0], v[1], ... v[150]) I can't use a for loop like I normally would over the list "v" due to the different text fragments between each var.

Re: print - bug or feature - concatenated format strings in a print statement

2009-03-18 Thread Steven D'Aprano
On Tue, 17 Mar 2009 22:41:26 -0700, John Machin wrote: > On Mar 18, 4:19 pm, Matt Nordhoff wrote: >> The implicit string concatenation is actually done by the compiler; it >> isn't an operator at all. Look: >> >> >>> import dis >> >>> def f(): >> >> ...     return "foo" "bar" >> ...>>> dis.dis(f

Re: print - bug or feature - concatenated format strings in a print statement

2009-03-17 Thread John Machin
On Mar 18, 4:19 pm, Matt Nordhoff wrote: > bdb112 wrote: > > Thanks for all the replies: > > I think I see now - % is a binary operator whose precedence rules are > > shared with the modulo operator regardless of the nature of its > > arguments, for language consistency. > > I understand the argum

Re: print - bug or feature - concatenated format strings in a print statement

2009-03-17 Thread Matt Nordhoff
bdb112 wrote: > Thanks for all the replies: > I think I see now - % is a binary operator whose precedence rules are > shared with the modulo operator regardless of the nature of its > arguments, for language consistency. > I understand the arguments behind the format method, but hope that the > sli

Re: print - bug or feature - concatenated format strings in a print statement

2009-03-17 Thread bdb112
Thanks for all the replies: I think I see now - % is a binary operator whose precedence rules are shared with the modulo operator regardless of the nature of its arguments, for language consistency. I understand the arguments behind the format method, but hope that the slightly idiosyncratic print(

Re: print - bug or feature - concatenated format strings in a print statement

2009-03-16 Thread Scott David Daniels
bdb112 wrote: ... the difference between ... print(" %d, %d, buckle my shoe" % (1,2)) ... and ... print(" %d, " + " %d, buckle my shoe" % (1,2)) # a bug or a feature? A feature. a + b % c is a + (b % c) But do note that string constant concatentation is higher priority than the other ope

Re: print - bug or feature - concatenated format strings in a print statement

2009-03-16 Thread R. David Murray
> On Mar 16, 5:00 pm, bdb112 wrote: > > #   is the difference between > > print(" %d,  %d, buckle my shoe" % (1,2)) > > #   and > > print(" %d, " + " %d, buckle my shoe" % (1,2)) > > # a bug or a feature? It is correct behavior. On the other hand, it is one of the, well, bugs, that is avoided by

Re: print - bug or feature - concatenated format strings in a print statement

2009-03-16 Thread alex goretoy
> > print(10 + 20 % 7) > a bug or a feature? It is a feature print ((10+20) % 7) -Alex Goretoy http://www.goretoy.com -- http://mail.python.org/mailman/listinfo/python-list

Re: print - bug or feature - concatenated format strings in a print statement

2009-03-16 Thread John Machin
On Mar 16, 7:00 pm, bdb112 wrote: > #   is the difference between > print(" %d,  %d, buckle my shoe" % (1,2)) > #   and > print(" %d, " + " %d, buckle my shoe" % (1,2)) > # a bug or a feature? Here's a question for you: Is the difference between print(30 % 7) and print(10 + 20 % 7) a bug or

Re: print - bug or feature - concatenated format strings in a print statement

2009-03-16 Thread bdb112
#whoops, the first output is actually 1, 2, buckle my shoe # in case it wasn't obvious On Mar 16, 5:00 pm, bdb112 wrote: > #   is the difference between > print(" %d,  %d, buckle my shoe" % (1,2)) > #   and > print(" %d, " + " %d, buckle my shoe" % (1,2)) > # a bug or a feature? > > First ou

print - bug or feature - concatenated format strings in a print statement

2009-03-16 Thread bdb112
# is the difference between print(" %d, %d, buckle my shoe" % (1,2)) # and print(" %d, " + " %d, buckle my shoe" % (1,2)) # a bug or a feature? First output ... print(" %d " + " %d, buckle my shoe" % (1,2)) Second output TypeError: not all arguments converted during string formatting Versio

Re: Print statement isn't showing up?

2008-08-06 Thread Lie
  print "Removing external local directory:", localDir > >     rmdirs( localDir ) > >     vfxrepo.copy( remoteDir, localDir ) > > > I noticed that the print statement above does not show up before > > vfxrepo.copy() is called. the copy() function (as wel

Re: Print statement isn't showing up?

2008-08-05 Thread Terry Reedy
Robert Dailey wrote: I have the following code: Python version? Plafform? def ReplaceExternalWithCopy( localDir, remoteDir ): print "Removing external local directory:", localDir rmdirs( localDir ) vfxrepo.copy( remoteDir, localDir ) I noticed that the print state

Re: Print statement isn't showing up?

2008-08-05 Thread Robert Dailey
remoteDir ): > > print "Removing external local directory:", localDir > > rmdirs( localDir ) > > vfxrepo.copy( remoteDir, localDir ) > > > > I noticed that the print statement above does not show up before > > vfxrepo.copy() is called. the copy()

Re: Print statement isn't showing up?

2008-08-05 Thread Timothy Grant
> vfxrepo.copy( remoteDir, localDir ) > > I noticed that the print statement above does not show up before > vfxrepo.copy() is called. the copy() function (as well as the rmdirs() > function) are very long file-system calls that take up to 5 minutes. I > should see a print state

Print statement isn't showing up?

2008-08-05 Thread Robert Dailey
Hi, I have the following code: def ReplaceExternalWithCopy( localDir, remoteDir ): print "Removing external local directory:", localDir rmdirs( localDir ) vfxrepo.copy( remoteDir, localDir ) I noticed that the print statement above does not show up before vfxrepo.copy()

Re: conditional print statement ?

2007-04-27 Thread Paul McGuire
On Apr 27, 9:45 am, Duncan Booth <[EMAIL PROTECTED]> wrote: > Paul McGuire <[EMAIL PROTECTED]> wrote: > > The Enable/Disable decorators on the Python wiki (http:// > > wiki.python.org/moin/PythonDecoratorLibrary?highlight=%28decorator > > %29#head-8298dbf9ac7325d9ef15e7130e676378bbbda572) help you

Re: conditional print statement ?

2007-04-27 Thread Duncan Booth
Paul McGuire <[EMAIL PROTECTED]> wrote: > The Enable/Disable decorators on the Python wiki (http:// > wiki.python.org/moin/PythonDecoratorLibrary?highlight=%28decorator > %29#head-8298dbf9ac7325d9ef15e7130e676378bbbda572) help you do > something very similar, without having to replicate the functi

Re: conditional print statement ?

2007-04-27 Thread Paul McGuire
On Apr 26, 7:31 am, Dustan <[EMAIL PROTECTED]> wrote: > On Apr 26, 1:58 am, Antoon Pardon <[EMAIL PROTECTED]> wrote: > > > > > > > On 2007-04-25, Stef Mientki <[EMAIL PROTECTED]> wrote: > > > > hello, > > > > As part of a procedure I've a number sequences like this: > > > > > > > if Print_Info

Re: conditional print statement ?

2007-04-27 Thread stef
> or (untested): > > if Print_Info: > def printOrNot(arg): > print arg > else: > def printOrNot(arg): > pass > > printOrNot(Datafile.readline()) > > thanks for the creative solution, and indeed it does work ;-) cheers, Stef Mientki -- http://mail.python.org/mailman/lis

Re: conditional print statement ?

2007-04-26 Thread Dustan
On Apr 26, 1:58 am, Antoon Pardon <[EMAIL PROTECTED]> wrote: > On 2007-04-25, Stef Mientki <[EMAIL PROTECTED]> wrote: > > > hello, > > > As part of a procedure I've a number sequences like this: > > > > > if Print_Info: print Datafile.readline() > > else:Datafile.readline(

Re: conditional print statement ?

2007-04-26 Thread stef
Antoon Pardon wrote: > On 2007-04-25, Stef Mientki <[EMAIL PROTECTED]> wrote: > >> hello, >> >> >> As part of a procedure I've a number sequences like this: >> >> >> if Print_Info: print Datafile.readline() >> else:Datafile.readline() >> >> >> Is there a more compress

Re: conditional print statement ?

2007-04-26 Thread Antoon Pardon
On 2007-04-25, Stef Mientki <[EMAIL PROTECTED]> wrote: > hello, > > > As part of a procedure I've a number sequences like this: > > > if Print_Info: print Datafile.readline() > else:Datafile.readline() > > > Is there a more compressed way to write such a statement, > espec

Re: conditional print statement ?

2007-04-25 Thread Terry Reedy
"Stef Mientki" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | if Print_Info: print Datafile.readline() | else:Datafile.readline() Since both branches discard the data read, I presume Martin's fix is what you really want. | Is there a more compressed way t

Re: conditional print statement ?

2007-04-25 Thread Martin v. Löwis
Stef Mientki schrieb: > hello, > > > As part of a procedure I've a number sequences like this: > > > if Print_Info: print Datafile.readline() > else:Datafile.readline() > > > Is there a more compressed way to write such a statement, > especially I dislike the redundanc

conditional print statement ?

2007-04-25 Thread Stef Mientki
hello, As part of a procedure I've a number sequences like this: if Print_Info: print Datafile.readline() else:Datafile.readline() Is there a more compressed way to write such a statement, especially I dislike the redundancy "Datafile.readline()". thanks, Stef Mient

Re: the print statement

2006-05-08 Thread Tim Roberts
Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: >On Sun, 07 May 2006 00:09:06 GMT, Tim Roberts <[EMAIL PROTECTED]> declaimed >the following in comp.lang.python: > >> [EMAIL PROTECTED] wrote: >> >> >6) Would it be correct to infer that the print statement

Re: the print statement

2006-05-07 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > Thank you. Yes, that post answers most of the questions. I now have a > bit of an understanding of the \xhh pattern. It's still unclear to me, > however, how one can go from the \x92 pattern and arrive at the > apostrophe character. Is \x92 theh apostrophe character i

Re: the print statement

2006-05-06 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > bit of an understanding of the \xhh pattern. It's still unclear to me, > however, how one can go from the \x92 pattern and arrive at the > apostrophe character. Is \x92 the apostrophe character in another > character set? If so, whi

Re: the print statement

2006-05-06 Thread mirandacascade
Thank you. Yes, that post answers most of the questions. I now have a bit of an understanding of the \xhh pattern. It's still unclear to me, however, how one can go from the \x92 pattern and arrive at the apostrophe character. Is \x92 theh apostrophe character in another character set? If so,

Re: the print statement

2006-05-06 Thread Tim Roberts
our VGA font happens to display "left single quote" and "right single quote" with the same glyph as "apostrophe". >4) what is the role/function of the backslash character in the variable >y? See above. \x introduces a hex character. \047 is another special sequ

Re: the print statement

2006-05-06 Thread Ben Finney
[EMAIL PROTECTED] writes: > My questions are: Mostly answered in the language reference: http://docs.python.org/ref/strings.html> -- \ "Facts are meaningless. You could use facts to prove anything | `\ that's even remotely true!" -- Homer, _The Simpsons_ | _o__)

the print statement

2006-05-06 Thread mirandacascade
e y a signal that what follows is a hex value? 2) is it more than just a coincidence that 146 (the result of ord(y[3])) is the decimal equivalent of the hex number 92? 3) is there any character set in which 146 represents the single-quote/apostrophe character? if so, which character set? 4) what i

Re: (Fucking) Unicode: console print statement and PythonWin: replacement for off-table chars HOWTO?

2006-01-11 Thread Neil Hodgson
Robert: > After "is_platform_unicode = ", scintilla displays some unicode > as you showed. but the win32-functions (e.g. MessageBox) still do not > pass through wide unicode. Win32 issues are better discussed on the python-win32 mailing list which is read by more of the people interested in

Re: (Fucking) Unicode: console print statement and PythonWin: replacement for off-table chars HOWTO?

2006-01-11 Thread Thomas Heller
"Robert" <[EMAIL PROTECTED]> writes: > > Guess I have to create special C-code for my major wide unicode needs - > especially listctrl-SetItem and TextOut-Stuff... > > Or does anybody know of some existing wide-unicode functions/C-code > parallel to normal pywin32? You could use ctypes to access

Re: (Fucking) Unicode: console print statement and PythonWin: replacement for off-table chars HOWTO?

2006-01-11 Thread Robert
Neil Hodgson schrieb: > Robert: > PythonWin did have some Unicode support but I think Mark Hammond was > discouraged by bugs. In pythonwin/__init__.py there is a setting > is_platform_unicode = 0 with a commented out real test for Unicode on > the next line. Change this to 1 and restart and yo

Re: (Fucking) Unicode: console print statement and PythonWin: replacement for off-table chars HOWTO?

2006-01-10 Thread Neil Hodgson
Robert: > u'sytest3\\\u041f\u043e\u0448\u0443\u043a.txt' > > u'\u043a' is cyrillic: к > > no matter, I guess no (small) system can know all unicode ranges in use > wordwide. The real problem is: to get a smoot, smart an tolerant setup > by default - not a mixup of 4 codecs and (most bothersome)

Re: Unicode: console print statement and PythonWin: replacement for off-table chars HOWTO?

2006-01-10 Thread Robert
Fredrik Lundh wrote: > > Are you certain that this is a valid unicode character? Checking other > > values (like \u0020 which is a blank space) seems to work okay. What > > does \u034A represent? > > >>> import unicodedata > >>> unicodedata.name(u"\u034A") > 'COMBINING NOT TILDE ABOVE' > > (space

Re: Unicode: console print statement and PythonWin: replacement for off-table chars HOWTO?

2006-01-10 Thread Fredrik Lundh
> Are you certain that this is a valid unicode character? Checking other > values (like \u0020 which is a blank space) seems to work okay. What > does \u034A represent? >>> import unicodedata >>> unicodedata.name(u"\u034A") 'COMBINING NOT TILDE ABOVE' (space is a valid CP850 character, combining

Re: (Fucking) Unicode: console print statement and PythonWin: replacement for off-table chars HOWTO?

2006-01-10 Thread Robert
gregarican wrote: > Robert wrote: > > > (windows or linux console) > > > > >>> print u'\u034a' > > > > Traceback (most recent call last): > > File "", line 1, in ? > > File "C:\PYTHON23\lib\encodings\cp850.py", line 18, in encode > > return codecs.charmap_encode(input,errors,encoding_map) >

Re: (Fucking) Unicode: console print statement and PythonWin: replacement for off-table chars HOWTO?

2006-01-10 Thread gregarican
Robert wrote: > (windows or linux console) > > > > >>> print u'\u034a' > > > Traceback (most recent call last): > File "", line 1, in ? > File "C:\PYTHON23\lib\encodings\cp850.py", line 18, in encode > return codecs.charmap_encode(input,errors,encoding_map) > UnicodeEncodeError: 'charmap'

(Fucking) Unicode: console print statement and PythonWin: replacement for off-table chars HOWTO?

2006-01-10 Thread Robert
armap' codec can't encode character u'\u034a' in position 0: character maps to >>> How to get a replacement behaviour into Python's print statement generally ? Fumble on sys.stdout/stderr? sys.stdout.write(u) puts at least random chars. Thus print seems to do

Re: Simple (?) question about print statement

2005-12-14 Thread Dan M
On Wed, 14 Dec 2005 15:27:58 -0800, TY wrote: > So I guess then my next question is why does adding comma to print > statement cause buffering, but not when you don't have comma? Because of the line buffering. If you don't have a comma at the end, the print statement prints the n

Re: Simple (?) question about print statement

2005-12-14 Thread TY
So I guess then my next question is why does adding comma to print statement cause buffering, but not when you don't have comma? -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple (?) question about print statement

2005-12-14 Thread Grant Edwards
On 2005-12-14, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Grant Edwards wrote: > >> > try this instead: >> > >> > import time, sys >> > >> > for i in range(10): >> > time.sleep(0.8) # seconds; tune as necessary >> > print i, >> > sys.stdout.flush() # flush stdout >>

Re: Simple (?) question about print statement

2005-12-14 Thread Fredrik Lundh
Grant Edwards wrote: > > try this instead: > > > > import time, sys > > > > for i in range(10): > > time.sleep(0.8) # seconds; tune as necessary > > print i, > > sys.stdout.flush() # flush stdout > > print > > Is mixing print and sys.stdout.X never a problem

Re: Simple (?) question about print statement

2005-12-14 Thread Grant Edwards
On 2005-12-14, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > try this instead: > > import time, sys > > for i in range(10): > time.sleep(0.8) # seconds; tune as necessary > print i, > sys.stdout.flush() # flush stdout > print Is mixing print and sys.stdout.X n

Re: Simple (?) question about print statement

2005-12-14 Thread Fredrik Lundh
ints 1 on the next line prints 2 > etc. > > But if you add a comma at the end of print statement on the last line > like this: > > for i in range(10): > for j in range(500): pass # Timing-delay loop > print i, > > Now it does this: > > then p

Re: Simple (?) question about print statement

2005-12-14 Thread Pelmen
sorry ... i don'understand a question from first read my previos aswer is not an aswer at all -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple (?) question about print statement

2005-12-14 Thread Grant Edwards
On 2005-12-14, TY <[EMAIL PROTECTED]> wrote: > for i in range(10): > for j in range(500): pass # Timing-delay loop > print i, > > Now it does this: > > then prints 0 1 2 3 4 5 6 7 8 9 all at once. > > Why? > > How can I make it to print each numbers on the same line with pauses

Re: Simple (?) question about print statement

2005-12-14 Thread Pelmen
>From doc: range( [start,] stop[, step]) This is a versatile function to create lists containing arithmetic progressions. It is most often used in for loops. The arguments must be plain integers. If the step argument is omitted, it defaults to 1. If the start argument is omitted, it defaults to 0

Simple (?) question about print statement

2005-12-14 Thread TY
print statement on the last line like this: for i in range(10): for j in range(500): pass # Timing-delay loop print i, Now it does this: then prints 0 1 2 3 4 5 6 7 8 9 all at once. Why? How can I make it to print each numbers on the same line with pauses in between them

Re: newbie question; output from simple print statement

2005-08-05 Thread epost2
thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie question; output from simple print statement

2005-08-05 Thread Paul Watson
est.py > ['test1.txt'] > files in c:\ :None The function ListFiles() is being called first. This produces the result that will be used to replace the %s of the print statement. In this case, the return value is None, so nothing is printed. How to Think Like a Computer Scientist http://www.ibiblio.org.obp/thinkCSpy/ -- http://mail.python.org/mailman/listinfo/python-list

newbie question; output from simple print statement

2005-08-05 Thread epost2
Can someone explain to me the output of this simple script? I wonder why ['test1.txt'] is printed before "files in c:\", and also why None shows up? in file test.py: def main(): print "files in c:\ :%s" % ListFiles("c:\") def ListFiles(path): for root,dirs,files in os.

Re: Q: The `print' statement over Unicode

2005-05-08 Thread "Martin v. Löwis"
Jeremy Bowers wrote: > Then I'd honor his consistency of belief, but still consider it impolite > in general, as asking someone to do tons of work overall to save you a bit > is almost always impolite. This is not what he did, though - he did not break "the protocol" by sending in patches by email

Re: Q: The `print' statement over Unicode

2005-05-08 Thread Jeremy Bowers
On Sun, 08 May 2005 13:46:22 +, John J. Lee wrote: > I don't mean to put words into FranÃois' mouth, but IIRC he managed, > for example, GNU tar for some time and, while using some kind of > tracking system "under the covers", didn't impose it on his users. > > IMVHO, that was very nice of him

Re: Q: The `print' statement over Unicode

2005-05-08 Thread John J. Lee
Jeremy Bowers <[EMAIL PROTECTED]> writes: > On Sat, 07 May 2005 12:10:46 -0400, François Pinard wrote: > > > [Martin von Löwis] > > > >> François Pinard wrote: > >> > >> > Am I looking in the wrong places, or else, should not the standard > >> > documentation more handily explain such things? >

Re: Q: The `print' statement over Unicode

2005-05-07 Thread Jeremy Bowers
On Sat, 07 May 2005 12:10:46 -0400, FranÃois Pinard wrote: > [Martin von LÃwis] > >> FranÃois Pinard wrote: >> >> > Am I looking in the wrong places, or else, should not the standard >> > documentation more handily explain such things? > >> It should, but, alas, it doesn't. Contributions are wel

Re: Q: The `print' statement over Unicode

2005-05-07 Thread "Martin v. Löwis"
François Pinard wrote: > My contributions are not that welcome. If they were, the core team > would not try forcing me into using robots and bug trackers! :-) Ok, then we need to wait for somebody else to contribute a documentation patch. > Thanks. Your kind explanation, above, should make it,

Re: Q: The `print' statement over Unicode

2005-05-07 Thread François Pinard
[Martin von Löwis] > François Pinard wrote: > > > Am I looking in the wrong places, or else, should not the standard > > documentation more handily explain such things? > It should, but, alas, it doesn't. Contributions are welcome. My contributions are not that welcome. If they were, the core t

Re: Q: The `print' statement over Unicode

2005-05-07 Thread "Martin v. Löwis"
François Pinard wrote: > Am I looking in the wrong places, or else, should not the standard > documentation more handily explain such things? It should, but, alas, it doesn't. Contributions are welcome. The algorithm to set sys.std{in,out}.encoding is in sysmodule.c:_PySys_Init and pythonrun.c:Py

Re: Q: The `print' statement over Unicode

2005-05-07 Thread François Pinard
code string. Much thanks for this information. I was not aware of this file attribute. Looking around, I found a quick description in the Library Reference, under "2.3.8 File Objects". However, I did not find in the documentation the rules stating how or when this attribute receives a

Re: Q: The `print' statement over Unicode

2005-05-04 Thread Thomas Heller
t; > However, this morning, I mistakenly forgot to do so before using one > Unicode string (containing a non-ASCII character) as an argument to > the `print' statement, and I did _not_ get an error. This is rather > surprising to me. I reread the section of the Python reference ma

Q: The `print' statement over Unicode

2005-05-04 Thread François Pinard
icode string (containing a non-ASCII character) as an argument to the `print' statement, and I did _not_ get an error. This is rather surprising to me. I reread the section of the Python reference manual (version 2.3.4, this machine uses 2.3.3 currently), and it does not say anything about

Re: cgi "print statement" in multithreaded enviroment?

2005-05-03 Thread Scott David Daniels
vegetax wrote: > So it would be something like this, right?? > > class ThreadSpecificFile: > def __init__(s): > self.files = [] > def set_stdout(f,thread_id): > self.files[thread_id] = f > def clean_up(thread_id): > del self.files[t

Re: cgi "print statement" in multithreaded enviroment?

2005-05-02 Thread vegetax
Bengt Richter wrote: > On Mon, 02 May 2005 20:24:02 -0400, vegetax <[EMAIL PROTECTED]> wrote: > >>Irmen de Jong wrote: >> >>> vegetax wrote: >>>> How can i use cgi'like print statement in a multitreaded web framework? >>>> each thr

Re: cgi "print statement" in multithreaded enviroment?

2005-05-02 Thread vegetax
vegetax wrote: > Jeff Epler wrote: > >> You could write something like >> class ThreadSpecificFile: >> def set_stdout(f): >> self.files[thread_id] = f >> def write(data): >> self.files[thread_id].write(data) >> sys.stdout = ThreadSpecificFile() >> w

Re: cgi "print statement" in multithreaded enviroment?

2005-05-02 Thread Bengt Richter
On Mon, 02 May 2005 20:24:02 -0400, vegetax <[EMAIL PROTECTED]> wrote: >Irmen de Jong wrote: > >> vegetax wrote: >>> How can i use cgi'like print statement in a multitreaded web framework? >>> each thread has its own Servlet instance with request/respons

Re: cgi "print statement" in multithreaded enviroment?

2005-05-02 Thread vegetax
Jeff Epler wrote: > You could write something like > class ThreadSpecificFile: > def set_stdout(f): > self.files[thread_id] = f > def write(data): > self.files[thread_id].write(data) > sys.stdout = ThreadSpecificFile() > where you'll have to fill out

  1   2   >