On Saturday, June 1, 2013 at 9:14:36 PM UTC+5:30, Νικόλαος Κούρας wrote:
> /home/nikos/public_html/cgi-bin/metrites.py in ()
> 217 template = htmldata + counter
> 218 elif page.endswith('.py'):
> => 219 htmldata = subprocess.check_output(
> '/home/n
On 12/31/2015 11:24 AM, ebuka ogbonnaya wrote:
my name is Ebuka Egbunine, from Nigeria.I studied Geology and
mining.Actually i downloaded python3.5(32-bit) successfully on my laptop
which operates on 32-bit memory, but the application is not opening, it
displays the message " the program can't st
On Thu, 31 Dec 2015 08:24:15 -0800, ebuka ogbonnaya wrote:
> my name is Ebuka Egbunine, from Nigeria.I studied Geology and
> mining.Actually i downloaded python3.5(32-bit) successfully on my laptop
> which operates on 32-bit memory, but the application is not opening, it
> displays the message " t
On 31/12/2015 16:24, ebuka ogbonnaya wrote:
my name is Ebuka Egbunine, from Nigeria.I studied Geology and
mining.Actually i downloaded python3.5(32-bit) successfully on my laptop
which operates on 32-bit memory, but the application is not opening, it
displays the message " the program can't start
On 12/31/2015 11:24 AM, ebuka ogbonnaya wrote:
my name is Ebuka Egbunine, from Nigeria.I studied Geology and
mining.Actually i downloaded python3.5(32-bit) successfully on my laptop
which operates on 32-bit memory, but the application is not opening, it
displays the message " the program can't st
my name is Ebuka Egbunine, from Nigeria.I studied Geology and
mining.Actually i downloaded python3.5(32-bit) successfully on my laptop
which operates on 32-bit memory, but the application is not opening, it
displays the message " the program can't start because api-ms-crt
runtime-l1-1-0.dll is miss
In article , John Nagle
wrote:
> Then upgrade to 3D. You can represent latitude and longitude
> as a 3-element unit vector. (GPS systems do this; latitude and
> longitude are only generated at the end, for output.)
And annoyingly so. Somebody I know was building a tracking system based
on a
On 10/10/2013 6:27 PM, Steven D'Aprano wrote:
> For what it's worth, there is no three-dimensional extension to complex
> numbers, but there is a four-dimensional one, the quaternions or
> hypercomplex numbers. They look like 1 + 2i + 3j + 4k, where i, j and k
> are all distinct but i**2 == j**2
On Friday 11 October 2013 12:49:40 Roy Smith did opine:
> In article ,
>
> Oscar Benjamin wrote:
> > If someone tried to explain why their field couldn't use ً for the
> > circumference of a unit circle I would suggest that they adjust the
> > other parts of their notation not ً (there are othe
On Fri, 11 Oct 2013 10:05:03 -0400, Roy Smith wrote:
> In article ,
> Oscar Benjamin wrote:
>
>> If someone tried to explain why their field couldn't use ð for the
>> circumference of a unit circle I would suggest that they adjust the
>> other parts of their notation not ð (there are other uses
On 11 October 2013 10:11, Steven D'Aprano
wrote:
> On Fri, 11 Oct 2013 09:17:37 +0100, Joshua Landau wrote:
>
>> On 11 October 2013 03:08, Steven D'Aprano
>> wrote:
>>>
>>> Given:
>>>
>>> x ∈ ℝ, x = 2 (reals)
>>> y ∈ ℕ, y = 2 (natural numbers)
>>>
>>> we have x = y, but since 1/y is undefined (
In article ,
Oscar Benjamin wrote:
> If someone tried to explain why their field couldn't use ð for the
> circumference of a unit circle I would suggest that they adjust the
> other parts of their notation not ð (there are other uses of ð.
Pi is wrong:
http://www.youtube.com/watch?v=jG7vhMMX
On 2013-10-11, Steven D'Aprano wrote:
> On Thu, 10 Oct 2013 17:48:16 +, Neil Cerutti wrote:
>
>> >>> 5.0 == abs(3 + 4j)
>> False
>
> Did you maybe accidentally rebind abs? If not, what version of
> Python are you using?
Honestly, I think I got my Python term and my Vim term mixed up.
I Shall
Oscar Benjamin writes:
> tried to explain why their field couldn't use π for the
> circumference of a unit circle I would suggest that they adjust the
> other parts of their notation not π (there are other uses of π.
There's τ for the full circle; π is used for half the circumference.
--
https
On 11 October 2013 10:35, David wrote:
> On 11 October 2013 12:27, Steven D'Aprano
> wrote:
>> On Fri, 11 Oct 2013 00:25:27 +1100, Chris Angelico wrote:
>>
>>> On Fri, Oct 11, 2013 at 12:09 AM, Roy Smith wrote:
BTW, one of the earliest things that turned me on to Python was when I
disc
On Thu, 10 Oct 2013 14:12:36 +, Grant Edwards wrote:
> Nope. "i" is electical current (though it's more customary to use upper
> case).
"I" is steady-state current (either AC or DC), "i" is small-signal
current.
--
https://mail.python.org/mailman/listinfo/python-list
On Fri, Oct 11, 2013 at 8:11 PM, Steven D'Aprano
wrote:
> If you implicitly decide to promote entities, then of course you can
> promote y to a real then take the invoice.
Either you're channelling Bugs Bunny or you're trying to sell me
something... you mean "take the inverse", I assume, here :)
On 11 October 2013 12:27, Steven D'Aprano
wrote:
> On Fri, 11 Oct 2013 00:25:27 +1100, Chris Angelico wrote:
>
>> On Fri, Oct 11, 2013 at 12:09 AM, Roy Smith wrote:
>>> BTW, one of the earliest things that turned me on to Python was when I
>>> discovered that it uses j as the imaginary unit, not
On Fri, 11 Oct 2013 09:17:37 +0100, Joshua Landau wrote:
> On 11 October 2013 03:08, Steven D'Aprano
> wrote:
>> Your mistake here seems to be that you're assuming that if two numbers
>> are equal, they must be in the same domain, but that's not the case.
>> (Perhaps you think that 0.0 == 0+0j sh
On 11 October 2013 03:08, Steven D'Aprano
wrote:
> Your mistake here seems to be that you're assuming that if two numbers
> are equal, they must be in the same domain, but that's not the case.
> (Perhaps you think that 0.0 == 0+0j should return False?) It's certainly
> not the case when it comes t
On Fri, Oct 11, 2013 at 11:13 AM, Dennis Lee Bieber
wrote:
> On Fri, 11 Oct 2013 01:20:01 +1100, Chris Angelico
> declaimed the following:
>
>>
>>This belongs in the Izzet League, I think.
>>
> Was that an MtG reference?
It most assuredly was. The Ravnican guild known as the Izzet League
On Thu, 10 Oct 2013 17:48:16 +, Neil Cerutti wrote:
> >>> 5.0 == abs(3 + 4j)
> False
Did you maybe accidentally rebind abs? If not, what version of Python are
you using?
[steve@ando ~]$ for a in 2.4 2.5 2.6 2.7 3.2 3.3 ; do
> python$a -c "print( 5.0 == abs(3 + 4j) )" ;
> done
True
True
Tr
On Thu, 10 Oct 2013 09:09:42 -0400, Roy Smith wrote:
> BTW, here's a Python equality oddity:
>
r = 0.0
c = 0 + 0j
r == c
> True
Mathematically, this is only to be expected.
int(r) == int(c)
> Traceback (most recent call last):
> File "", line 1, in
> TypeError: can't con
On Fri, 11 Oct 2013 00:25:27 +1100, Chris Angelico wrote:
> On Fri, Oct 11, 2013 at 12:09 AM, Roy Smith wrote:
>> BTW, one of the earliest things that turned me on to Python was when I
>> discovered that it uses j as the imaginary unit, not i. All
>> right-thinking people will agree with me on t
In article ,
Neil Cerutti wrote:
> >>> 5.0 == abs(3 + 4j)
> False
I'd like an argument, please.
--
https://mail.python.org/mailman/listinfo/python-list
On 11 October 2013 06:29, Oscar Benjamin wrote:
>
> I learned to use i for sqrt(-1) while studying theoretical physics.
> When I later found myself teaching maths to engineers I asked why j
> was used and was given this explanation. I'm still unconvinced by it
> though.
Please don't be. We need d
On 10Oct2013 17:48, Neil Cerutti wrote:
> On 2013-10-10, MRAB wrote:
> > If r is real (float) and c is complex:
> > r == c means r == c.real and c.imag == 0.0
>
> Woah. I thought I was going by what the docs say:
>
> Python fully supports mixed arithmetic: when a binary
> arithmetic op
On 2013-10-10, Oscar Benjamin wrote:
> On 10 October 2013 18:48, Neil Cerutti wrote:
>> I guess the "if appropriate" part eluded my eye. When *is* it
>> appropriate? Apparently not during an equal test.
>>
> 5.0 == abs(3 + 4j)
>> False
>
> If the above is genuine output then it's most likely
On 10 October 2013 18:48, Neil Cerutti wrote:
> I guess the "if appropriate" part eluded my eye. When *is* it
> appropriate? Apparently not during an equal test.
>
5.0 == abs(3 + 4j)
> False
If the above is genuine output then it's most likely floating point
error. I wouldn't expect any erro
On 10 October 2013 15:34, David wrote:
> On 11 October 2013 00:25, Chris Angelico wrote:
>> On Fri, Oct 11, 2013 at 12:09 AM, Roy Smith wrote:
>>
>> I've never been well-up on complex numbers; can you elaborate on this,
>> please? All I know is that I was taught that the square root of -1 is
>>
Am 10.10.13 18:54, schrieb Grant Edwards:
On 2013-10-10, Chris Angelico wrote:
On Fri, Oct 11, 2013 at 1:12 AM, Grant Edwards wrote:
Nope. "i" is electical current (though it's more customary to use
upper case). "j" is the square root of -1.
and that hypercomplex numbers include i, j, k,
On 2013-10-10, Ian Kelly wrote:
> On Thu, Oct 10, 2013 at 11:48 AM, Neil Cerutti wrote:
>> Woah. I thought I was going by what the docs say:
>>
>> Python fully supports mixed arithmetic: when a binary
>> arithmetic operator has operands of different numeric types,
>> the operand with the ?n
On Thu, Oct 10, 2013 at 11:48 AM, Neil Cerutti wrote:
> On 2013-10-10, MRAB wrote:
>> On 10/10/2013 16:57, Rotwang wrote:
>>> On 10/10/2013 16:51, Neil Cerutti wrote:
[...]
Mixed arithmetic always promotes to the wider type (except in
the case of complex numbers (Ha!)).
>
On 10/10/2013 07:20 AM, Chris Angelico wrote:
On Fri, Oct 11, 2013 at 1:12 AM, Grant Edwards wrote:
Nope. "i" is electical current (though it's more customary to use
upper case). "j" is the square root of -1.
and that hypercomplex numbers include i, j, k, and maybe even other
terms, and I n
On 2013-10-10, MRAB wrote:
> On 10/10/2013 16:57, Rotwang wrote:
>> On 10/10/2013 16:51, Neil Cerutti wrote:
>>> [...]
>>>
>>> Mixed arithmetic always promotes to the wider type (except in
>>> the case of complex numbers (Ha!)).
>>>
>>> r == c is equivalent to r == abs(c), which returns the magint
On 2013-10-10, Chris Angelico wrote:
> On Fri, Oct 11, 2013 at 1:12 AM, Grant Edwards
> wrote:
>> Nope. "i" is electical current (though it's more customary to use
>> upper case). "j" is the square root of -1.
>>
>>> and that hypercomplex numbers include i, j, k, and maybe even other
>>> terms
On Oct 10, 2013, at 10:12 AM, Grant Edwards wrote:
> On 2013-10-10, Chris Angelico wrote:
>> On Fri, Oct 11, 2013 at 12:09 AM, Roy Smith wrote:
>>> BTW, one of the earliest things that turned me on to Python was when I
>>> discovered that it uses j as the imaginary unit, not i. All
>>> right-t
On 10/10/2013 16:57, Rotwang wrote:
On 10/10/2013 16:51, Neil Cerutti wrote:
[...]
Mixed arithmetic always promotes to the wider type (except in
the case of complex numbers (Ha!)).
r == c is equivalent to r == abs(c), which returns the magintude
of the complex number.
What?
>>> -1 == -1 +
On 10/10/2013 16:51, Neil Cerutti wrote:
[...]
Mixed arithmetic always promotes to the wider type (except in
the case of complex numbers (Ha!)).
r == c is equivalent to r == abs(c), which returns the magintude
of the complex number.
What?
>>> -1 == -1 + 0j
True
>>> -1 == abs(-1 + 0j)
False
>
;> => evaluates as true
>>
>> http://wtfjs.com/2011/02/11/all-your-commas-are-belong-to-Array
>>
>> I swear, I am never going to complain about Python again.
>
> I've just finished reading JavaScript: The Good Parts, by Douglas
> Crockford (now I'm
On Thursday, October 10, 2013 8:04:00 PM UTC+5:30, David wrote:
> I have never heard the term "hypercomplex" numbers. I guess you
> are referring to vectors with more dimensions than two. A three
A generalization of quaternions :
http://en.wikipedia.org/wiki/Hypercomplex_number
http://en.wikipedia
On 11 October 2013 00:25, Chris Angelico wrote:
> On Fri, Oct 11, 2013 at 12:09 AM, Roy Smith wrote:
>
> I've never been well-up on complex numbers; can you elaborate on this,
> please? All I know is that I was taught that the square root of -1 is
> called i, and that hypercomplex numbers include
On Fri, Oct 11, 2013 at 1:12 AM, Grant Edwards wrote:
> Nope. "i" is electical current (though it's more customary to use
> upper case). "j" is the square root of -1.
>
>> and that hypercomplex numbers include i, j, k, and maybe even other
>> terms, and I never understood where j comes from. Why
On 2013-10-10, Chris Angelico wrote:
> On Fri, Oct 11, 2013 at 12:09 AM, Roy Smith wrote:
>> BTW, one of the earliest things that turned me on to Python was when I
>> discovered that it uses j as the imaginary unit, not i. All
>> right-thinking people will agree with me on this.
>
> I've never b
On 10/10/2013 14:25, Chris Angelico wrote:
On Fri, Oct 11, 2013 at 12:09 AM, Roy Smith wrote:
BTW, one of the earliest things that turned me on to Python was when I
discovered that it uses j as the imaginary unit, not i. All
right-thinking people will agree with me on this.
I've never been w
On Fri, Oct 11, 2013 at 12:09 AM, Roy Smith wrote:
> BTW, one of the earliest things that turned me on to Python was when I
> discovered that it uses j as the imaginary unit, not i. All
> right-thinking people will agree with me on this.
I've never been well-up on complex numbers; can you elabor
/11/all-your-commas-are-belong-to-Array
>
> I swear, I am never going to complain about Python again.
I've just finished reading JavaScript: The Good Parts, by Douglas
Crockford (now I'm working on the harder part of re-reading it slowly,
to make sure I really understand it). Anyb
his little Javascript gem:
>>>
>>> ",,," == Array((null,'cool',false,NaN,4));
>>>
>>> => evaluates as true
>>>
>>> http://wtfjs.com/2011/02/11/all-your-commas-are-belong-to-Array
>>>
>>> I swear, I am
On 2013-10-10 12:10, MRAB wrote:
> Re "==", this page:
>
> http://php.net/manual/en/language.operators.comparison.php
>
> states:
>
> """If you compare a number with a string or the *comparison involves
> numerical strings*, then each string is converted to a number and
> the comparison per
//wtfjs.com/2011/02/11/all-your-commas-are-belong-to-Array
I swear, I am never going to complain about Python again.
I am sure you know this, but for the record, Javascript has two equality
operators, '==' and '==='.
The double form attempts to coerce the left and ri
11/02/11/all-your-commas-are-belong-to-Array
>
> I swear, I am never going to complain about Python again.
>
I am sure you know this, but for the record, Javascript has two equality
operators, '==' and '==='.
The double form attempts to coerce the left and right side
Am 10.10.13 06:36, schrieb Steven D'Aprano:
Just came across this little Javascript gem:
",,," == Array((null,'cool',false,NaN,4));
=> evaluates as true
http://wtfjs.com/2011/02/11/all-your-commas-are-belong-to-Array
I swear, I am never going to complain about
>
> > http://wtfjs.com/2011/02/11/all-your-commas-are-belong-to-Array
> >
> > I swear, I am never going to complain about Python again.
>
> *blank look*
> Wow.
>
> Now, is there a situation in which this problem can actually crop up
> in production code?
O
On 10/10/2013 05:36, Steven D'Aprano wrote:
Just came across this little Javascript gem:
",,," == Array((null,'cool',false,NaN,4));
=> evaluates as true
http://wtfjs.com/2011/02/11/all-your-commas-are-belong-to-Array
I swear, I am never going to complain about
On Wed, Oct 9, 2013 at 9:36 PM, Steven D'Aprano wrote:
> Just came across this little Javascript gem:
>
> ",,," == Array((null,'cool',false,NaN,4));
>
> => evaluates as true
>
> http://wtfjs.com/2011/02/11/all-your-commas-are-belong-to-Array
>
On Thu, Oct 10, 2013 at 3:36 PM, Steven D'Aprano wrote:
> Just came across this little Javascript gem:
>
> ",,," == Array((null,'cool',false,NaN,4));
>
> => evaluates as true
>
> http://wtfjs.com/2011/02/11/all-your-commas-are-belong-to-Array
>
Just came across this little Javascript gem:
",,," == Array((null,'cool',false,NaN,4));
=> evaluates as true
http://wtfjs.com/2011/02/11/all-your-commas-are-belong-to-Array
I swear, I am never going to complain about Python again.
--
Steven
--
https://mail.pyth
' Server: ApacheBooster/1.6' isn't a signature of httpd. I think you are
really running something different.
> From: nob...@nowhere.com
> Subject: Re: Changing filenames from Greeklish => Greek (subprocess complain)
> Date: Tue, 4 Jun 2013 14:01:48 +0100
> To: pyth
On Sunday 02 June 2013 13:10:30 Chris Angelico did opine:
> On Mon, Jun 3, 2013 at 2:21 AM, حéêüëلïٍ تïٌلٍ
wrote:
> > Paying for someone to just remove a dash to get the script working is
> > too much to ask for
>
> One dash: 1c
> Knowing where to remove it: $99.99
> Total bill: $100.00
>
> K
> To: python-list@python.org
> From: breamore...@yahoo.co.uk
> Subject: Re: Changing filenames from Greeklish => Greek (subprocess complain)
> Date: Sun, 2 Jun 2013 15:51:31 +0100
[...]
> "Steve is going for the pink ball - and f
On 06/10/2013 01:11 AM, Νικόλαος Κούρας wrote:
Τη Δευτέρα, 10 Ιουνίου 2013 10:51:34 π.μ. UTC+3, ο χρήστης Larry Hudson έγραψε:
I mean utf-8 could use 1 byte for storing the 1st 256 characters. I meant up to
256, not above 256.
0 - 127, yes.
128 - 255 -> one byte of a multibyte code.
you m
On Monday, June 10, 2013 3:48:08 PM UTC-4, jmfauth wrote:
> -
>
>
>
> A coding scheme works with three sets. A *unique* set
> of CHARACTERS, a *unique* set of CODE POINTS and a *unique*
> set of ENCODED CODE POINTS, unicode or not.
>
> The relation between the set of characters and the set
-
A coding scheme works with three sets. A *unique* set
of CHARACTERS, a *unique* set of CODE POINTS and a *unique*
set of ENCODED CODE POINTS, unicode or not.
The relation between the set of characters and the set of the
code points is a *human* table, created with a sheet of paper
and a pe
Τη Δευτέρα, 10 Ιουνίου 2013 2:59:03 μ.μ. UTC+3, ο χρήστης Steven D'Aprano
έγραψε:
> On Mon, 10 Jun 2013 00:10:38 -0700, nagia.retsina wrote:
>
>
>
> > Τη Κυριακή, 9 Ιουνίου 2013 3:31:44 μ.μ. UTC+3, ο χρήστης Steven D'Aprano
>
> > έγραψε:
>
> >
>
> >> py> c = 'α'
>
> >> py> ord(c)
>
> >> 9
On Mon, 10 Jun 2013 00:10:38 -0700, nagia.retsina wrote:
> Τη Κυριακή, 9 Ιουνίου 2013 3:31:44 μ.μ. UTC+3, ο χρήστης Steven D'Aprano
> έγραψε:
>
>> py> c = 'α'
>> py> ord(c)
>> 945
>
> The number 945 is the characters 'α' ordinal value in the unicode
> charset correct?
Correct.
> The command i
On 10.06.2013 11:59, Νικόλαος Κούρας wrote:
s = 'α'
s.encode('utf-8')
> b'\xce\xb1'
'b' stands for binary right?
No, here it stands for bytes:
http://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals
b'\xce\xb1' = we are looking at a byte in a hexadecim
> s = 'α'
> s.encode('utf-8')
> > b'\xce\xb1'
'b' stands for binary right?
b'\xce\xb1' = we are looking at a byte in a hexadecimal format?
if yes how could we see it in binary and decimal represenation?
> > I see that the encoding of this char takes 2 bytes. But why two exactly
Τη Δευτέρα, 10 Ιουνίου 2013 11:15:38 π.μ. UTC+3, ο χρήστης Andreas Perstinger
έγραψε:
What is the difference between len('nikos') and len(b'nikos')
First beeing the length of string nikos in characters while the second being
the length of an ???
> The python interpreter will represent all valu
On 10.06.2013 09:10, nagia.rets...@gmail.com wrote:
Τη Κυριακή, 9 Ιουνίου 2013 3:31:44 μ.μ. UTC+3, ο χρήστης Steven D'Aprano έγραψε:
py> c = 'α'
py> ord(c)
945
The number 945 is the characters 'α' ordinal value in the unicode charset
correct?
Yes, the unicode character set is just a big li
Τη Δευτέρα, 10 Ιουνίου 2013 10:51:34 π.μ. UTC+3, ο χρήστης Larry Hudson έγραψε:
> > I mean utf-8 could use 1 byte for storing the 1st 256 characters. I meant
> > up to 256, not above 256.
> 0 - 127, yes.
> 128 - 255 -> one byte of a multibyte code.
you mean that in utf-8 for 1 character to be s
On 06/09/2013 03:37 AM, Νικόλαος Κούρας wrote:
I mean utf-8 could use 1 byte for storing the 1st 256 characters. I meant up to
256, not above 256.
NO!!
0 - 127, yes.
128 - 255 -> one byte of a multibyte code.
That's why the decode fails, it sees it as incomplete data so it can't do
anythi
Τη Κυριακή, 9 Ιουνίου 2013 3:31:44 μ.μ. UTC+3, ο χρήστης Steven D'Aprano έγραψε:
> py> c = 'α'
> py> ord(c)
> 945
The number 945 is the characters 'α' ordinal value in the unicode charset
correct?
The command in the python interactive session to show me how many bytes
this character will take u
On Sun, Jun 9, 2013 at 2:20 AM, Νικόλαος Κούρας wrote:
> Τη Κυριακή, 9 Ιουνίου 2013 12:12:36 μ.μ. UTC+3, ο χρήστης Cameron Simpson
> έγραψε:
>> On 09Jun2013 02:00, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?=
>> wrote:
>>
>> | Steven wrote:
>>
>> | >> Since 1 byte can hold up to 256 chars, why not
On Sun, Jun 9, 2013 at 2:38 AM, Νικόλαος Κούρας wrote:
> Τη Κυριακή, 9 Ιουνίου 2013 12:20:58 μ.μ. UTC+3, ο χρήστης Lele Gaifax έγραψε:
>
>> > How about a string i wonder?
>> > s = "νίκος"
>> > what_are these_bytes = s.encode('iso-8869-7').encode(utf-8')
>
>> Ignoring the usual syntax error, this i
Τη Κυριακή, 9 Ιουνίου 2013 3:36:51 μ.μ. UTC+3, ο χρήστης Steven D'Aprano έγραψε:
> > printing a greek Unicode string in the error with ASCII
> > as the output encoding (default when not a tty IIRC).
> An interesting thought. How would we test that?
Please elaborare this for me. I ditn undertood
On Sun, 09 Jun 2013 02:38:13 -0700, Νικόλαος Κούρας wrote:
> s = 'α'
> s = s.encode('iso-8859-7').decode('utf-8')
>
> UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe1 in position 0:
> unexpected end of data
>
> Why this error? because 'a' ordinal value > 127 ?
Look at it this way... co
On Sun, 09 Jun 2013 19:16:06 +1000, Cameron Simpson wrote:
> If he's lucky the UnicodeEncodeError occurred while trying to print an
> error message,
That's not what happens at the interactive console:
py> assert os.path.exists('Ж1')
Traceback (most recent call last):
File "", line 1, in
Ass
On Sun, 09 Jun 2013 02:00:46 -0700, Νικόλαος Κούρας wrote:
> Steven wrote:
>>> Since 1 byte can hold up to 256 chars, why not utf-8 use 1-byte for
>>> values up to 256?
>
>>Because then how do you tell when you need one byte, and when you need
>>two? If you read two bytes, and see 0x4C 0xFA, does
On 09.06.2013 11:38, Νικόλαος Κούρας wrote:
s = 'α'
s = s.encode('iso-8859-7').decode('utf-8')
print( s )
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe1 in position 0:
unexpected end of data
Why this error? because 'a' ordinal value > 127 ?
>>> s = 'α'
>>> s.encode('iso-8859-7')
b'
Please and tell me that this actually can be solved.
Iam willing to try anything for 'files.py' to load propelry.
Every thign works as expected in my webiste, have manages to correct
pelatologio.poy and koukos.py.
This is the last thing the webiste needs, that is files.py to load so users can
gr
On Sun, 09 Jun 2013 10:55:43 +0200, Lele Gaifax wrote:
> Steven D'Aprano writes:
>
>> On Sat, 08 Jun 2013 22:09:57 -0700, nagia.retsina wrote:
>>
>>> chr('A') would give me the mapping of this char, the number 65 while
>>> ord(65) would output the char 'A' likewise.
>>
>> Correct. Python uses Un
I k nwo i have been a pain in the ass these days but this is the lats
explanation i want from you, just to understand it completely.
>> Since 1 byte can hold up to 256 chars, why not utf-8 use 1-byte for
>> values up to 256?
>Because then how do you tell when you need one byte, and when you ne
Τη Κυριακή, 9 Ιουνίου 2013 12:14:12 μ.μ. UTC+3, ο χρήστης Νικόλαος Κούρας
έγραψε:
> Τη Κυριακή, 9 Ιουνίου 2013 11:15:07 π.μ. UTC+3, ο χρήστης Steven D'Aprano
> έγραψε:
>
>
>
> > Please try this: log into the Linux server, and then start up a Python
>
>
>
> > import os, sys
>
> > print(sy
Τη Κυριακή, 9 Ιουνίου 2013 12:20:58 μ.μ. UTC+3, ο χρήστης Lele Gaifax έγραψε:
> > How about a string i wonder?
> > s = "νίκος"
> > what_are these_bytes = s.encode('iso-8869-7').encode(utf-8')
> Ignoring the usual syntax error, this is just a variant of the code I
> posted: "s.encode('iso-8869-
Τη Κυριακή, 9 Ιουνίου 2013 12:12:36 μ.μ. UTC+3, ο χρήστης Cameron Simpson
έγραψε:
> On 09Jun2013 02:00, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?=
> wrote:
>
> | Steven wrote:
>
> | >> Since 1 byte can hold up to 256 chars, why not utf-8 use 1-byte for
>
> | >> values up to 256?
>
> |
>
>
Νικόλαος Κούρας writes:
> Τη Κυριακή, 9 Ιουνίου 2013 11:55:43 π.μ. UTC+3, ο χρήστης Lele Gaifax έγραψε:
>> Uhm, no: "encode" transforms a Unicode string into an array of bytes,
>> "decode" does the opposite transformation. You cannot do the former on
>> an "arbitrary" array of bytes:
>>
>> >
On 09Jun2013 08:15, Steven D'Aprano
wrote:
| On Sun, 09 Jun 2013 00:00:53 -0700, nagia.retsina wrote:
| > path = b'/home/nikos/public_html/data/apps/'
| > files = os.listdir( path )
| >
| > for filename in files:
| > # Compute 'path/to/filename'
| > filepath_bytes = path + filename
| >
Τη Κυριακή, 9 Ιουνίου 2013 11:15:07 π.μ. UTC+3, ο χρήστης Steven D'Aprano
έγραψε:
> Please try this: log into the Linux server, and then start up a Python
> import os, sys
> print(sys.version)
> s = ('\N{GREEK SMALL LETTER ALPHA}\N{GREEK SMALL LETTER BETA}'
> '\N{GREEK SMALL LETTER GAMMA
On 09Jun2013 02:00, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?=
wrote:
| Steven wrote:
| >> Since 1 byte can hold up to 256 chars, why not utf-8 use 1-byte for
| >> values up to 256?
|
| >Because then how do you tell when you need one byte, and when you need
| >two? If you read two bytes, and se
Τη Κυριακή, 9 Ιουνίου 2013 11:55:43 π.μ. UTC+3, ο χρήστης Lele Gaifax έγραψε:
> Steven D'Aprano writes:
>
>
>
> > On Sat, 08 Jun 2013 22:09:57 -0700, nagia.retsina wrote:
>
> >
>
> >> chr('A') would give me the mapping of this char, the number 65 while
>
> >> ord(65) would output the char 'A
Τη Κυριακή, 9 Ιουνίου 2013 11:02:48 π.μ. UTC+3, ο χρήστης Cameron Simpson
έγραψε:
> In this scenario, really it is the Terminal program (eg Putty) which
> cares about text (what you type, and what gets displayed). It is
> because of mismatches between your Terminal local settings and the
> encodi
Steven wrote:
>> Since 1 byte can hold up to 256 chars, why not utf-8 use 1-byte for
>> values up to 256?
>Because then how do you tell when you need one byte, and when you need
>two? If you read two bytes, and see 0x4C 0xFA, does that mean two
>characters, with ordinal values 0x4C and 0xFA, o
Steven D'Aprano writes:
> On Sat, 08 Jun 2013 22:09:57 -0700, nagia.retsina wrote:
>
>> chr('A') would give me the mapping of this char, the number 65 while
>> ord(65) would output the char 'A' likewise.
>
> Correct. Python uses Unicode, where code-point 65 ("ordinal value 65")
> means letter "A
On Sun, 09 Jun 2013 00:00:53 -0700, nagia.retsina wrote:
> path = b'/home/nikos/public_html/data/apps/'
> files = os.listdir( path )
>
> for filename in files:
> # Compute 'path/to/filename'
> filepath_bytes = path + filename
> for encoding in ('utf-8', 'iso-8859-7', 'latin-1'):
I'm sorry posted by mistake unnessary code: here is the correct one that
prodiuced the above error:
#
# Collect directory and its filenames as bytes
path = b'/home/nikos/public_html/data/apps/'
files = os.listdir( path )
for filename in fi
On 09Jun2013 06:25, Steven D'Aprano
wrote:
| [... heaps of useful explaination ...]
| > When locale to linux system is set to utf-8 that would mean that the
| > linux applications, should try to encode string into hdd by using
| > system's default encoding to utf-8 nad read them back from bytes
Thanks Stevn, i ll read them in a bit. When i read them can you perhaps tell me
whats wrong and ima still getting decode issues?
[CODE]
#
=
# If user downloaded a file, thank the user
On Sat, 08 Jun 2013 22:09:57 -0700, nagia.retsina wrote:
> chr('A') would give me the mapping of this char, the number 65 while
> ord(65) would output the char 'A' likewise.
Correct. Python uses Unicode, where code-point 65 ("ordinal value 65")
means letter "A".
There are older encodings. For e
On Sun, 09 Jun 2013 07:46:40 +0300, Νικόλαος Κούρας wrote:
> Why does every character in a character set needs to be associated with
> a numeric value?
Because computers are digital, not analog, and because bytes are numbers.
Here are a few of the 256 possible bytes, written in binary, decimal a
Τη Σάββατο, 8 Ιουνίου 2013 9:47:53 μ.μ. UTC+3, ο χρήστης Chris Angelico έγραψε:
> Fortunately, Python lets us hide away pretty much all those details,
> just as it lets us hide away the details of what makes up a list, a
> dictionary, or an integer. You can safely assume that the string "foo"
> i
1 - 100 of 341 matches
Mail list logo