On Sunday, June 9, 2013 9:24:56 PM UTC+3, Ian wrote:
> On 09/06/2013 18:09, guytam...@gmail.com wrote:
>
> > Hi all,
>
> >
>
> > new to group and pretty new to python.
>
> >
>
> > I'm working on a new project and i want to receive a request from a user
> > and to redirect him to a third party
Am 10.06.2013 07:31, schrieb Steven D'Aprano:
>
> But bringing it back to the original topic, I believe that the philosophy
> of FOSS is that we should try our best to honour the intentions of the
> writer, not to find some legal loophole that permits us to copy his or
> her work against their
On Sun, 09 Jun 2013 14:08:54 -0700, Mark Janssen wrote:
> I'm sorry, this is just the way it is -- everyone's just gone along with
> the program tacitly because they get intimidated by the legal system.
Your definition of "just the way it is" does not agree with mine. You're
describing how you
On Sunday, June 9, 2013 7:26:43 PM UTC-5, Steven D'Aprano wrote:
> When you listen to a song on the radio, do you know how they have a
> copyright announcer read out the copyright and explicitly list all the
> rights they keep after each and every song and advertisment?
> No, me neither. It does
> Granted, IANAL, but the scholarly article I linked to above refers to
> several of the same issues. I don't know about publication revoking
> *all rights*, but there was definitely an understanding by the court
> that publication meant a reduction of copyright claim.
Again, I don't think I said
On Mon, Jun 10, 2013 at 1:06 PM, wrote:
> if input()!=('duck', 'parry'):
> if input()=='duck':
> if input()=='parry':
Every time you call input(), it waits for you to type something. You
want to record what the person typed and then use it in each place.
Have you been taught a means of doing thi
On Mon, Jun 10, 2013 at 10:34 AM, Steven D'Aprano
wrote:
> On Mon, 10 Jun 2013 08:07:57 +1000, Chris Angelico wrote:
>
>> On Mon, Jun 10, 2013 at 6:32 AM, Mark Janssen
>> wrote:
>>> That's not entirely correct. If he *publishes* his code (I'm using
>>> this term "publish" technically to mean "pu
On 06/09/2013 08:30 PM, Mark Janssen wrote:
>> Can you provide any citations for your interpretation? Besides "that's
>> what the law should be", I mean.
>
> I don't think I even have to: the legal code you're citing above is
> not very clear, consistent, or well-defined at all. As such, it show
How do I make it so I only have to type in 'parry' once?
import random
words=['hemisses', 'hestabsyou']
randomizer=random.choice(words)
if input()!=('duck', 'parry'):
print('try again')
if input()=='duck':
print(randomizer)
if randomizer=='hemisses':
results=['you should have r
> What is clear is the mandate that sets up the framework in the first
> place:
>
> "To promote the Progress of Science and useful Arts, by securing
> for limited Times to Authors and Inventors the exclusive Right to
> their respective Writings and Discoveries"
> -- USC Articl
On 2013-06-09 19:30, Mark Janssen wrote:
> Thanks for digging out the legal code. Upon reading, it is
> stunningly clear that the legal system has not established a solid
> framework or arching philosophy in which to contain and express the
> desire (in law) to protect content creators of all kind
> The fact that a work is non commercial is one of several factors that
> is taken into account when determining fair use. It is not an
> automatic fair use for non-commercial works. I have no idea where your
> understanding of copyright law came from, but here is the relevant
> section of the US l
On Sun, Jun 9, 2013 at 6:40 PM, Mark Janssen wrote:
>> Mark, ever watched TV? Or gone to the movies? Or walked into a bookshop?
>> Listened to the radio? All these things publish copyrighted work. It is
>> utter nonsense that merely publishing something in public gives up the
>> monopoly privilege
> Mark, ever watched TV? Or gone to the movies? Or walked into a bookshop?
> Listened to the radio? All these things publish copyrighted work. It is
> utter nonsense that merely publishing something in public gives up the
> monopoly privileges granted by copyright.
That's not correct. Keep in min
On Sunday, June 9, 2013 4:08:54 PM UTC-5, zipher wrote:
> >> That's not entirely correct. If he *publishes* his code (I'm using
>
> >> this term "publish" technically to mean "put forth in a way where
>
> >> anyone of the general public can or is encouraged to view"), then he
>
> >> is *tacitly
On 06/09/2013 02:32 PM, Mark Janssen wrote:
> PyPi. But if you are *publishing*, there's no court which can
> protect your IP afterwards from redistribution, unless you
> explicitly *restrict* it.
I am not a lawyer, and I haven't read the copyright act in its entirety,
nor have I studied all the
On Mon, 10 Jun 2013 08:07:57 +1000, Chris Angelico wrote:
> On Mon, Jun 10, 2013 at 6:32 AM, Mark Janssen
> wrote:
>> That's not entirely correct. If he *publishes* his code (I'm using
>> this term "publish" technically to mean "put forth in a way where
>> anyone of the general public can or is
On Sun, 09 Jun 2013 13:32:00 -0700, Mark Janssen wrote:
> On Sun, Jun 9, 2013 at 12:50 PM, Michael Torrie
> wrote:
>> On 06/09/2013 11:18 AM, Mark Janssen wrote:
>>> You actually do not. Attaching a legal document is purely a secondary
>>> protection from those who would take away right already
> (Digression follows.) ...(by Gilbert and
> Sullivan - one of my other loves), and according to US law at the
> time, the publication (in this case, public performance, along with
> the public sale of libretti (books of the words) and some sheet music)
> of the work voided the authors' claim to ow
On Mon, Jun 10, 2013 at 7:06 AM, wrote:
> Hi all,
> I developed a script, which, IMHO, is more useful than the well
> known bash "hexdump".
> Unfortunately i can't arrange very easily the utf-8 encoding,
> so in my output there is a loss of synchronization between the
> the literal and the hex pa
On Mon, Jun 10, 2013 at 6:32 AM, Mark Janssen wrote:
> That's not entirely correct. If he *publishes* his code (I'm using
> this term "publish" technically to mean "put forth in a way where
> anyone of the general public can or is encouraged to view"), then he
> is *tacitly* giving up protections
In article
<20165c85-4cc3-4b79-943b-82443e4a9...@w7g2000vbw.googlegroups.com>,
Jean Dubois wrote:
> But, really,
> > once you've done all that (and it's worth doing as an exercise), rewrite
> > your code to use urllib2 or requests. It'll be a lot easier.
>
> Could you show me how to code the
Try this:
### get_charset.py ###
import re
import urllib2
def get_charset(url):
resp = urllib2.urlopen(url)
#retrieve charset from header
headers = ''.join(resp.headers.headers)
charset_from_header_list = re.findall('charset=(.*)', headers)
charset_from_header = charset_from_
Hi all,
I developed a script, which, IMHO, is more useful than the well
known bash "hexdump".
Unfortunately i can't arrange very easily the utf-8 encoding,
so in my output there is a loss of synchronization between the
the literal and the hex part...
The script is not very long but is written n
>> That's not entirely correct. If he *publishes* his code (I'm using
>> this term "publish" technically to mean "put forth in a way where
>> anyone of the general public can or is encouraged to view"), then he
>> is *tacitly* giving up protections that secrecy (or *not* disclosing
>> it) would *a
On 9 jun, 22:23, Roy Smith wrote:
> In article
> ,
> Jean Dubois wrote:
>
> > I'm writing some code to check whether an url is available or not,
> > therefore I make use of a wget-command in Linux and then check whether
> > this is successful
>
> In general, "shelling out" to run a command-line
On 9 jun, 22:29, Fábio Santos wrote:
> On 9 Jun 2013 21:24, "Jean Dubois"
> ...> And here is the result:
>
> > jean@antec4:~$ ./try.py
> > wget -q -O -
>
> http://www.deredactie.be/cm/vrtnieuws/videozone/programmas/journaal/E...>
> >/dev/null ; echo $?
> > 8
> > 2013-06-07 22:07:00.016807 stream
On Sun, Jun 9, 2013 at 1:32 PM, Mark Janssen wrote:
> On Sun, Jun 9, 2013 at 12:50 PM, Michael Torrie wrote:
>> On 06/09/2013 11:18 AM, Mark Janssen wrote:
>>> You actually do not. Attaching a legal document is purely a secondary
>>> protection from those who would take away right already grante
On 9 Jun 2013 21:39, "Mark Janssen" wrote:
>
> On Sun, Jun 9, 2013 at 12:50 PM, Michael Torrie wrote:
> > On 06/09/2013 11:18 AM, Mark Janssen wrote:
> >> You actually do not. Attaching a legal document is purely a secondary
> >> protection from those who would take away right already granted by
Jean Dubois wrote:
...
> checkavailablestring='wget -q -O -
>http://www.deredactie.be/cm/vrtnieuws/videozone/programmas/journaal/EP_'+thisday.strftime("%y%m%d")+'_JO7
>>/dev/null ; echo $?'
The problem schould be the echo:
Since os.system returns the exit code of the shell, when chaining comma
On Sun, Jun 9, 2013 at 12:50 PM, Michael Torrie wrote:
> On 06/09/2013 11:18 AM, Mark Janssen wrote:
>> You actually do not. Attaching a legal document is purely a secondary
>> protection from those who would take away right already granted by US
>> copyright.
>
> You are correct, except that the
On 9 Jun 2013 21:24, "Jean Dubois"
...
> And here is the result:
>
> jean@antec4:~$ ./try.py
> wget -q -O -
http://www.deredactie.be/cm/vrtnieuws/videozone/programmas/journaal/EP_130607_JO7
> >/dev/null ; echo $?
> 8
> 2013-06-07 22:07:00.016807 stream is available
> wget -q -O -
http://www.deredac
In article
,
Jean Dubois wrote:
> I'm writing some code to check whether an url is available or not,
> therefore I make use of a wget-command in Linux and then check whether
> this is successful
In general, "shelling out" to run a command-line utility should be the
last resort. It's slower,
On 9 jun, 22:00, Fábio Santos wrote:
> On 9 Jun 2013 20:49, "Jean Dubois" wrote:
>
>
>
> > I'm writing some code to check whether an url is available or not,
> > therefore I make use of a wget-command in Linux and then check whether
> > this is successful (returning a 0) or not returning an 8
> >
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
On 9 Jun 2013 20:49, "Jean Dubois" wrote:
>
> I'm writing some code to check whether an url is available or not,
> therefore I make use of a wget-command in Linux and then check whether
> this is successful (returning a 0) or not returning an 8
> However the if then statement seems to give the sam
On 06/09/2013 11:18 AM, Mark Janssen wrote:
>> I understand that I have to pick a license for my package.
>
> You actually do not. Attaching a legal document is purely a secondary
> protection from those who would take away right already granted by US
> copyright.
You are correct, except that th
I'm writing some code to check whether an url is available or not,
therefore I make use of a wget-command in Linux and then check whether
this is successful (returning a 0) or not returning an 8
However the if then statement seems to give the same result in both
cases:
Here is my code:
#!/usr/bin/
On 2013-06-09 10:09, guytam...@gmail.com wrote:
> I'm working on a new project and i want to receive a request from a
> user and to redirect him to a third party site, but on the page
> after i redirect my users i want to them to see injected html (on
> the third party site.)
As others have stated
Carlos Nepomuceno於 2013年6月9日星期日UTC+8下午1時23分15秒寫道:
> print '\n'.join([re.findall("from '(.*)'",str(v))[0] for k,v in
> sys.modules.items() if str(v).find('from')>-1])
>
>
>
> > Date: Sat, 8 Jun 2013 21:30:48 -0700
> > Subject: Listing modules from all installed packages
> > From: jph...@gmail.co
On Sunday, June 9, 2013 8:22:17 PM UTC+3, Fábio Santos wrote:
>> This does not seem like a python question, instead a HTML/JavaScript
one.
In article <0021fabe-78ed-4e79-8cdf-468b4ccc7...@googlegroups.com>,
guytam...@gmail.com wrote:
> its a python question since the request is received on a py
On 09/06/2013 18:09, guytam...@gmail.com wrote:
Hi all,
new to group and pretty new to python.
I'm working on a new project and i want to receive a request from a user and to
redirect him to a third party site, but on the page after i redirect my users i
want to them to see injected html (on
On Sun, Jun 9, 2013 at 1:52 PM, wrote:
> its a python question since the request is received on a python server and
> i thought that
> there may be a way to so from the server that sends the response to the
> user...
>
> On Sunday, June 9, 2013 8:22:17 PM UTC+3, Fábio Santos wrote:
> > On 9 Jun
its a python question since the request is received on a python server and i
thought that
there may be a way to so from the server that sends the response to the user...
On Sunday, June 9, 2013 8:22:17 PM UTC+3, Fábio Santos wrote:
> On 9 Jun 2013 18:15, wrote:
>
> >
>
> > Hi all,
>
> >
>
>
Τη Κυριακή, 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 9 Jun 2013 18:15, wrote:
>
> Hi all,
>
> new to group and pretty new to python.
>
> I'm working on a new project and i want to receive a request from a user
and to redirect him to a third party site, but on the page after i redirect
my users i want to them to see injected html (on the third par
> At least partially, my confusion seems to be caused by the dichotomy of
> the concepts of copyright and license. How do these relate to each other?
A license emerges out of the commercial domain is purely about
commercial protections. A copyright comes from the "academic" domain
is pure about
On Sun, Jun 9, 2013 at 1:09 PM, wrote:
> Hi all,
>
> new to group and pretty new to python.
>
> I'm working on a new project and i want to receive a request from a user
> and to redirect him to a third party site, but on the page after i redirect
> my users i want to them to see injected html (on
On Sun, Jun 9, 2013 at 12:44 PM, Νικόλαος Κούρας wrote:
> A few questiosn about encoding please:
>
>>> 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,
Hi all,
new to group and pretty new to python.
I'm working on a new project and i want to receive a request from a user and to
redirect him to a third party site, but on the page after i redirect my users i
want to them to see injected html (on the third party site.)
i'm not really sure how to
On Sun, 09 Jun 2013 03:44:57 -0700, Νικόλαος Κούρας 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 tw
On Mon, Jun 10, 2013 at 1:39 AM, Mark Janssen wrote:
>> The Secret Labs license is very explicit: "All rights reserved". That line
>> means you can't touch it under pain of lawsuit.
>
> That's not true. It means whatever rights they do have, they are
> stating, in effect, that they have not give
> The Secret Labs license is very explicit: "All rights reserved". That line
> means you can't touch it under pain of lawsuit.
That's not true. It means whatever rights they do have, they are
stating, in effect, that they have not given them away. But this is a
difficult legal point, because by
On Sun, 09 Jun 2013 08:10:13 -0700, Rick Johnson wrote:
> The Secret Labs license is very explicit: "All rights reserved". That
> line means you can't touch it under pain of lawsuit.
It's also very explicit that the code can be redistributed.
However, there is no explicit rights to modification
On Mon, Jun 10, 2013 at 1:10 AM, Rick Johnson
wrote:
> On Sunday, June 9, 2013 8:21:43 AM UTC-5, Malte Forkel wrote:
>> I have asked the PSF for help regarding the implications of the license
>> status of code from sre_parse.py and the missing license statement in
>> sre.py. I'll happily report t
On Sunday, June 9, 2013 8:21:43 AM UTC-5, Malte Forkel wrote:
> I have asked the PSF for help regarding the implications of the license
> status of code from sre_parse.py and the missing license statement in
> sre.py. I'll happily report their answer to the list I they don't reply
> in this thread
On Sun, Jun 9, 2013 at 11:21 PM, Malte Forkel wrote:
> At least partially, my confusion seems to be caused by the dichotomy of
> the concepts of copyright and license. How do these relate to each other?
Ah, that one's easy enough to answer!
When you create something, you own it. That is what cop
On 6/8/13 5:31 PM, Malte Forkel wrote:
Now, how am I supposed to deal with that? Ask Secret Labs for some kind
of permission? Leave it as it is and add my own copyright line?
Secret Labs AB is Frederic Lundh, author of the Python Image Library and
many bits included in Python's stdlib. Here is
I have asked the PSF for help regarding the implications of the license
status of code from sre_parse.py and the missing license statement in
sre.py. I'll happily report their answer to the list I they don't reply
in this thread.
At least partially, my confusion seems to be caused by the dichotom
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
Adding : python -c 'help("modules") to the other two suggestions:
#!/usr/bin/env python
import commands, pkgutil, re, sys
print('sys.modules.items()...')
print('\n'.join(sorted([re.findall("from '(.*)'",str(v))[0] for k,v in
sys.modules.items() if str(v).find('from')>-1])))
print('\npkgutil.it
claire morandin wrote:
> Thanks Peter, true I did not realize that ercc_contigs is empty, but I am
> not sure how to "populate" the dictionary if I only have one column for
> the value but no key
You could use a "dummy value"
ercc_contigs = {}
for line in open('Faq_ERCC_contigs_name.txt'):
g
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
Thanks Peter, true I did not realize that ercc_contigs is empty, but I am not
sure how to "populate" the dictionary if I only have one column for the value
but no key
--
http://mail.python.org/mailman/listinfo/python-list
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 9 Jun 2013 11:49, "Νικόλαος Κούρας" wrote:
>
> A few questiosn about encoding please:
>
> >> 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
claire morandin wrote:
> I have the following script which does not return anything, no apparent
> mistake but my output file is empty.I am just trying to extract some
> decimal number from a file according to their names which are in another
> file. from collections import defaultdict import nump
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
在 2012年12月24日星期一UTC+8上午8时34分47秒,iMath写道:
> how to detect the character encoding in a web page ?
>
> such as this page
>
>
>
> http://python.org/
here is one thread that can help me understanding my code
http://stackoverflow.com/questions/17001407/how-to-detect-the-character-encoding-of-a-we
在 2012年12月24日星期一UTC+8上午8时34分47秒,iMath写道:
> how to detect the character encoding in a web page ?
>
> such as this page
>
>
>
> http://python.org/
Finally ,I found by using PyQt’s QtextStream , QTextCodec and chardet ,we can
get a web page code more securely
even for this bad page
http://ww
Τη Κυριακή, 9 Ιουνίου 2013 8:27:53 π.μ. UTC+3, ο χρήστης nagia@gmail.com
έγραψε:
> Trying
>
>
>
> yum install dos2unix
>
>
>
> and
>
>
>
> root@nikos [/home/nikos/www/cgi-bin]# dos2unix koukos.py
>
> dos2unix: converting file koukos.py to UNIX format ...
>
>
>
>
>
> Then brows
A few questiosn about encoding please:
>> 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 ordin
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
I have the following script which does not return anything, no apparent mistake
but my output file is empty.I am just trying to extract some decimal number
from a file according to their names which are in another file. from
collections import defaultdict import numpy as np
[code]ercc_contigs=
Τη Κυριακή, 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
92 matches
Mail list logo