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 for those of you who are
watching
On Sunday 02 June 2013 13:10:30 Chris Angelico did opine:
On Mon, Jun 3, 2013 at 2:21 AM, حéêüëلïٍ تïٌلٍ nikos.gr...@gmail.com
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:
' 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: python-list@python.org
On Tue, 04
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
Τη Κυριακή, 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 upon
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
Τη Δευτέρα, 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 stored,
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
Τη Δευτέρα, 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
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?
How do 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 hexadecimal
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 in the python
Τη Δευτέρα, 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)
945
The number
-
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
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 of the
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
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
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 09Jun2013 06:25, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info
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
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
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'):
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info 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
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, or one
Τη Κυριακή, 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
encoding
Τη Κυριακή, 9 Ιουνίου 2013 11:55:43 π.μ. UTC+3, ο χρήστης Lele Gaifax έγραψε:
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info 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)
On 09Jun2013 02:00, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?=
nikos.gr...@gmail.com 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
Τη Κυριακή, 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
On 09Jun2013 08:15, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info
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'
|
Νικόλαος Κούρας nikos.gr...@gmail.com 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:
Τη Κυριακή, 9 Ιουνίου 2013 12:12:36 μ.μ. UTC+3, ο χρήστης Cameron Simpson
έγραψε:
On 09Jun2013 02:00, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?=
nikos.gr...@gmail.com wrote:
| Steven wrote:
| Since 1 byte can hold up to 256 chars, why not utf-8 use 1-byte for
| values up to 256?
Τη Κυριακή, 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-7')
Τη Κυριακή, 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(sys.version)
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 need
On Sun, 09 Jun 2013 10:55:43 +0200, Lele Gaifax wrote:
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info 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.
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
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'\xe1'
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 that mean
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 stdin, line 1, in
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... consider
Τη Κυριακή, 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, Jun 9, 2013 at 2:38 AM, Νικόλαος Κούρας nikos.gr...@gmail.com 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,
On Sun, Jun 9, 2013 at 2:20 AM, Νικόλαος Κούρας nikos.gr...@gmail.com wrote:
Τη Κυριακή, 9 Ιουνίου 2013 12:12:36 μ.μ. UTC+3, ο χρήστης Cameron Simpson
έγραψε:
On 09Jun2013 02:00, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?=
nikos.gr...@gmail.com wrote:
| Steven wrote:
| Since 1 byte can
Τη Σάββατο, 8 Ιουνίου 2013 5:52:22 π.μ. UTC+3, ο χρήστης Cameron Simpson έγραψε:
On 07Jun2013 11:52, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?=
nikos.gr...@gmail.com wrote:
| ni...@superhost.gr [~/www/cgi-bin]# [Fri Jun 07 21:49:33 2013] [error]
[client 79.103.41.173] File
On Sat, Jun 8, 2013 at 4:49 PM, Νικόλαος Κούρας nikos.gr...@gmail.com wrote:
Oh my God i cant beleive i missed a colon *again*:
For most Python programmers, this is a matter of moments to solve. Run
the program, get a SyntaxError, fix it. Non-interesting event. (Maybe
even sooner than that, if
On Fri, 07 Jun 2013 23:49:17 -0700, Νικόλαος Κούρας wrote:
[...]
Oh iam very sorry.
Oh my God i cant beleive i missed a colon *again*:
I have corrected this:
[snip code]
Stop posting your code after every trivial edit!!!
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
On Sat, Jun 8, 2013 at 5:26 PM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
On Fri, 07 Jun 2013 23:49:17 -0700, Νικόλαος Κούρας wrote:
[...]
Oh iam very sorry.
Oh my God i cant beleive i missed a colon *again*:
I have corrected this:
[snip code]
Stop posting your code
On Thu, 06 Jun 2013 23:35:33 -0700, nagia.retsina wrote:
Working with bytes is only for when the file names are turned to
garbage. Your file names (some of them) are turned to garbage. Fix
them, and then use file names as strings.
Can't '~/data/apps/' is filled every day with more and more
Νικόλαος Κούρας schreef:
Session settings afaik is for putty to remember hosts to connect to,
not terminal options. I might be worng though. No matter how many times
i change its options next time i run it always defaults back.
Putty can most definitely remember its settings:
- Start PuTTY;
On 08/06/2013 07:49, Νικόλαος Κούρας wrote:
Τη Σάββατο, 8 Ιουνίου 2013 5:52:22 π.μ. UTC+3, ο χρήστης Cameron Simpson έγραψε:
On 07Jun2013 11:52, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?=
nikos.gr...@gmail.com wrote:
| ni...@superhost.gr [~/www/cgi-bin]# [Fri Jun 07 21:49:33 2013] [error]
Sorry for th delay guys, was busy with other thigns today and i am still
reading your resposes, still ahvent rewad them all just Cameron's:
Here is what i have now following Cameron's advices:
#
# Collect filenames of the path directory
Okey after reading also Steven post, i was relived form the previous suck
position i was, so with an alternation of a few variable names here is the code
now:
#
# Collect directory and its filenames as bytes
path =
On 08/06/2013 17:53, Νικόλαος Κούρας wrote:
Sorry for th delay guys, was busy with other thigns today and i am still
reading your resposes, still ahvent rewad them all just Cameron's:
Here is what i have now following Cameron's advices:
On 8/6/2013 5:49 πμ, Cameron Simpson wrote:
On 07Jun2013 04:53, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?=
nikos.gr...@gmail.com wrote:
| Τη Παρασκευή, 7 Ιουνίου 2013 11:53:04 π.μ. UTC+3, ο χρήστης Cameron Simpson
έγραψε:
| | | errors='replace' mean dont break in case or error?
|
| | Yes. The
On Sat, 08 Jun 2013 21:01:23 +0300, Νικόλαος Κούρας wrote:
In the beginning there was ASCII with 0-127 values
No, there were encoding systems that existed before ASCII, such as
EBCDIC. But we can ignore those, and just start with ASCII.
and then there was
Unicode with 0-127 of ASCII's + i
On Sun, Jun 9, 2013 at 4:01 AM, Νικόλαος Κούρας nikos.gr...@gmail.com wrote:
Hold on!
In the beginning there was ASCII with 0-127 values and then there was
Unicode with 0-127 of ASCII's + i dont know how much many more?
Now ASCIII needs 1 byte to store a single character while Unicode needs
Τη Σάββατο, 8 Ιουνίου 2013 10:01:57 μ.μ. UTC+3, ο χρήστης Steven D'Aprano
έγραψε:
ASCII actually needs 7 bits to store a character. Since computers are
optimized to work with bytes, not bits, normally ASCII characters are
stored in a single byte, with one bit wasted.
So ASCII and Unicode
Sorry for displaying my code so many times, i know i ahve exhaust you but hti
is the last thinkg i am gonna ask from you in this thread. We are very close to
have this working.
#
# Collect directory and its filenames as bytes
path =
On Sun, Jun 9, 2013 at 7:21 AM, Νικόλαος Κούρας nikos.gr...@gmail.com wrote:
Sorry for displaying my code so many times, i know i ahve exhaust you but hti
is the last thinkg i am gonna ask from you in this thread. We are very close
to have this working.
You need to spend more time reading
On 08Jun2013 14:14, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?=
nikos.gr...@gmail.com wrote:
| Τη Σάββατο, 8 Ιουνίου 2013 10:01:57 μ.μ. UTC+3, ο χρήστης Steven D'Aprano
έγραψε:
| ASCII actually needs 7 bits to store a character. Since computers are
| optimized to work with bytes, not bits,
On 9/6/2013 1:32 πμ, Cameron Simpson wrote:
On 08Jun2013 14:14, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?=
nikos.gr...@gmail.com wrote:
| Τη Σάββατο, 8 Ιουνίου 2013 10:01:57 μ.μ. UTC+3, ο χρήστης Steven D'Aprano
έγραψε:
| ASCII actually needs 7 bits to store a character. Since computers are
|
Τη Σάββατο, 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
is a
Τη Παρασκευή, 7 Ιουνίου 2013 4:25:40 π.μ. UTC+3, ο χρήστης Steven D'Aprano
έγραψε:
MRAB tells you to work with the bytes, because the filenames' bytes are
invalid decoded as UTF-8. If you fix the file names by renaming using a
terminal set to UTF-8, then they will be valid and you can
On Fri, Jun 7, 2013 at 4:35 PM, nagia.rets...@gmail.com wrote:
Yes, but but 'putty' seems to always forget when i tell it to use utf8 for
displaying and always picks up the Win8's default charset and it doesnt have
a save options dialog. I cant always remember to switch to utf8 charset or
On 7/6/2013 4:01 πμ, Cameron Simpson wrote:
On 06Jun2013 11:46, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?=
nikos.gr...@gmail.com wrote:
| Τη Πέμπτη, 6 Ιουνίου 2013 3:44:52 μ.μ. UTC+3, ο χρήστης Steven D'Aprano
έγραψε:
| py s = '999-Eυχή-του-Ιησού'
| py bytes_as_utf8 = s.encode('utf-8')
| py t
nagia.rets...@gmail.com writes:
File files.py, line 75
os.rename( filepath_bytes filepath.encode('utf-8') )
^
SyntaxError: invalid syntax
I am seeign the caret pointing at filepath but i cant follow what it
tries to tell me.
As already explained,
Τη Παρασκευή, 7 Ιουνίου 2013 9:46:53 π.μ. UTC+3, ο χρήστης Chris Angelico
έγραψε:
On Fri, Jun 7, 2013 at 4:35 PM, nagia.rets...@gmail.com wrote:
Yes, but but 'putty' seems to always forget when i tell it to use utf8 for
displaying and always picks up the Win8's default charset and it
On Fri, Jun 7, 2013 at 5:08 PM, Νικόλαος Κούρας nikos.gr...@gmail.com wrote:
I'll google Traal right now.
The one thing you're actually willing to go research, and it's
actually something that won't help you. Traal is the name of my
personal laptop. Spend your Googletrons on something else. :)
Τη Παρασκευή, 7 Ιουνίου 2013 10:09:29 π.μ. UTC+3, ο χρήστης Lele Gaifax έγραψε:
As already explained, often a SyntaxError is introduced by *preceeding*
text, so you must look at your code with a wider eye.
That what i ahte aabout error reporting. You have some syntax error someplace
and error
On Jun 7, 2013, at 8:32, Νικόλαος Κούρας nikos.gr...@gmail.com wrote:
Τη Παρασκευή, 7 Ιουνίου 2013 10:09:29 π.μ. UTC+3, ο χρήστης Lele Gaifax
έγραψε:
As already explained, often a SyntaxError is introduced by *preceeding*
text, so you must look at your code with a wider eye.
That what
On 7/6/2013 10:42 πμ, Michael Weylandt wrote:
os.rename( filepath_bytes filepath.encode('utf-8')
Missing comma, which is, after all, just a matter of syntax so it can't matter,
right?
I doubted that os.rename arguments must be comma seperated.
But ater reading the docs.
On Fri, Jun 7, 2013 at 9:10 AM, Νικόλαος Κούρας nikos.gr...@gmail.com wrote:
On 7/6/2013 10:42 πμ, Michael Weylandt wrote:
os.rename( filepath_bytes filepath.encode('utf-8')
Missing comma, which is, after all, just a matter of syntax so it can't
matter, right?
I doubted that os.rename
On 07Jun2013 11:10, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?=
nikos.gr...@gmail.com wrote:
| On 7/6/2013 10:42 πμ, Michael Weylandt wrote:
| os.rename( filepath_bytes filepath.encode('utf-8')
| Missing comma, which is, after all, just a matter of syntax so it can't
matter, right?
|
| I doubted
On 07Jun2013 09:56, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?=
nikos.gr...@gmail.com wrote:
| On 7/6/2013 4:01 πμ, Cameron Simpson wrote:
| On 06Jun2013 11:46, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?=
nikos.gr...@gmail.com wrote:
| | Τη Πέμπτη, 6 Ιουνίου 2013 3:44:52 μ.μ. UTC+3, ο χρήστης Steven
On Jun 7, 6:53 pm, Cameron Simpson c...@zip.com.au wrote:
Experiment:
LC_ALL=C ls -b
LC_ALL=utf-8 ls -b
LC_ALL=iso-8859-7 ls -b
And the Terminal itself is decoding the output for display, and
encoding your input keystrokes to feed as input to the command
line.
This
Τη Παρασκευή, 7 Ιουνίου 2013 11:53:04 π.μ. UTC+3, ο χρήστης Cameron Simpson
έγραψε:
On 07Jun2013 09:56, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?=
nikos.gr...@gmail.com wrote:
| On 7/6/2013 4:01 πμ, Cameron Simpson wrote:
| On 06Jun2013 11:46, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?=
On 07/06/2013 12:53, Νικόλαος Κούρας wrote:
[snip]
#
# Collect filenames of the path dir as bytes
greek_filenames = os.listdir( b'/home/nikos/public_html/data/apps/' )
for filename in greek_filenames:
# Compute 'path/to/filename'
On Fri, 07 Jun 2013 04:53:42 -0700, Νικόλαος Κούρας wrote:
Do you mean that utf-8, latin-iso, greek-iso and ASCII have the 1st
0-127 codepoints similar?
You can answer this yourself. Open a terminal window and start a Python
interactive session. Then try it and see what happens:
s =
Τη Παρασκευή, 7 Ιουνίου 2013 5:29:25 μ.μ. UTC+3, ο χρήστης MRAB έγραψε:
This is a worse way of doing it because the ISO-8859-7 encoding has 1
byte per codepoint, meaning that it's more 'tolerant' (if that's the
word) of errors. A sequence of bytes that is actually UTF-8 can be
decoded as
:
On 7 June 2013 14:52, Νικόλαος Κούρας nikos.gr...@gmail.com wrote:
File /home/nikos/public_html/cgi-bin/files.py, line 81
[Fri Jun 07 21:49:33 2013] [error] [client 79.103.41.173] if( flag ==
'greek' )
[Fri Jun 07 21:49:33 2013] [error] [client 79.103.41.173]
^
On 07/06/2013 20:31, Zero Piraeus wrote:
:
On 7 June 2013 14:52, Νικόλαος Κούρας nikos.gr...@gmail.com wrote:
File /home/nikos/public_html/cgi-bin/files.py, line 81
[Fri Jun 07 21:49:33 2013] [error] [client 79.103.41.173] if( flag ==
'greek' )
[Fri Jun 07 21:49:33 2013] [error] [client
:
On 7 June 2013 16:45, MRAB pyt...@mrabarnett.plus.com wrote:
On 07/06/2013 20:31, Zero Piraeus wrote:
[something exasperated, in capitals]
Have you noticed how the line in the traceback doesn't match the line
in the post?
Actually, I hadn't. It's not exactly a surprise at this point,
On 07Jun2013 11:52, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?=
nikos.gr...@gmail.com wrote:
| ni...@superhost.gr [~/www/cgi-bin]# [Fri Jun 07 21:49:33 2013] [error]
[client 79.103.41.173] File /home/nikos/public_html/cgi-bin/files.py, line
81
| [Fri Jun 07 21:49:33 2013] [error] [client
On 07Jun2013 04:53, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?=
nikos.gr...@gmail.com wrote:
| Τη Παρασκευή, 7 Ιουνίου 2013 11:53:04 π.μ. UTC+3, ο χρήστης Cameron Simpson
έγραψε:
| | | errors='replace' mean dont break in case or error?
|
| | Yes. The result will be correct for correct
On Thu, Jun 6, 2013 at 3:54 PM, jmfauth wxjmfa...@gmail.com wrote:
(filesystems are just bytes,
yeah, whatever...).
Sure. You tell me what a proper Unicode rendition of an animated GIF is.
ChrisA
--
http://mail.python.org/mailman/listinfo/python-list
Yes this is a linxu issue although locale is se to utf-8
root@nikos [~]# locale
LANG=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
LC_NUMERIC=en_US.UTF-8
LC_TIME=en_US.UTF-8
LC_COLLATE=en_US.UTF-8
LC_MONETARY=en_US.UTF-8
LC_MESSAGES=en_US.UTF-8
LC_PAPER=en_US.UTF-8
LC_NAME=en_US.UTF-8
LC_ADDRESS=en_US.UTF-8
Am 05.06.2013 18:44, schrieb MRAB:
From the previous posts I guessed that the filename might be encoded
using ISO-8859-7:
s = b\305\365\367\336\ \364\357\365\ \311\347\363\357\375.mp3
s.decode(iso-8859-7)
'Ευχή\\ του\\ Ιησού.mp3'
Yes, that looks the same.
Most probably, his terminal is
On 06/06/2013 07:11, Chris Angelico wrote:
On Thu, Jun 6, 2013 at 3:54 PM, jmfauth wxjmfa...@gmail.com wrote:
(filesystems are just bytes,
yeah, whatever...).
Sure. You tell me what a proper Unicode rendition of an animated GIF is.
ChrisA
It's obviously one that doesn't use the flawed
On 05Jun2013 11:43, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?=
nikos.gr...@gmail.com wrote:
| Τη Τετάρτη, 5 Ιουνίου 2013 9:32:15 μ.μ. UTC+3, ο χρήστης MRAB έγραψε:
| Using Python, I think you could get the filenames using os.listdir,
| passing the directory name as a bytestring so that it'll
Τη Πέμπτη, 6 Ιουνίου 2013 11:50:55 π.μ. UTC+3, ο χρήστης Heiko Wundram έγραψε:
Am 05.06.2013 18:44, schrieb MRAB:
From the previous posts I guessed that the filename might be encoded
using ISO-8859-7:
s = b\305\365\367\336\ \364\357\365\ \311\347\363\357\375.mp3
Am 06.06.2013 12:35, schrieb Νικόλαος Κούρας:
ni...@superhost.gr [~/www/data/apps]# ls -l | file -
/dev/stdin: ASCII text
Did you actually try to understand what I wrote?
--
--- Heiko.
--
http://mail.python.org/mailman/listinfo/python-list
Heiko, the ssh client i used to 'mv' the .mp3 was putty.Do you mean that putty
is responsible for the encoding mess?
the rename command on the command-line of his shell session, the mv
command gets a stream of bytes as the new file name which happens to be
the ISO-8859-7 encoding of the file
Am 06.06.2013 13:00, schrieb Νικόλαος Κούρας:
Heiko, the ssh client i used to 'mv' the .mp3 was putty.Do you mean that putty
is responsible for the encoding mess?
Exactly. Check the encoding that putty uses for the terminal session. If
it doesn't use UTF-8, switch your terminal session to
Τη Πέμπτη, 6 Ιουνίου 2013 1:24:16 μ.μ. UTC+3, ο χρήστης Cameron Simpson έγραψε:
On 05Jun2013 11:43, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?=
nikos.gr...@gmail.com wrote:
| Τη Τετάρτη, 5 Ιουνίου 2013 9:32:15 μ.μ. UTC+3, ο χρήστης MRAB έγραψε:
| Using Python, I think you could get the
Τη Πέμπτη, 6 Ιουνίου 2013 2:09:22 μ.μ. UTC+3, ο χρήστης Heiko Wundram έγραψε:
Am 06.06.2013 13:00, schrieb Νικόλαος Κούρας:
Heiko, the ssh client i used to 'mv' the .mp3 was putty.Do you mean that
putty is responsible for the encoding mess?
Exactly. Check the encoding that putty
Am 06.06.2013 13:24, schrieb Νικόλαος Κούρας:
ni...@superhost.gr [~/www/data/apps]# ls *.mp3 | file -
/dev/stdin: ASCII text
Again, did you actually read (and try to understand) what I wrote? I
said to redo the rename after you change your terminal session to UTF-8.
--
--- Heiko.
--
# Compute a set of current fullpaths
fullpaths = os.listdir( '/home/nikos/public_html/data/apps/' )
# Load'em
for fullpath in fullpaths:
try:
# Check the presence of a file against the database and insert
if it doesn't exist
cur.execute('''SELECT url FROM
On 06/06/2013 04:43, Νικόλαος Κούρας wrote:
Τη Τετάρτη, 5 Ιουνίου 2013 9:43:18 μ.μ. UTC+3, ο χρήστης Νικόλαος Κούρας έγραψε:
Τη Τετάρτη, 5 Ιουνίου 2013 9:32:15 μ.μ. UTC+3, ο χρήστης MRAB έγραψε:
On 05/06/2013 18:43, οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½ οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½ wrote:
οΏ½οΏ½
First of all thank you for helping me MRAB.
After make some alternation to your code ia have this:
# Give the path as a bytestring so that we'll get the filenames as bytestrings
path = b/home/nikos/public_html/data/apps/
# Setting TESTING to True will
On Tue, 04 Jun 2013 02:00:43 -0700, Νικόλαος Κούρας wrote:
Τη Τρίτη, 4 Ιουνίου 2013 11:47:01 π.μ. UTC+3, ο χρήστης Steven D'Aprano
έγραψε:
Please run these commands, and show what result they give:
[...]
ni...@superhost.gr [~/www/data/apps]# alias ls
alias ls='/bin/ls $LS_OPTIONS'
And
On 06/06/2013 13:04, Νικόλαος Κούρας wrote:
First of all thank you for helping me MRAB.
After make some alternation to your code ia have this:
# Give the path as a bytestring so that we'll get the filenames as bytestrings
path =
1 - 100 of 223 matches
Mail list logo