2010/11/30 Dax Bloom :
> Hello,
>
> Following a discussion that began 3 weeks ago I would like to ask a
> question regarding substitution of letters according to grammatical
> rules in historical linguistics. I would like to automate the
> transformation of words according to complex rules of phono
2010/12/9 Anurag Chourasia :
> Hi All,
> When i try to set a locale manually, i get this error.
import locale
locale.setlocale(locale.LC_ALL, 'es_cl.iso88591')
> Traceback (most recent call last):
> File "", line 1, in
> File "/usr/local/lib/python2.7/locale.py", line 531, in setloca
2010/12/19 Martin Hvidberg :
> Dear list
>
> I have to read some data from an ASCII text file, filter it, and then export
> it to a .dbf file. Basically a straight forward task...
> My problem is that the input files contains some special national (Danish)
> characters, and it appears that I have t
2010/12/22 Ciccio :
> Hi all,
> suppose I have:
>
> s='a=b, c=d'
>
> and I want to extract sub-strings a,b,c and d from s (and in general from
> any longer list of such comma separated pairs).
> Some failed attempts:
>
> In [12]: re.findall(r'(.+)=(.+)', s)
> Out[12]: [('a=b, c', 'd')]
>
> [...]
>
2011/2/5 Lisa Fritz Barry Griffin :
> Hi there,
>
> How can I do this in a one liner:
>
> maxCountPerPhraseWordLength = {}
> for i in range(1,MAX_PHRASES_LENGTH+1):
> maxCountPerPhraseWordLength[i] = 0
>
> Thanks!
> --
> http://mail.python.org/mailman/listinfo/python-list
>
2011/2/8, Paul Rubin :
> noydb writes:
>> I am looking for ways to go about capturing the frequency of unique
>> values in one field in a dbf table which contains ~50k records. The
>> values are numbers with atleast 5 digits to the right of the decimal,
>> but I want the frequency of values to on
2011/2/11 Mark Carter :
> Is there a way of testing whether a frame (suppose I have it as a
> variable my_frame) is hidden in wxPython?
>
> Also, is there a way that I can over-ride the close button so that the
> frame becomes hidden rather than destroyed, and perform supplementary
> tests?
> --
>
Hi all,
Once in a while I happen to stumble on some not expected behaviour of
difflib.SequenceMatcher, in this case I hopefully managed to replicate
it on an illustrative sample text.
Both strings differ in a minimal way, each having one extra character
in a "strategic" position, which seems to mee
From: Vlastimil Brom
Date: 2010/4/16
Subject: unexpected output from difflib.SequenceMatcher
...
Instead of just reporting the insertion and deletion of these single
characters ... the output of the
SequenceMatcher decides to delete a large part of the string in
between the differences and to
2010/5/9 Robin :
> Does anyone know of a way I can make a python script into an exe that
> runs on windows7, I don't care if it is a python to c++ or python to c
> translator or anything like it. The version of python I am using is
> python 3.1. Thanks,
> -Robin
> --
> http://mail.python.org/mailma
2010/5/24 joy99 :
>
>
> Dear Group,
>
> I have a small question on function.
>
> If I write two functions like the following:
>
> IDLE 2.6.5
def function1(n):
> element1=5
> element2=6
> add=element1+element2
> print "PRINT THE ADDITION",add
>
>
def function2(n
Hi all,
I'd like to ask about the most reasonable/recommended/... way to
modify the functionality of the standard library module (if it is
recommended at all).
I'm using difflib.SequenceMatcher for character-wise comparisons of
the texts; although this might not be a usual use case, the results
are
2010/6/24 Bruno Desthuilliers :
> Vlastimil Brom a écrit :
>>
>> Hi all,
>> I'd like to ask about the most reasonable/recommended/... way to
>> modify the functionality of the standard library module (if it is
>> recommended at all).
>
> ...
>>
2010/6/24 Bruno Desthuilliers :
> Vlastimil Brom a écrit :
>
> "patching source code" canonically means "physically" modifying the original
> source file. Monkeypatching - which can only be done in some dynamic
> languages - is what you're doing
2010/7/6 Chris Rebert :
> On Mon, Jul 5, 2010 at 4:56 PM, Massimo Di Pierro
> wrote:
>> Markmin is a wiki markup language
>> implemented in less than 100 lines of code (one file, no dependencies)
>> easy to read
>> secure
>> ...
>
> Okay, but where can it be downloaded from? You didn't include a l
2010/7/19 oyster :
> I mean writeonly, hidden, system and so on attributes
>
> I use windows, but if possible, is there any method to do so in a
> crossplatfrom way?
>
> thanks
> --
> http://mail.python.org/mailman/listinfo/python-list
>
You may check to see several possibilities
http://timgolden.
2010/7/19 dhruvbird :
> Hello,
> I have a list of integers: x = [ 0, 1, 2, 1, 1, 0, 0, 2, 3 ]
> And would like to compute the cumulative sum of all the integers
> from index zero into another array. So for the array above, I should
> get: [ 0, 1, 3, 4, 5, 5, 5, 7, 10 ]
> What is the best way (or
2010/8/5 kj :
>
> Is there a simple way to get Python to pretty-print a dict whose
> values contain Unicode? (Of course, the goal here is that these
> printed values are human-readable.)
>
> If I run the following simple script:
>
> from pprint import pprint
> x = u'\u6c17\u304c\u9055\u3046'
> pri
2010/8/21 :
> Python 2.6: Is there a built-in way to check if a Unicode string has
> non-ASCII chars without having to check each char in the string?
>
> Here's my use case: I have a section of code that makes frequent calls to
> hasattr. The attribute name being tested is derived from incoming da
2009/6/10 Nick Matzke :
> Hi all,
>
> So I'm parsing an XML file returned from a database. However, the database
> entries have occasional non-ASCII characters, and this is crashing my
> parsers.
>
> Is there some handy function out there that will schlep through a file like
> this, and do somethi
2009/6/12 meryl :
> On Jun 11, 9:41 pm, "Mark Tolonen" wrote:
>> "meryl" wrote in message
>>
>> > I have this regular expression
>...
> I try adding ".*" at the end , but it ends up just matching the second
> one.
If there can be more matches in a line, maybe the non-greedy
quantifier ".*?", a
2009/6/22 aberry :
>
> I am facing an error on Unicode decoding of path if it contain a folder/file
> name starting with character 'u' .
>
> Here is what I did in IDLE
> 1. >>> fp = "C:\\ab\\anil"
> 2. >>> unicode(fp, "unicode_escape")
> 3. u'C:\x07b\x07nil'
> 4. >>> fp = "C:\\ab\\unil"
> 5. >>> un
2009/8/8 Дамјан Георгиевски :
>
>
>>> Is there any easy function in the stdlib to convert any random string
>>> in a valid Python identifier .. possibly by replacing non-valid
>>> characters with _ ?
...
>
> ps.
> by "convert" I didn't mean a full transformation... I was more hoping
> for the least
2009/8/14 Prateek :
> Hi,
>
> Can somebody please provide me link to a good online resource or e-
> book for doing natural language processing programming in Python.
>
> Thanks,
> Prateek
> --
> http://mail.python.org/mailman/listinfo/python-list
>
Maybe you could start with NLTK
http://www.nltk.o
2009/8/17 MRAB :
> Diez B. Roggisch wrote:
>>
>> Pierre wrote:
>>
>>> Hello Everyone,
>>>
>>> I would like to know if it is possible to extract a sub-list from a
>>> list ?
>>>
>>> typically if :
>>>
>>> L =[[1, 2, 3],[4, 5, 6],[3] ]
>>>
>>> How to extract easily the elements 0 and 2 of L in order
2009/8/22 AK :
> Steven D'Aprano wrote:
>>
>> On Sat, 22 Aug 2009 04:20:23 -0400, AK wrote:
>>
>>> Hi, if I have a string '\\303\\266', how can I convert it to '\303\266'
>>> in a general way?
>>
>> It's not clear what you mean.
>>
>> Do you mean you have a string '\\303\\266', that is:
>>
>> backs
2009/8/22 AK :
> Vlastimil Brom wrote:
>>
>> 2009/8/22 AK :
>>>
>>> Steven D'Aprano wrote:
>>>>
>>>> On Sat, 22 Aug 2009 04:20:23 -0400, AK wrote:
>>>>
>>>>> Hi, if I have a string '\\303\\266'
2009/8/25 :
> In Python 2.5 on Windows I could do [*1]:
>
> # Create a unicode character outside of the BMP.
> >>> a = u'\U00010040'
>
> # On Windows it is represented as a surogate pair.
> >>> len(a)
> 2
> >>> a[0],a[1]
> (u'\ud800', u'\udc40')
>
> # Create the same character with the uni
2009/8/27 :
> On Aug 26, 2:05 am, Vlastimil Brom wrote:
>>[...]
>>...
>> However, if I need these functions for higher unicode planes, the
>> following rather hackish replacements seem to work. I presume, there
>> might be smarter ways of dealing with this, b
2009/8/28 hoffik :
>
> Hello,
>
> I'm quite new in Python and I have one question. I have a 2D matrix of
> values stored in list (3 columns, many rows). I wonder if I can select one
> column without having to go through the list with 'for' command.
> ...
I guess, it won't be possible without an ex
2009/8/29 :
> On 08/28/2009 02:12 AM, "Martin v. Löwis" wrote:
>
> So far, it seems not and that unichr/ord
> is a poster child for "purity beats practicality".
> --
> http://mail.python.org/mailman/listinfo/python-list
>
As Mark Tolonen pointed out earlier in this thread, in Python 3 the
practic
2009/9/8 æ¾å°èªå·±çä¸ç天 :
> I have the following source code
>
>
> import re
> d = 'RTCB\r\nsignature:\xf1\x11
> \xde\x10\xfe\x0f\x9c\x10\xf6\xc9_\x10\xf3\xeb<\x10\xf2Zt\x10\xef\xd2\x91\x10\xe6\xe7\xfb\x10\xe5p\x99\x10\xe2\x1e\xdf\x10\xdb\x0e\x9f\x10\xd8p\x06\x10\
2009/9/10 Hans Georg Schaathun :
> I wonder if someone knows of an API with the features I need...
> random.Random and numpy.random each have only half of it...
>
> My application includes an object to hold a pseudo-randomly
> generated matrix too large to be kept in memory. Hence I
> try to store
2009/9/12 Steven D'Aprano :
> On Fri, 11 Sep 2009 15:19:05 -0700, Chris Rebert wrote:
>
>> Sounds like IOError or one of its ancestors defines both __str__() and
>> __unicode__ () special methods but has them produce different output.
>
>
> That's what it looks like to me too, which I wouldn't call
2009/9/15 Ulrich Eckhardt :
> Hi!
>
> "'abc'.split('')" gives me a "ValueError: empty separator".
> However, "''.join(['a', 'b', 'c'])" gives me "'abc'".
>
> Why this asymmetry? I was under the impression that the two would be
> complementary.
>
> Uli
>
maybe it isn't quite obvious, what the behav
2009/9/15 John Nagle :
> I'm looking for something that can draw simple bar and pie charts
> in Python. I'm trying to find a Python package, not a wrapper for
> some C library, as this has to run on both Windows and Linux
> and version clashes are a problem.
>
> Here's the list from the Python wik
2009/9/18 Ross :
>
> Learning my way around list comprehension a bit. I wonder if someone has a
> better way to solve this issue. I have a two element dictionary, and I know
> one of the keys but not the other, and I want to look up the other one.
>
> So I have this dictionary:
>
> aDict = {'a':
2009/9/22 kaoruAngel :
> I recently decided to implement a small project in python after being
> away from the language for a while, so, in learning the language over
> again, I experimented.
>
> ---
> Python 3.1.1 (r311:74483, Aug 17 2009, 16:45:59) [MSC v.1500
Thanks for the elaboration;
in retrospect, given the simple requirement, that there are only two
dict keys, one of which is know and the other to be determined, maybe
just the direct dict methods are appropriate, e.g.
d = {'a': 'bob', 'b': 'stu'}
d_copy = dict(d)
d_copy.pop("a")
'bob'
d_copy.popit
2010/8/25 Jed :
> Hi, I'm seeking help with a fairly simple string processing task.
> I've simplified what I'm actually doing into a hypothetical
> equivalent.
> Suppose I want to take a word in Spanish, and divide it into
> individual letters. The problem is that there are a few 2-character
> com
2010/9/2 swapnil :
> I could not find any documentation for variables os.path.sep and
> os.path.altsep. Although the first is pretty straightforward can
> anyone explain the purpose of the second variable? Is it even useful?
> According to issue http://bugs.python.org/issue709428, os.path.altsep
>
(BTW, are these queries equivalent, as the outputs suggest, or are
there some distinctions to be aware of?)
Anyway, I can't really believe, this would be the expected way ...
(I only marginally looked into sqlalchemy, which might simplify this a
bit, is this true? - Currently I only use the standard lib, depending
on the available server setup (python 2.6)).
Thanks in advance for any suggestions or pointers on both the sql
usage as well as the general datatype question.
regards,
Vlastimil Brom
--
http://mail.python.org/mailman/listinfo/python-list
2010/9/17 MRAB :
> On 16/09/2010 23:11, Vlastimil Brom wrote:
>>
>>...
>> I put together some code, which works as expected, but I suspect
>> somehow, that there must be better ways of doing it.
>>
>> Two things I am not quite clear about are using the place
2010/9/17 MRAB :
> On 17/09/2010 00:56, Vlastimil Brom wrote:
>>
>> 2010/9/17 MRAB:
>>>
>>> On 16/09/2010 23:11, Vlastimil Brom wrote:
>>>>
>>>> ...
>>>> I put together some code, which works as expected, but I suspect
>>&
2010/9/18 Dennis Lee Bieber :
> On Fri, 17 Sep 2010 10:44:43 +0200, Vlastimil Brom
> declaimed the following in
> gmane.comp.python.general:
>
>
>> Ok, thanks for confirming my suspicion :-),
>> Now I have to decide whether I shall use my custom data structure,
>>
2010/9/18 Dennis Lee Bieber :
> On Sat, 18 Sep 2010 10:48:44 +0200, Vlastimil Brom
> declaimed the following in
> gmane.comp.python.general:
>
>>
>> http://mail.python.org/pipermail/python-list/2008-May/540773.html
>>
> Ah, based on that listing you ar
2010/9/19 Dennis Lee Bieber :
> On Sat, 18 Sep 2010 23:00:25 +0200, Vlastimil Brom
> declaimed the following in
> gmane.comp.python.general:
>
>> Thank you very much for detailed hints, I see, I should have mention
>> the specification with my initial post...
>> I
2010/9/25 AON LAZIO :
> Hi,
> Say I have
> p = re.compile('a|b')
> text = 'a'
> d = p.findall(text)
> #d -> ['a']
> What is the way to find out which pattern p match (the former or latter)?
> I mean without knowing the outcome of p.findall
> Thanks
>
> --
> Aonlazio
> '
2010/10/7 :
> Python 2.7 (32-bit/Windows): Is there a way to use webbrowser.open() to open
> a web page in the default browser, but in the background, so that the
> application making the webbrowser.open() call remains the active
> application?
>
> Thank you,
> Malcolm
> --
> http://mail.python.or
2010/10/17 Steven D'Aprano :
> I am pleased to announce the first public release of stats for Python.
>
> http://pypi.python.org/pypi/stats
>
> stats is a pure-Python module providing basic statistics functions
> similar to those found on scientific calculators. It currently includes:
>
> Univariat
2010/10/22 Joe Shoulak :
> I'm trying to make a sports simulation program and so far everything has
> worked until I try entering:
>
> Score1 = (Team1Off + Team2Def)/2
>
> I get the error:
>
> TypeError: unsupported operand type(s) for /: 'str' and 'int'
>
> Can someone please explain to me what th
2010/11/2 Yingjie Lan :
>> From: John Bond
>> Subject: Re: Why this result with the re module
> ...
> I suggested findall return a tuple of re.MatchObject(s),
> with each MatchObject instance representing a match.
> This is consistent with the re.match() function anyway.
> And it will eliminate th
2010/11/4 Jo Chan :
> Hello all,
> I have working on a program which need a ordered dictionary that could
> perform iteritems() sequentially.
> I found a package on
> : http://www.voidspace.org.uk/python/odict.html#creating-an-ordered-dictionary
> but it could only perform items() i
2010/11/5 Matty Sarro :
> Hey Everyone,
> Just curious - I'm working on a program which includes a calculation of a
> circle, and I found myself trying to use pi*radius^2, and getting errors
> that data types float and int are unsupported for "^". Now, I realized I was
> making the mistake of using
2010/11/6 Dax Bloom :
> Hello,
>
> In the framework of a project on evolutionary linguistics I wish to
> have a program to process words and simulate the effect of sound
> shift, for instance following the Rask's-Grimm's rule. I look to have
> python take a dictionary file or a string input and rep
Traceback (most recent call last):
File "", line 1, in
ValueError: no such name
>>> unicodedata.category(u"\U0002A700")
'Lo'
>>>
Could please anybody confirm, whether this way of updating the
unicodedata for 2.7 is generaly viable or point out possible problem
this may lead to?
Many thanks in advance,
Vlastimil Brom
--
http://mail.python.org/mailman/listinfo/python-list
ython-list
>
Thanks for the confirmation Martin!
Do you think, it the mentioned omission of the character names of some
CJK ranges in unicodedata intended, or should it be reported to the
tracker?
Regards,
Vlastimil Brom
--
http://mail.python.org/mailman/listinfo/python-list
2010/11/14 Zeynel :
> It's about a week now I've been trying to convert a datetime object to
> seconds since epoch; the object is set to current time by class Rep()
> in Google App Engine:
>
> class Rep(db.Model):
> ...
> mCOUNT = db.IntegerProperty()
> mDATE0 = db.DateTimeProperty(auto_no
2017-03-12 13:14 GMT+01:00 Chris Green :
...
>
> This question relates to how one communicates between windows/GUIs.
>
> When the program starts theres a main GUI, class name abookgui. If
> you want to add new entries or modify existing entries an edit GUI is
> started in a separate window, class
2017-03-12 17:22 GMT+01:00 :
> Hi All,
>
> I have a string which looks like
>
> a,b,c "4873898374", d, ee "3343,23,23,5,,5,45", f
> "5546,3434,345,34,34,5,34,543,7"
>
> It is comma saperated string, but some of the fields have a double quoted
> string as part of it (and t
201 - 260 of 260 matches
Mail list logo