moi 在 2022年12月12日 星期一下午5:38:50 [UTC+8] 的信中寫道:
> >>> ast.literal_eval("r'\x7a'") == ast.literal_eval("r'z'")
> True
> >>> ast.literal_eval("r'\xe0'") == ast.literal_eval("r'à'")
> True
> >>> ast.literal_eval("r'\x9c'") == ast.literal_eval("r'œ'")
> False
>
> -
>
>
> >>> print(codec
> ./cl.py '^M
> '
> Input
> -
> - length 3
> 13 32 10
> From: Python-list on
> behalf of Jach Feng
> Date: Thursday, December 8, 2022 at 9:31 PM
> To: pytho...@python.org
> Subject: Re: How to convert a raw string r'xdd' to 'xdd' mo
moi 在 2022年12月9日 星期五晚上11:41:20 [UTC+8] 的信中寫道:
> PS C:\humour> py38 sysargwithliteral.py a\x0ab\x09c\x0a\x80uro\x0ax\x08z
> cp1252
> a
> b c
> €uro
> z
>
> PS C:\humour> $a = py38 sysargwithliteral.py a\x0ab\x09c\x0a\x80uro\x0ax\x08z
> cp1252
>
> PS C:\humour> licp($a)
> a U+0061
> b U+0
)
for c in args.data:
print(f'{ord(c)} ',end='')
print()
Using bash on Linux:
./cl.py '^M
'
Input
-
- length 3
13 32 10
From: Python-list on
behalf of Jach Feng
Date: Thursday, December 8, 2022 at 9:31 PM
To: python-list@python.org
Subject: Re: How to co
Jach Feng 在 2022年12月7日 星期三上午10:23:20 [UTC+8] 的信中寫道:
> s0 = r'\x0a'
> At this moment it was done by
>
> def to1byte(matchobj):
> return chr(int('0x' + matchobj.group(1), 16))
> s1 = re.sub(r'\\x([0-9a-fA-F]{2})', to1byte, s0)
>
> But, is it that difficult on doing this simple thing?
>
>
Jach Feng 在 2022年12月7日 星期三上午10:23:20 [UTC+8] 的信中寫道:
> s0 = r'\x0a'
> At this moment it was done by
>
> def to1byte(matchobj):
> return chr(int('0x' + matchobj.group(1), 16))
> s1 = re.sub(r'\\x([0-9a-fA-F]{2})', to1byte, s0)
>
> But, is it that difficult on doing this simple thing?
>
>
On 08/12/2022 02:17, Jach Feng wrote:
Peter Otten 在 2022年12月8日 星期四清晨5:17:59 [UTC+8] 的信中寫道:
On 07/12/2022 03:23, Jach Feng wrote:
s0 = r'\x0a'
At this moment it was done by
def to1byte(matchobj):
return chr(int('0x' + matchobj.group(1), 16))
s1 = re.sub(r'\\x([0-9a-fA-F]{2})', to1byte, s0)
mine
10
From: Python-list on behalf of
Jach Feng
Date: Wednesday, December 7, 2022 at 9:27 PM
To: python-list@python.org
Subject: Re: How to convert a raw string r'xdd' to 'xdd' more gracefully?
*** Attention: This is an external email. Use caution responding, opening
a
chobj):
return chr(int('0x' + matchobj.group(1), 16))
s1 = re.sub(r'\\x([0-9a-fA-F]{2})', to1byte, s0)
exam(s0)
exam(s1)
---
examine \x0a
92 \
120 x
48 0
97 a
examine
10
From: Python-list on
behalf of Jach Feng
Date: Wednesday, December 7, 2022 at 9:27 PM
To: python-list@python.o
Peter Otten 在 2022年12月8日 星期四清晨5:17:59 [UTC+8] 的信中寫道:
> On 07/12/2022 03:23, Jach Feng wrote:
> > s0 = r'\x0a'
> > At this moment it was done by
> >
> > def to1byte(matchobj):
> > return chr(int('0x' + matchobj.group(1), 16))
> > s1 = re.sub(r'\\x([0-9a-fA-F]{2})', to1byte, s0)
> >
> > B
Roel Schroeven 在 2022年12月7日 星期三下午4:42:48 [UTC+8] 的信中寫道:
> Op 7/12/2022 om 4:37 schreef Jach Feng:
> > MRAB 在 2022年12月7日 星期三上午11:04:43 [UTC+8] 的信中寫道:
> > > On 2022-12-07 02:23, Jach Feng wrote:
> > > > s0 = r'\x0a'
> > > > At this moment it was done by
> > > >
> > > > def to1byte(matchobj):
>
On 07/12/2022 03:23, Jach Feng wrote:
s0 = r'\x0a'
At this moment it was done by
def to1byte(matchobj):
return chr(int('0x' + matchobj.group(1), 16))
s1 = re.sub(r'\\x([0-9a-fA-F]{2})', to1byte, s0)
But, is it that difficult on doing this simple thing?
>>> import codecs
>>>
Thomas Passin 在 2022年12月7日 星期三中午12:51:32 [UTC+8] 的信中寫道:
> On 12/6/2022 9:23 PM, Jach Feng wrote:
> > s0 = r'\x0a'
> > At this moment it was done by
> >
> > def to1byte(matchobj):
> > return chr(int('0x' + matchobj.group(1), 16))
> > s1 = re.sub(r'\\x([0-9a-fA-F]{2})', to1byte, s0)
> >
>
Op 7/12/2022 om 4:37 schreef Jach Feng:
MRAB 在 2022年12月7日 星期三上午11:04:43 [UTC+8] 的信中寫道:
> On 2022-12-07 02:23, Jach Feng wrote:
> > s0 = r'\x0a'
> > At this moment it was done by
> >
> > def to1byte(matchobj):
> > return chr(int('0x' + matchobj.group(1), 16))
> > s1 = re.sub(r'\\x([0-9
On 12/6/2022 9:23 PM, Jach Feng wrote:
s0 = r'\x0a'
At this moment it was done by
def to1byte(matchobj):
return chr(int('0x' + matchobj.group(1), 16))
s1 = re.sub(r'\\x([0-9a-fA-F]{2})', to1byte, s0)
But, is it that difficult on doing this simple thing?
--Jach
I'm not tota
MRAB 在 2022年12月7日 星期三上午11:04:43 [UTC+8] 的信中寫道:
> On 2022-12-07 02:23, Jach Feng wrote:
> > s0 = r'\x0a'
> > At this moment it was done by
> >
> > def to1byte(matchobj):
> > return chr(int('0x' + matchobj.group(1), 16))
> > s1 = re.sub(r'\\x([0-9a-fA-F]{2})', to1byte, s0)
> >
> > But, is
On 2022-12-07 02:23, Jach Feng wrote:
s0 = r'\x0a'
At this moment it was done by
def to1byte(matchobj):
return chr(int('0x' + matchobj.group(1), 16))
s1 = re.sub(r'\\x([0-9a-fA-F]{2})', to1byte, s0)
But, is it that difficult on doing this simple thing?
You could try this:
s0 = r'\x0a'
At this moment it was done by
def to1byte(matchobj):
return chr(int('0x' + matchobj.group(1), 16))
s1 = re.sub(r'\\x([0-9a-fA-F]{2})', to1byte, s0)
But, is it that difficult on doing this simple thing?
--Jach
--
https://mail.python.org/mailman/listinfo/python-list
Cameron Simpson wrote:
> On 29Aug2020 16:50, Chris Green wrote:
> >However the problem appears to be that internally in Python 3 mailbox
> >class there is an assumption that it's being given 'ascii'. Here's
> >the error (and I'm doing no processing of the message at all):-
> >
> >Traceback (
Karsten Hilbert wrote:
> > However the problem appears to be that internally in Python 3 mailbox
> > class there is an assumption that it's being given 'ascii'.
>
> Do you really _need_ the mailbox class ? From what you've
> written so far my understanding was that you receive data
> (bytes) and
On 29Aug2020 16:50, Chris Green wrote:
>However the problem appears to be that internally in Python 3 mailbox
>class there is an assumption that it's being given 'ascii'. Here's
>the error (and I'm doing no processing of the message at all):-
>
>Traceback (most recent call last):
> File
> Just appending a message as a raw file to a mailbox, doesn't properly
> add it as a new message. You need to add a From: line to the front, and
> then go through the message and alter any line that begins as "From:"
> (and possibly any line that begins with something like ">From:" or
> ">>From:"
On 8/29/20 3:31 PM, Karsten Hilbert wrote:
>> However the problem appears to be that internally in Python 3 mailbox
>> class there is an assumption that it's being given 'ascii'.
> Do you really _need_ the mailbox class ? From what you've
> written so far my understanding was that you receive data
> However the problem appears to be that internally in Python 3 mailbox
> class there is an assumption that it's being given 'ascii'.
Do you really _need_ the mailbox class ? From what you've
written so far my understanding was that you receive data
(bytes) and want to append that to a file (which
On 8/29/20 11:50 AM, Chris Green wrote:
> Chris Green wrote:
>> Dennis Lee Bieber wrote:
>>> On Fri, 28 Aug 2020 12:26:07 +0100, Chris Green declaimed
>>> the
>>> following:
>>>
>>>
>>>
Maybe I shouldn't but Python 2 has been managing to do so for several
years without any issues. I
Chris Green wrote:
> Dennis Lee Bieber wrote:
> > On Fri, 28 Aug 2020 12:26:07 +0100, Chris Green declaimed
> > the
> > following:
> >
> >
> >
> > >Maybe I shouldn't but Python 2 has been managing to do so for several
> > >years without any issues. I know I *could* put the exceptions in a
>
Dennis Lee Bieber wrote:
> On Fri, 28 Aug 2020 12:26:07 +0100, Chris Green declaimed the
> following:
>
>
>
> >Maybe I shouldn't but Python 2 has been managing to do so for several
> >years without any issues. I know I *could* put the exceptions in a
> >bucket somewhere and deal with them sep
On 2020-08-28, Chris Green wrote:
> Maybe I shouldn't but Python 2 has been managing to do so for several
> years without any issues. I know I *could* put the exceptions in a
> bucket somewhere and deal with them separately but I'd really rather
> not.
Then just leave it as bytes and do whateve
On 2020-08-27, Chris Green wrote:
> bbb = [b'aaa', b'bbb', b'ccc']
> sss = []
> for i in range(0, 2):
> sss.append(str(bbb[i])
>
> but that does seem a bit clumsy. Is there a better way?
sss = [str(s) for s in bbb]
--
Grant
--
https://mail.python.org/mailman/listinfo/pyth
On 2020-08-27, Marco Sulla wrote:
> Are you sure you want `str()`?
>
str(b'aaa')
> "b'aaa'"
>
> Probably you want:
>
> map(lambda x: x.decode(), bbb)
If you're an old Scheme or Lisp programmer. :)
This is probably the more usual way to spell it:
sss = [x.decode() for x in bbb]
--
ht
On 28Aug2020 12:26, Chris Green wrote:
>Cameron Simpson wrote:
>> POP3 is presumably handing you bytes containing a message. If the
>> Python
>> email.BytesParser doesn't handle it, stash the raw bytes _elsewhere_ in
>> a distinct file in some directory.
>>
>> with open('evil_msg_bytes', 'wb
On 8/28/20 8:44 AM, Chris Green wrote:
> Stefan Ram wrote:
>> Chris Green writes:
>>> Therein lies the problem, the incoming byte stream *isn't* ASCII, it's
>>> an E-Mail message which may, for example, have UTF-8 or other encoded
>>> characters in it. Hopefully it will have an encoding given in
On Fri, Aug 28, 2020 at 11:24 PM Chris Green wrote:
>
> Chris Angelico wrote:
> >
> > Also, if you're parsing an email message, you can and should be doing
> > so with respect to the encoding(s) stipulated in the headers, after
> > which you will have valid Unicode text.
> >
> But not all E-Mail
On 2020-08-28 08:30, Richard Damon wrote:
> This might be one of the cases where Python 2's lack handling of string
> vs bytes was an advantage.
For English speaking Americans.
> Python2 handled that sort of case quite easily. Python 3 on the other
> hand, will have issue converting the byte mess
Chris Angelico wrote:
>
> Also, if you're parsing an email message, you can and should be doing
> so with respect to the encoding(s) stipulated in the headers, after
> which you will have valid Unicode text.
>
But not all E-Mail messages are 'well behaved', the above works fine
if the headers sp
> I want to transport the message into my mbox and Python 3 won't do it
> without knowing how it's encoded whereas Python 2 just stuffed it in
> there 'as is'.
>
> I want Python 3's mailbox class to juyst put what I tell it (even if
> mis-formatted or mis-encoded) into the mbox.
I guess using the
On 8/28/20 8:39 AM, Chris Green wrote:
> Richard Damon wrote:
>> On 8/28/20 7:50 AM, Karsten Hilbert wrote:
> No interpreation requires, since parsing failed. Then you can start
> dealing with these exceptions. _Do not_ write unparsable messages into
> an mbox!
>
Maybe I shoul
On Fri, Aug 28, 2020 at 10:51 PM Chris Green wrote:
>
> > One possible solution in Python3 is to decode the byte string using an
> > encoding that allows all 256 byte values, so it won't raise any encoding
> > errors, just give your possibly non-sense characters for non-ASCII text.
> >
> But this
Stefan Ram wrote:
> Chris Green writes:
> >Therein lies the problem, the incoming byte stream *isn't* ASCII, it's
> >an E-Mail message which may, for example, have UTF-8 or other encoded
> >characters in it. Hopefully it will have an encoding given in the
> >header but that's only if the sender
Richard Damon wrote:
> On 8/28/20 7:50 AM, Karsten Hilbert wrote:
> >>> No interpreation requires, since parsing failed. Then you can start
> >>> dealing with these exceptions. _Do not_ write unparsable messages into
> >>> an mbox!
> >>>
> >> Maybe I shouldn't but Python 2 has been managing to do
On Fri, Aug 28, 2020 at 10:32 PM Richard Damon wrote:
>
> This might be one of the cases where Python 2's lack handling of string
> vs bytes was an advantage.
>
> If he was just scanning the message for specific ASCII strings, then not
> getting the full message decoded write is unlikely to have b
On 8/28/20 7:50 AM, Karsten Hilbert wrote:
>>> No interpreation requires, since parsing failed. Then you can start
>>> dealing with these exceptions. _Do not_ write unparsable messages into
>>> an mbox!
>>>
>> Maybe I shouldn't but Python 2 has been managing to do so for several
>> years without an
On 8/28/20 7:50 AM, Karsten Hilbert wrote:
>>> No interpreation requires, since parsing failed. Then you can start
>>> dealing with these exceptions. _Do not_ write unparsable messages into
>>> an mbox!
>>>
>> Maybe I shouldn't but Python 2 has been managing to do so for several
>> years without an
> > No interpreation requires, since parsing failed. Then you can start
> > dealing with these exceptions. _Do not_ write unparsable messages into
> > an mbox!
> >
> Maybe I shouldn't but Python 2 has been managing to do so for several
> years without any issues.
I am inclined to congratulate you
Cameron Simpson wrote:
> On 28Aug2020 08:56, Chris Green wrote:
> >Stefan Ram wrote:
> >> Chris Angelico writes:
> >> >But this is a really good job for a list comprehension:
> >> >sss = [str(word) for word in bbb]
> >>
> >> Are you all sure that "str" is really what you all want?
> >>
> >Not
On 28Aug2020 08:56, Chris Green wrote:
>Stefan Ram wrote:
>> Chris Angelico writes:
>> >But this is a really good job for a list comprehension:
>> >sss = [str(word) for word in bbb]
>>
>> Are you all sure that "str" is really what you all want?
>>
>Not absolutely, you no doubt have been follow
Cameron Simpson wrote:
> On 27Aug2020 23:54, Marco Sulla wrote:
> >Are you sure you want `str()`?
> >
> str(b'aaa')
> >"b'aaa'"
> >
> >Probably you want:
> >
> >map(lambda x: x.decode(), bbb)
>
> _And_ you need to know the encoding of the text in the bytes. The above
> _assumes_ UTF-8 beca
Chris Angelico wrote:
> On Fri, Aug 28, 2020 at 6:36 AM Chris Green wrote:
> >
> > This sounds quite an easy thing to do but I can't find how to do it
> > elegantly.
> >
> > I have a list of bytes class objects (i.e. a list containing sequences
> > of bytes, which are basically text) and I want t
Stefan Ram wrote:
> Chris Angelico writes:
> >But this is a really good job for a list comprehension:
> >sss = [str(word) for word in bbb]
>
> Are you all sure that "str" is really what you all want?
>
Not absolutely, you no doubt have been following other threads related
to this one. :-)
> >Are you sure you want `str()`?
> >
> str(b'aaa')
> >"b'aaa'"
> >
> >Probably you want:
> >
> >map(lambda x: x.decode(), bbb)
>
> _And_ you need to know the encoding of the text in the bytes. The above
> _assumes_ UTF-8 because that is the default for bytes.decode, and if
> that is _not_ wha
On 27Aug2020 23:54, Marco Sulla wrote:
>Are you sure you want `str()`?
>
str(b'aaa')
>"b'aaa'"
>
>Probably you want:
>
>map(lambda x: x.decode(), bbb)
_And_ you need to know the encoding of the text in the bytes. The above
_assumes_ UTF-8 because that is the default for bytes.decode, and if
Are you sure you want `str()`?
>>> str(b'aaa')
"b'aaa'"
Probably you want:
map(lambda x: x.decode(), bbb)
--
https://mail.python.org/mailman/listinfo/python-list
On Fri, Aug 28, 2020 at 6:36 AM Chris Green wrote:
>
> This sounds quite an easy thing to do but I can't find how to do it
> elegantly.
>
> I have a list of bytes class objects (i.e. a list containing sequences
> of bytes, which are basically text) and I want to convert it to a list
> of string ob
This sounds quite an easy thing to do but I can't find how to do it
elegantly.
I have a list of bytes class objects (i.e. a list containing sequences
of bytes, which are basically text) and I want to convert it to a list
of string objects.
One of the difficulties of finding out how to do this is
Hi all
I hope all are doing well
please help me how to convert CSV to NetCDF. Im trying but its not working
#!/usr/bin/env ipython
import pandas as pd
import numpy as np
import netCDF4
import pandas as pd
import xarray as xr
stn_precip='ts_sept.csv'
orig_precip='ts_sep
On 2019-11-28 15:35, Dennis Lee Bieber wrote:
On Thu, 28 Nov 2019 12:45:27 +, Ben Bacarisse
declaimed the following:
Madhavan Bomidi writes:
print,'Column ',J,' of product matrix A*AINV:',format='(1X,A7,I3,A27)'
I don't know what the 1X format does. The A7 and A27 formats just see
> On Nov 28, 2019, at 9:35 AM, Dennis Lee Bieber wrote:
>
> Channeling ancient FORTRAN, I'd interpret it as
>
> 1XSkip one space
> A7Seven character alpha
> I3Three digit integer
> A2727 character alpha
>
> and it is rather painful when the arguments are litera
Madhavan Bomidi writes:
> I have the following IDL program lines. I want to write equivalent
> Python program lines. Can anyone suggest me equivalent Pythons program
> lines?
>
> # --- 1 --- #
> How to handle the format in IDL to Python?
>
> IDL program line:
>
Hi,
I have the following IDL program lines. I want to write equivalent Python
program lines. Can anyone suggest me equivalent Pythons program lines?
# --- 1 --- #
How to handle the format in IDL to Python?
IDL program line:
print,'Column ',J,' of product mat
> On Apr 26, 2019, at 4:18 AM, Arup Rakshit wrote:
>
> I have modelled which starts running once drivers and stations are assigned
> to it. Otherwise, it doesn’t run, really don’t care if passengers are boarded
> or not at this moment. :) I think this program can help me to introduce to
> the
I have modelled which starts running once drivers and stations are assigned to
it. Otherwise, it doesn’t run, really don’t care if passengers are boarded or
not at this moment. :) I think this program can help me to introduce to the
Python async programming domain.
Here is my program:
# - - -
On Fri, Sep 14, 2018 at 2:37 PM, Noel P. CUA wrote:
> compose your own octave script to calculate the machine
> epsilon. Analyze the code.
>
> epsilon = 1
> DO
> IF (epsilon+1<=1) EXIT
> epsilon = epsilon/2
> END DO
> epsilon = 2 x epsilon
>
epsilon = 1
while epsilon + 1 > 1:
epsilon = epsi
compose your own octave script to calculate the machine
epsilon. Analyze the code.
epsilon = 1
DO
IF (epsilon+1<=1) EXIT
epsilon = epsilon/2
END DO
epsilon = 2 x epsilon
--
*This email and any files transmitted with it are confidential and
intended solely for the use of the individual or enti
Ho Yeung Lee wrote:
> after edit the file,
>
> Traceback (most recent call last):
> File "json2csv.py", line 148, in
> loader.load(args.json_file)
> File "json2csv.py", line 53, in load
> self.process_each(json.load(json_file))
> File "C:\Python27\lib\json\__init__.py", line 291, i
after edit the file,
Traceback (most recent call last):
File "json2csv.py", line 148, in
loader.load(args.json_file)
File "json2csv.py", line 53, in load
self.process_each(json.load(json_file))
File "C:\Python27\lib\json\__init__.py", line 291, in load
**kw)
File "C:\Python27
On 3 June 2017 at 13:00, Ho Yeung Lee wrote:
> i use
> https://github.com/evidens/json2csv
>
> Error:
> Traceback (most recent call last):
> File "json2csv.py", line 148, in
> loader.load(args.json_file)
> File "json2csv.py", line 53, in load
> self.process_each(json.load(json_file))
i use
https://github.com/evidens/json2csv
Error:
Traceback (most recent call last):
File "json2csv.py", line 148, in
loader.load(args.json_file)
File "json2csv.py", line 53, in load
self.process_each(json.load(json_file))
File "C:\Python27\lib\json\__init__.py", line 291, in load
http://construct.readthedocs.io/en/latest/basics.html
format.build can build the hex string,
but after edit attribute of the format parse result
it is a container, how to convert this container back to format build result?
#format.parse(format.build(dict(width=3,height=2,pixels=[7,8,9,11,12,13
On Sun, 25 Sep 2016 09:08 am, Thomas 'PointedEars' Lahn wrote:
> Christian Gollwitzer wrote:
>
>> Am 17.09.16 um 23:19 schrieb Thomas 'PointedEars' Lahn:
>>> Peng Yu wrote:
Hi, I want to convert strings in which the characters with accents
should be converted to the ones without accents
Am 25.09.16 um 01:08 schrieb Thomas 'PointedEars' Lahn:
Christian Gollwitzer wrote:
Am 17.09.16 um 23:19 schrieb Thomas 'PointedEars' Lahn:
Peng Yu wrote:
Hi, I want to convert strings in which the characters with accents
should be converted to the ones without accents.
[…]
[…]
./main.py Fö
Den 2016-09-25 skrev wxjmfa...@gmail.com :
>
> As an European guy, I recommend to use the characters
> set used in the "official" font families used in Germany:
> BundesSerif / BundesSans.
>
> See
> https://styleguide.bundesregierung.de/Webs/SG/DE/PrintMedien/Basiselemente/Schriften/schriften_node.
On Sunday 18 September 2016 17:51, Terry Reedy wrote:
> On 9/18/2016 2:45 AM, Steven D'Aprano wrote:
>
>> It doesn't matter whether you call them "accent" like most people do, or
>> "diacritics" as linguists do.
>
> I am a native born American and I have never before heard or seen
> non-accent d
Il 18/09/2016 08:45, Steven D'Aprano ha scritto:
integral part of the letter, like the horizonal stroke in English t or the
vertical bar in English p and b, and in some languages they are modifiers,
well... that is the Latin alphabet
English has no T, P or B (or any other character) but is jus
Thorsten Kampe :
> * Terry Reedy (Sun, 18 Sep 2016 03:51:40 -0400)
>> On 9/18/2016 2:45 AM, Steven D'Aprano wrote:
>> > It doesn't matter whether you call them "accent" like most people do, or
>> > "diacritics" as linguists do.
>>
>> I am a native born American and I have never before heard or se
* Terry Reedy (Sun, 18 Sep 2016 03:51:40 -0400)
>
> On 9/18/2016 2:45 AM, Steven D'Aprano wrote:
>
> > It doesn't matter whether you call them "accent" like most people do, or
> > "diacritics" as linguists do.
>
> I am a native born American and I have never before heard or seen
> non-accent di
Den 2016-09-17 skrev Marko Rauhamaa :
> Martin Schöön :
>> Related anecdote from Phoenix AZ. By now you have noticed my family
>> name: Schöön. On airline tickets and boarding passes in the U.S. it
>> gets spelled Schoeoen.
>
> Do Swedes do that German thing, too? If you have to write Finnish
> wit
Am 17.09.16 um 23:19 schrieb Thomas 'PointedEars' Lahn:
Peng Yu wrote:
Hi, I want to convert strings in which the characters with accents
should be converted to the ones without accents.
Why?
[…]
./main.py Förstemann
AFAIK, “ä”, “ö”, and “ü” are not accented characters in any natural
lang
On 9/18/2016 2:45 AM, Steven D'Aprano wrote:
It doesn't matter whether you call them "accent" like most people do, or
"diacritics" as linguists do.
I am a native born American and I have never before heard or seen
non-accent diacritic marks called 'accents'. Accents indicate stress.
Other d
On Sunday 18 September 2016 15:59, Thorsten Kampe wrote:
> * Martin Schöön (17 Sep 2016 20:20:12 GMT)
>>
>> Den 2016-09-17 skrev Kouli :
>> > Hello, try the Unidecode module - https://pypi.python.org/pypi/Unidecode.
>> >
>> > Kouli
>> >
>> > On Sat, Sep 17, 2016 at 6:12 PM, Peng Yu wrote:
>> >>
On Sunday 18 September 2016 13:30, Peng Yu wrote:
> On Sat, Sep 17, 2016 at 3:20 PM, Martin Schöön
> wrote:
>> Den 2016-09-17 skrev Kouli :
>>> Hello, try the Unidecode module - https://pypi.python.org/pypi/Unidecode.
>
> I don't find a way to make it print oe for ö. Could anybody please
> advis
* Martin Schöön (17 Sep 2016 20:20:12 GMT)
>
> Den 2016-09-17 skrev Kouli :
> > Hello, try the Unidecode module - https://pypi.python.org/pypi/Unidecode.
> >
> > Kouli
> >
> > On Sat, Sep 17, 2016 at 6:12 PM, Peng Yu wrote:
> >> Hi, I want to convert strings in which the characters with accents
>
On Sun, 18 Sep 2016 07:19 am, Thomas 'PointedEars' Lahn wrote:
> AFAIK, “ä”, “ö”, and “ü” are not accented characters in any natural
> language, but characters of their own (umlauts).
Are you saying that English is not a natural language?
--
Steve
“Cheer up,” they said, “things could be wo
On Sat, Sep 17, 2016 at 3:20 PM, Martin Schöön wrote:
> Den 2016-09-17 skrev Kouli :
>> Hello, try the Unidecode module - https://pypi.python.org/pypi/Unidecode.
I don't find a way to make it print oe for ö. Could anybody please
advise what is the correct way to do it?
==> main.py <==
#!/usr/bin
Martin Schöön :
> Related anecdote from Phoenix AZ. By now you have noticed my family
> name: Schöön. On airline tickets and boarding passes in the U.S. it
> gets spelled Schoeoen.
Do Swedes do that German thing, too? If you have to write Finnish
without ä and ö, you simply leave out the dots. (On
Den 2016-09-17 skrev Kouli :
> Hello, try the Unidecode module - https://pypi.python.org/pypi/Unidecode.
>
> Kouli
>
> On Sat, Sep 17, 2016 at 6:12 PM, Peng Yu wrote:
>> Hi, I want to convert strings in which the characters with accents
>> should be converted to the ones without accents. Here is m
Hello, try the Unidecode module - https://pypi.python.org/pypi/Unidecode.
Kouli
On Sat, Sep 17, 2016 at 6:12 PM, Peng Yu wrote:
> Hi, I want to convert strings in which the characters with accents
> should be converted to the ones without accents. Here is my current
> code.
>
> =
Hi, I want to convert strings in which the characters with accents
should be converted to the ones without accents. Here is my current
code.
$ cat main.sh
#!/usr/bin/env bash
# vim: set noexpandtab tabstop=2:
set -v
./main.py Förstemann
./main.py Frédér8ic@
$ cat main.p
Ben Finney writes:
> The ‘cmp’ implementation must decide *at least* between three
> conditions... The implementation of ‘__lt__’ and the implementation
> of ‘__eq__’ each only need to decide two conditions (true, false).
> If you're saying the latter implementation is somehow *more* expensive
>
Antoon Pardon :
> And when I need some personal object as a key, I can avoid the
> duplication by using some kind of cmp cache when I implement __lt__
> and family.
Yes, that's what you can do in rare, extreme cases where key comparison
takes a long time. For caching, you will simply need to requ
Op 09-04-16 om 17:31 schreef Chris Angelico:
> On Sun, Apr 10, 2016 at 1:24 AM, Antoon Pardon
> wrote:
>>
>> So? I need a structure that can easily give me an answer to the
>> following: Given key1 and key2 what are the the keys between them
>> with their corresponding values. As long as a dict ca
On Sat, Apr 9, 2016, at 07:49, Ben Finney wrote:
> I find that a dubious claim.
>
> The ‘cmp’ implementation must decide *at least* between three
> conditions: less-than, equal-to, greater-than. That is *at least* two
> inflection points.
Yes, but in a sequence it can decide that at each element,
On Sun, Apr 10, 2016 at 1:24 AM, Antoon Pardon
wrote:
> Op 09-04-16 om 16:41 schreef Chris Angelico:
>
>>
>> In this case, you're likely to end up with large branches of your tree
>> that have the same prefix. (And if you don't, your iterations are all
>> going to end early anyway, so the comparis
Op 09-04-16 om 16:41 schreef Chris Angelico:
>
> In this case, you're likely to end up with large branches of your tree
> that have the same prefix. (And if you don't, your iterations are all
> going to end early anyway, so the comparison is cheap.) A data
> structure that takes this into account
Antoon Pardon :
> Now this probably is not a problem most of the times, but when you
> work with tree's this kind of comparison to make a three way decision
> happens often and the lower you descend in the tree, the close your
> argument will be with the keys of the nodes you visit, making it more
On Sun, Apr 10, 2016 at 12:25 AM, Antoon Pardon
wrote:
> Let me give you an artifical example to show what can happen. The keys are all
> iterables of equal lengths with integers as elements.
>
> Then this could be the cmp function:
>
> def cmp(ob1, ob2):
> itr1 = iter(ob1)
> itr2 = iter(o
Op 09-04-16 om 13:49 schreef Ben Finney:
> Antoon Pardon writes:
>
>> You don't seem to understand. I only do two comparisons and no the
>> equality is not necesarrily cheaper.
>>
>> I am talking about the difference between the following two:
>>
>> if arg.key < node.key: # possible expensi
Antoon Pardon writes:
> You don't seem to understand. I only do two comparisons and no the
> equality is not necesarrily cheaper.
>
> I am talking about the difference between the following two:
>
> if arg.key < node.key: # possible expensive computation
> go_left()
> elif arg.k
Op 08-04-16 om 16:25 schreef Chris Angelico:
> On Sat, Apr 9, 2016 at 12:20 AM, Antoon Pardon
> wrote:
>>> You only need ONE comparison, and the other is presumed to be its
>>> opposite. When, in the Python 3 version, would you need to compare
>>> twice?
>>
>> About 50% of the time. When I travers
Ian Kelly :
> On Fri, Apr 8, 2016 at 10:33 AM, Marko Rauhamaa wrote:
>> Ian Kelly :
>>
>>> That's fine for those operations and probably insert, but how do you
>>> search an AVL tree for a specific key without also using __eq__?
>>
>> Not needed:
>>
>>
On Fri, Apr 8, 2016 at 10:33 AM, Marko Rauhamaa wrote:
> Ian Kelly :
>
>> That's fine for those operations and probably insert, but how do you
>> search an AVL tree for a specific key without also using __eq__?
>
> Not needed:
>
> ===
1 - 100 of 584 matches
Mail list logo