___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Title: Signature.html
I tried that in the re test program (Perl style-re tester) provided
with Pyton 2.4 and ... Ah, I used /. It works. But I also used \.
Well, I see the culprit. I had one too many \d in: dateRe =
re.compile(r'v\d\d\d\d\d\d\d\d_\d\d\d\d\d\d\.\d\d.*')
Got it. Thanks.
Kent Jo
On Tue, Sep 23, 2008 at 8:41 PM, Joe Python <[EMAIL PROTECTED]> wrote:
> Hi Pythonistas,
>
> I have a large dictionary of dictionary (50,000+ keys) which has a structure
> as follows:
> DoD = {
> 'flintstones' : {
> 'husband' : "fred",
> 'pal' : "barney",
> '
On Tue, Sep 23, 2008 at 10:02 PM, Wayne Watson
<[EMAIL PROTECTED]> wrote:
> How do I match a dot in, for example, abc.txt? I want to match it exactly.
> There must be some sort of escape.
Assuming you want to match in a regular expression, use \ as an escape
and use raw strings.
In [40]: import r
Title: Signature.html
How do I match a dot in, for example, abc.txt? I want to match it
exactly. There must be some sort of escape.
--
Wayne Watson (Watson Adventures, Prop., Nevada City, CA)
(121.01 Deg. W, 39.26 Deg. N) GMT-8 hr std. time)
"
This might help you.
http://blog.modp.com/2008/09/sorting-python-dictionary-by-value-take.html
Robert
Joe Python wrote:
Hi Pythonistas,
I have a large dictionary of dictionary (50,000+ keys) which has a
structure as follows:
DoD = {
'flintstones' : {
'husband' : "fre
On Tue, Sep 23, 2008, Bill Campbell wrote:
>On Wed, Sep 24, 2008, John Fouhy wrote:
>>2008/9/24 Joe Python <[EMAIL PROTECTED]>:
>>> Hi Pythonistas,
>>>
>>> I have a large dictionary of dictionary (50,000+ keys) which has a structure
>>> as follows:
>>[snip]
>>> I want to sort the dictionary by 'inc
On Wed, Sep 24, 2008, John Fouhy wrote:
>2008/9/24 Joe Python <[EMAIL PROTECTED]>:
>> Hi Pythonistas,
>>
>> I have a large dictionary of dictionary (50,000+ keys) which has a structure
>> as follows:
>[snip]
>> I want to sort the dictionary by 'income'
>> Is there an efficient way to do the same.
>
2008/9/24 Joe Python <[EMAIL PROTECTED]>:
> Hi Pythonistas,
>
> I have a large dictionary of dictionary (50,000+ keys) which has a structure
> as follows:
[snip]
> I want to sort the dictionary by 'income'
> Is there an efficient way to do the same.
Note that you cannot sort a dictionary. The bes
Hi Pythonistas,
I have a large dictionary of dictionary (50,000+ keys) which has a structure
as follows:
DoD = {
'flintstones' : {
'husband' : "fred",
'pal' : "barney",
'income': 500,
},
'jetsons' : {
'husband' : "george",
'wif
jeremiah wrote:
I'm trying to do simple image manipulation but am getting an error. any
ideas what i am doing wrong here?
Thanks
JJ
#!/usr/bin/python
import ImageFilter,Image
name="test.jpg"
file=open("./"+name,"w")
Right here you're opening the file in write mode, in effect creating a
new f
On Tue, Sep 23, 2008 at 06:13:31PM -0400, Herold Kroh wrote:
> libsvn._core.SubversionException: ("Can't remove
> 'SVN_skill/db/transactions/0-1.txn': Directory not empty", 39)
>
> I go to the offending directory and I see a .nfs file. When I
> touch the file, it disappears.
The problem here is
Hi all,
New to this python thing.. I am trying to run a python script to
convert sccs data to svn data (sccs2svn.py). Downloaded this off the
web, and it sounds like it should do what I need it to, but I can not
seem to get it to run. I keep getting the following error message:
Traceback (m
On Tue, Sep 23, 2008 at 5:38 PM, jeremiah
<[EMAIL PROTECTED]> wrote:
> I'm trying to do simple image manipulation but am getting an error. any
> ideas what i am doing wrong here?
>
> file=open("./"+name,"w")
> pic=Image.open(file)
You're opening the file for "w"riting, then asking PIL to read it.
I'm trying to do simple image manipulation but am getting an error. any
ideas what i am doing wrong here?
Thanks
JJ
#!/usr/bin/python
import ImageFilter,Image
name="test.jpg"
file=open("./"+name,"w")
pic=Image.open(file)
pic.rotate(45)
pic.save("new_" + name)
pic.show()
the error:
Traceback (mo
Reed O'Brien wrote:
> On Sep 22, 2008, at 11:50 PM, Steve Willoughby wrote:
>
>> Dinesh B Vadhia wrote:
>>> Thanks Steve. How do you sort on the second element of each list to
>>> get:
>>> a' = [[42, 'fish'],
>>>[1, 'hello']
>>>[2, 'world']
>>>]
>>
>> something like this w
On Tue, Sep 23, 2008 at 11:16 AM, John Toliver <[EMAIL PROTECTED]> wrote:
> Greetings,
>
> The book I have says when you anticipate that you will be working with
> numbers larger than what python can handle, you place an "L" after the
> number to signal python to treat it as a large number.
Your b
On Tue, Sep 23, 2008 at 04:24:48PM +0100, Adam Bark wrote:
> 2008/9/23 John Toliver <[EMAIL PROTECTED]>
>
> > Greetings,
> >
> > The book I have says when you anticipate that you will be working with
> > numbers larger than what python can handle, you place an "L" after the
> > number to signal py
2008/9/23 John Toliver <[EMAIL PROTECTED]>
> Greetings,
>
> The book I have says when you anticipate that you will be working with
> numbers larger than what python can handle, you place an "L" after the
> number to signal python to treat it as a large number. Does this
> "treating" of the number
Greetings,
The book I have says when you anticipate that you will be working with
numbers larger than what python can handle, you place an "L" after the
number to signal python to treat it as a large number. Does this
"treating" of the number only mean that Python won't try to represent
the numbe
On Sep 22, 2008, at 11:50 PM, Steve Willoughby wrote:
Dinesh B Vadhia wrote:
Thanks Steve. How do you sort on the second element of each list
to get:
a' = [[42, 'fish'],
[1, 'hello']
[2, 'world']
]
something like this would do the trick:
a_prime = sorted(a, key=(lambd
21 matches
Mail list logo