Sergiy wrote:
> print 1 / 2
> print -1 / 2
>
> 0
> -1
>
> correct?
Yes. It works like the floor() function.
>>> import math
>>> math.floor(1.0 / 2)
0.0
>>> math.floor(-1.0 / 2)
-1.0
Shane
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, 26 Apr 2007 21:35:03 +0300, Sergiy <[EMAIL PROTECTED]> wrote:
>print 1 / 2
>print -1 / 2
>
>0
>-1
>
>correct?
Quoting http://www.python.org/doc/lib/typesnumeric.html:
(1)
For (plain or long) integer division, the result is an integer.
The result is always rounded towards minus infin
[EMAIL PROTECTED] wrote:
> Learn something every day. I take it "646" is an alias for "ascii" (or vice
> versa)?
Usage of "646" as an alias for ASCII is primarily a Sun invention. When
ASCII became an international standard, its standard number became
ISO/IEC 646:1968. It's not *quite* the same a
In article <[EMAIL PROTECTED]>,
"Serge Orlov" <[EMAIL PROTECTED]> wrote:
> Serge Orlov wrote:
> > Ron Garret wrote:
> > > In article <[EMAIL PROTECTED]>,
> > > "Serge Orlov" <[EMAIL PROTECTED]> wrote:
> > >
> > > > Ron Garret wrote:
> > > > > > > I'm using an OS X terminal to ssh to a Linux mach
In article <[EMAIL PROTECTED]>,
"Serge Orlov" <[EMAIL PROTECTED]> wrote:
> Ron Garret wrote:
> > In article <[EMAIL PROTECTED]>,
> > "Serge Orlov" <[EMAIL PROTECTED]> wrote:
> >
> > > Ron Garret wrote:
> > > > > > I'm using an OS X terminal to ssh to a Linux machine.
> > > > >
> > > > > In theor
[EMAIL PROTECTED] wrote:
> Robert> Because sys.stdout.encoding isn't determined by your Python
> Robert> configuration, but your terminal's.
>
> Learn something every day. I take it "646" is an alias for "ascii" (or vice
> versa)?
>
> % python
> Python 2.4.2 (#1, Feb 23 2006, 12:
[EMAIL PROTECTED] wrote:
> John> Hmm, not that this helps me any :)
>
> import sys
> sys.stdout.encoding
> John> 'cp1252'
>
> Sure it does. You can print Unicode objects which map to cp1252. I assume
> that means you're on Windows or that for some perverse reason you h
John> Hmm, not that this helps me any :)
import sys
sys.stdout.encoding
John> 'cp1252'
Sure it does. You can print Unicode objects which map to cp1252. I assume
that means you're on Windows or that for some perverse reason you have your
Mac's Terminal window set to cp
[EMAIL PROTECTED] wrote:
> Robert> Because sys.stdout.encoding isn't determined by your Python
> Robert> configuration, but your terminal's.
>
> Learn something every day. I take it "646" is an alias for "ascii" (or vice
> versa)?
Hmm, not that this helps me any :)
>>> import sys
>>>
Robert> Because sys.stdout.encoding isn't determined by your Python
Robert> configuration, but your terminal's.
Learn something every day. I take it "646" is an alias for "ascii" (or vice
versa)?
% python
Python 2.4.2 (#1, Feb 23 2006, 12:48:31)
[GCC 3.4.1] on sunos5
Typ
John Salerno wrote:
> AFAIK, I'm all ASCII (at least, I never made explicit changes to the
> default Python install), so how am I able to print out the character?
Because sys.stdout.encoding isn't determined by your Python configuration, but
your terminal's.
--
Robert Kern
"I have come to bel
Fredrik Lundh wrote:
> Ron Garret wrote:
>
> u'\xbd'
>> u'\xbd'
> print _
>> Traceback (most recent call last):
>> File "", line 1, in ?
>> UnicodeEncodeError: 'ascii' codec can't encode character u'\xbd' in
>> position 0: ordinal not in range(128)
>
> so stdout on your machine is asci
Ron Garret a écrit :
> In article <[EMAIL PROTECTED]>,
> Fredrik Lundh <[EMAIL PROTECTED]> wrote:
>
>> Ron Garret wrote:
>>
>> u'\xbd'
>>> u'\xbd'
>> print _
>>> Traceback (most recent call last):
>>> File "", line 1, in ?
>>> UnicodeEncodeError: 'ascii' codec can't encode character u'\
Serge Orlov wrote:
> Ron Garret wrote:
> > In article <[EMAIL PROTECTED]>,
> > "Serge Orlov" <[EMAIL PROTECTED]> wrote:
> >
> > > Ron Garret wrote:
> > > > > > I'm using an OS X terminal to ssh to a Linux machine.
> > > > >
> > > > > In theory it should work out of the box. OS X terminal should se
Ron Garret wrote:
> In article <[EMAIL PROTECTED]>,
> "Serge Orlov" <[EMAIL PROTECTED]> wrote:
>
> > Ron Garret wrote:
> > > > > I'm using an OS X terminal to ssh to a Linux machine.
> > > >
> > > > In theory it should work out of the box. OS X terminal should set
> > > > enviromental variable LAN
In article <[EMAIL PROTECTED]>,
"Serge Orlov" <[EMAIL PROTECTED]> wrote:
> Ron Garret wrote:
> > > > I'm using an OS X terminal to ssh to a Linux machine.
> > >
> > > In theory it should work out of the box. OS X terminal should set
> > > enviromental variable LANG=en_US.utf-8, then ssh should tr
Ron Garret wrote:
> > > I'm using an OS X terminal to ssh to a Linux machine.
> >
> > In theory it should work out of the box. OS X terminal should set
> > enviromental variable LANG=en_US.utf-8, then ssh should transfer this
> > variable to Linux and python will know that your terminal is utf-8.
>
In article <[EMAIL PROTECTED]>,
"Serge Orlov" <[EMAIL PROTECTED]> wrote:
> Ron Garret wrote:
> > In article <[EMAIL PROTECTED]>,
> > "Serge Orlov" <[EMAIL PROTECTED]> wrote:
> >
> > > Ron Garret wrote:
> > > > In article <[EMAIL PROTECTED]>,
> > > > Robert Kern <[EMAIL PROTECTED]> wrote:
> > >
Ron Garret wrote:
> In article <[EMAIL PROTECTED]>,
> Robert Kern <[EMAIL PROTECTED]> wrote:
>
>>Ron Garret wrote:
>>
>>>I'm using an OS X terminal to ssh to a Linux machine.
>>
>>Click on the "Terminal" menu, then "Window Settings...". Choose "Display"
>>from
>>the combobox. At the bottom you w
Ron Garret wrote:
> In article <[EMAIL PROTECTED]>,
> "Serge Orlov" <[EMAIL PROTECTED]> wrote:
>
> > Ron Garret wrote:
> > > In article <[EMAIL PROTECTED]>,
> > > Robert Kern <[EMAIL PROTECTED]> wrote:
> > >
> > > > Ron Garret wrote:
> > > >
> > > > > I forgot to mention:
> > > > >
> > > > sy
In article <[EMAIL PROTECTED]>,
Robert Kern <[EMAIL PROTECTED]> wrote:
> Ron Garret wrote:
>
> > I'm using an OS X terminal to ssh to a Linux machine.
>
> Click on the "Terminal" menu, then "Window Settings...". Choose "Display"
> from
> the combobox. At the bottom you will see a combobox titl
Ron Garret wrote:
>
> But what about this:
>
> >>> f2=open('foo','w')
> >>> f2.write(u'\xFF')
> Traceback (most recent call last):
> File "", line 1, in ?
> UnicodeEncodeError: 'ascii' codec can't encode character u'\xff' in
> position 0: ordinal not in range(128)
> >>>
>
> That should have nothi
Ron Garret wrote:
> I'm using an OS X terminal to ssh to a Linux machine.
Click on the "Terminal" menu, then "Window Settings...". Choose "Display" from
the combobox. At the bottom you will see a combobox title "Character Set
Encoding". Choose "Unicode (UTF-8)".
> But what about this:
>
f2=
In article <[EMAIL PROTECTED]>,
"Serge Orlov" <[EMAIL PROTECTED]> wrote:
> Ron Garret wrote:
> > In article <[EMAIL PROTECTED]>,
> > Robert Kern <[EMAIL PROTECTED]> wrote:
> >
> > > Ron Garret wrote:
> > >
> > > > I forgot to mention:
> > > >
> > > sys.getdefaultencoding()
> > > >
> > > > 'u
Ron Garret wrote:
> In article <[EMAIL PROTECTED]>,
> Robert Kern <[EMAIL PROTECTED]> wrote:
>
> > Ron Garret wrote:
> >
> > > I forgot to mention:
> > >
> > sys.getdefaultencoding()
> > >
> > > 'utf-8'
> >
> > A) You shouldn't be able to do that.
>
> What can I say? I can.
>
> > B) Don't do
Ron Garret wrote:
> In article <[EMAIL PROTECTED]>,
> Robert Kern <[EMAIL PROTECTED]> wrote:
>
>>Ron Garret wrote:
>>
>>>I forgot to mention:
>>>
>>>
>>sys.getdefaultencoding()
>>>
>>>'utf-8'
>>
>>A) You shouldn't be able to do that.
>
> What can I say? I can.
See B).
>>B) Don't do that.
In article <[EMAIL PROTECTED]>,
Robert Kern <[EMAIL PROTECTED]> wrote:
> Ron Garret wrote:
>
> > I forgot to mention:
> >
> sys.getdefaultencoding()
> >
> > 'utf-8'
>
> A) You shouldn't be able to do that.
What can I say? I can.
> B) Don't do that.
OK. What should I do instead?
> C)
Ron Garret wrote:
> I forgot to mention:
>
sys.getdefaultencoding()
>
> 'utf-8'
A) You shouldn't be able to do that.
B) Don't do that.
C) It's not relevant to the encoding of stdout which determines how unicode
strings get converted to bytes when printing them:
>>> import sys
>>> sys.stdou
In article <[EMAIL PROTECTED]>,
Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> Ron Garret wrote:
>
> u'\xbd'
> > u'\xbd'
> print _
> > Traceback (most recent call last):
> > File "", line 1, in ?
> > UnicodeEncodeError: 'ascii' codec can't encode character u'\xbd' in
> > position 0: ord
Ron Garret wrote:
u'\xbd'
> u'\xbd'
print _
> Traceback (most recent call last):
> File "", line 1, in ?
> UnicodeEncodeError: 'ascii' codec can't encode character u'\xbd' in
> position 0: ordinal not in range(128)
so stdout on your machine is ascii, and you don't understand why you
Ron Garret wrote:
u'\xbd'
> u'\xbd'
print _
> Traceback (most recent call last):
> File "", line 1, in ?
> UnicodeEncodeError: 'ascii' codec can't encode character u'\xbd' in
> position 0: ordinal not in range(128)
Not sure if this really helps you, but:
>>> u'\xbd'
u'\xbd'
>>> pri
[James Stroud]
> Why do my posts get held for suspcious headers
You're probably trying to post through the python-list email address,
which has had SPAM problems in the past, because the email address has
been used by spammers as a forged from address, meaning the bounces
would go to everyone,
On Tue, 1 Nov 2005, James Stroud wrote:
> Why do my posts get held for suspcious headers and troll Xha Lee gets to post
> all sorts of profanity and ranting without any problem?
>
I like many others have had the same experience.
I recently choose to respond to one of Xha Lee's post and my
Re (
On 2005-11-01, James Stroud <[EMAIL PROTECTED]> wrote:
> On Tuesday 01 November 2005 14:26, Grant Edwards wrote:
>> On 2005-11-01, James Stroud <[EMAIL PROTECTED]> wrote:
>> > Why do my posts get held for suspcious headers
> ...
>> Held? It's not a moderated group...
>
> And I quoteth (that's King
happens to me too.
--
http://mail.python.org/mailman/listinfo/python-list
On Tuesday 01 November 2005 14:26, Grant Edwards wrote:
> On 2005-11-01, James Stroud <[EMAIL PROTECTED]> wrote:
> > Why do my posts get held for suspcious headers
...
> Held? It's not a moderated group...
And I quoteth (that's King James for "cuteth-and-pasteth"):
> Your mail to 'Python-list' w
On 2005-11-01, James Stroud <[EMAIL PROTECTED]> wrote:
> Why do my posts get held for suspcious headers and troll Xha
> Lee gets to post all sorts of profanity and ranting without
> any problem?
Held? It's not a moderated group...
--
Grant Edwards grante Yow! I'm
On 11/1/05, James Stroud <[EMAIL PROTECTED]> wrote:
Why do my posts get held for suspcious headers and troll Xha Lee gets to postall sorts of profanity and ranting without any problem?--James StroudUCLA-DOE Institute for Genomics and ProteomicsBox 951570
Los Angeles, CA 90095http://www.jamesstroud.
38 matches
Mail list logo