On May 27, 4:20 pm, Steven Bethard <[EMAIL PROTECTED]> wrote:
> Steven Bethard wrote:
> > I just tried to upload new versions of the argparse module to PyPI, but
> > it seems like I can no longer upload Windows installers:
[snip]
> That seems a little weird to me. Are the bdist_wininst exe files re
I don't know of any in Python, but an open source image processing package in
Java has been developed at Stanford University - http://www.gemident.net
GemIdent . GemIdent was originally designed to segment cells from
miscroscopic images and, more generally, can identify objects of interest
and do
Paul McGuire wrote:
> I was under the impression that lower_case_with_underscores was a
> dated recommendation, and that recent practice is more inclusive of
> mixedCase style identifiers. On the contrary, Steven Bethard
> straightened me out, saying that PEP-8 used to accept either style,
> but
On May 27, 1:25 am, Steven Bethard <[EMAIL PROTECTED]> wrote:
> Stefan Sonnenberg-Carstens wrote:
> > Paul McGuire schrieb:
> >> I'm starting a new thread for this topic, so as not to hijack the one
> >> started by Steve Howell's excellent post titled "ten small Python
> >> programs".
>
> >> In tha
You might be interested in the ndimage module of scipy:
http://www.scipy.org/SciPyPackages/Ndimage
If you need a very serious image processing framework, ITK is might be very
interesting:
http://www.itk.org/
If so, have a look at the more Pythonic interface developed for it:
www.insight-journal.or
"Cameron Laird" <[EMAIL PROTECTED]> wrote:
> In article <[EMAIL PROTECTED]>,
> Dennis Lee Bieber <[EMAIL PROTECTED]> wrote:
> .
> .
> .
> >> Did you know that the first military smokeless powder
> >> round was for the French Lebel? - It threw a bronze
> >> ball, and could punch through a singl
"Cameron Laird" <[EMAIL PROTECTED]> wrote:
> .
> .
> Ha! It's interesting, especially for "computerists", to consider
> how some technologies "plateau": steam car speeds, fresco paint-
> ing, dry-stone walls, ...
>
>
>From what I remember from my reading, the Stanley Steamer
had a reputation
Hello,
I need to develop an web applications that meet the following requirements:
- 2 layers: the first one is the user interface (browser) and the second
one is the interaction with the operacional system of the server.
- the second layer must be developed using Python.
I'd like to know if
brad wrote:
> Kevin Walzer wrote:
>
>> 2. wxPython is big, harder to learn than Tkinter, but looks good on
>> Mac, Windows, and *Nix. It will require users to install a lot of
>> extra stuff (or you'll have to bundle the extra stuff).
>
> PyInstaller builds binaries beautifully from raw py sour
Paul McGuire <[EMAIL PROTECTED]> writes:
> At this point, I realized that I was taking things too far
> off-topic, so I decided to start a new thread.
So, uh, what's the purpose of this thread? Did you have a specific
point to start off with, or a question to ask?
--
\ "It seems intuitive
Hi all
I posted earlier on this but have changed my approach so here is my
latest attempt at solving a problem. I have been working on this for
around 12 hours straight and am still struggling with it.
Write a program that reads the values for a random list of cards from
a file, where each line i
I got it.
Pass python challenge chapter 7.
--
http://mail.python.org/mailman/listinfo/python-list
In <[EMAIL PROTECTED]>, mark wrote:
> Hi all
>
> I posted earlier on this but have changed my approach so here is my
> latest attempt at solving a problem. I have been working on this for
> around 12 hours straight and am still struggling with it.
>
> Write a program that reads the values for a
> No, this is not a bug. You must not call Thread.run(), use Thread.start()
> instead - else your code won't run in a different thread of execution. See
> http://docs.python.org/lib/thread-objects.htmlon how to use Thread
> objects - and note that you should *only* override __init__ and run, if
On May 27, 12:19 pm, mark <[EMAIL PROTECTED]> wrote:
> Hi all
>
> I posted earlier on this but have changed my approach so here is my
> latest attempt at solving a problem. I have been working on this for
> around 12 hours straight and am still struggling with it.
>
> Write a program that reads the
Hello -
Background:
I'm not a coder, but I got a degree in Chem Engg about 7 years ago. I
have done some
coding in my life, and I'm only beginning to pick up Python. So assume
that I'm very stupid
when and if you are kind enough to help me out.
Problem:
I need an SMS server running on my WinXP
En Sun, 27 May 2007 07:19:15 -0300, mark <[EMAIL PROTECTED]> escribió:
> I posted earlier on this but have changed my approach so here is my
> latest attempt at solving a problem. I have been working on this for
> around 12 hours straight and am still struggling with it.
Almost done. Just two thi
> Instead of extending join(), write a specific method to signal the
> quitEvent or just let the caller signal it. And I don't see in this
> example why do you need two different events (one on the thread, another
> on the service controller), a single event would suffice.
I don't think a single
On May 26, 1:43 pm, Steve Howell <[EMAIL PROTECTED]> wrote:
> --
> parentRabbits, babyRabbits = (1, 1)
> while babyRabbits < 100:
> print 'This generation has %d rabbits' %
> babyRabbits
> parentRabbits, babyRabbits = (babyRabbits,
> parentRabbits + babyRabbits)
>
>
On Sun, 2007-05-27 at 07:30 +, OKB (not okblacke) wrote:
> Underscores are harder to type than any alphanumeric character.
This is a discussion about underscores versus capital letters denoting
the word boundaries in identifiers. How is an underscore harder to type
than a capital lette
I have some working code, but I realized it is just the way I would
write it in C, which means there is probably a better (more pythonic)
way of doing it.
Here's the section of code:
accumulate = firstIsCaps = False
accumStart = i = 0
while i < len(words):
firstIsCaps = firstI
--- Ben Finney <[EMAIL PROTECTED]>
wrote:
> Paul McGuire <[EMAIL PROTECTED]> writes:
>
> > At this point, I realized that I was taking things
> too far
> > off-topic, so I decided to start a new thread.
>
> So, uh, what's the purpose of this thread? Did you
> have a specific
> point to start off
--- Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
>
> Maybe it's easier to use a key function instead of a
> compare function. A
> key function receives an element and must return
> something that is then
> sorted and the element ends up where the computed
> key is in the sorted
> list. L
Bill Jackson <[EMAIL PROTECTED]> writes:
> Alexander Schmolck wrote the following on 05/25/2007 02:33 PM:
>> I have no idea whether this will resolve your problem, but you could try
>> updating to 0.90 (BTW what happens if you do axis([0,128,0,128])).
>
> The problem appears to be with a matplotli
--- mark <[EMAIL PROTECTED]> wrote:
> Hi all
>
> I posted earlier on this but have changed my
> approach so here is my
> latest attempt at solving a problem. I have been
> working on this for
> around 12 hours straight and am still struggling
> with it.
>
> Write a program that reads the values
En Sun, 27 May 2007 10:44:01 -0300, Eric <[EMAIL PROTECTED]> escribió:
> I have some working code, but I realized it is just the way I would
> write it in C, which means there is probably a better (more pythonic)
> way of doing it.
>
> Here's the section of code:
>
> accumulate = firstIsCaps =
On Sun, 27 May 2007 06:44:01 -0700, Eric wrote:
> words is a big long array of strings. What I want to do is find
> consecutive sequences of words that have the first letter capitalized,
> and then call doSomething on them. (And you can ignore the fact that
> it won't find a sequence at the very
--- Eric <[EMAIL PROTECTED]> wrote:
> I have some working code, but I realized it is just
> the way I would
> write it in C, which means there is probably a
> better (more pythonic)
> way of doing it.
>
> Here's the section of code:
>
> accumulate = firstIsCaps = False
> accumStart = i
In <[EMAIL PROTECTED]>, Steve Howell
wrote:
>> def key_func(item):
>> return (len(item), item)
>>
>> data = ['viking', 'spam', 'parrot', 'ham', 'eric']
>> data.sort(key=key_func)
>> print data
>>
>
> Marc, when did the key feature get introduced, 2.4 or
> 2.5? I'm asking on behalf of the n
En Sun, 27 May 2007 10:20:49 -0300, Carsten Haese <[EMAIL PROTECTED]>
escribió:
> On Sun, 2007-05-27 at 07:30 +, OKB (not okblacke) wrote:
>> Underscores are harder to type than any alphanumeric character.
>
> This is a discussion about underscores versus capital letters denoting
> the
--- Gabriel Genellina <[EMAIL PROTECTED]> wrote:
>
> Underscores are not always easily available on non
> us-layout keyboards,
> like \ and @ and many other "special" characters. A
> language that requires
> more symbols than the 26 english letters has to make
> room somewhere -
> keyboard
[rohit]
>>> i want to detect all file change operations(rename,delete,create)
>>> on ALL THE DRIVES of the hard disk
>>> using the method ReadDirectoryChanges API , i.e program no. 3 in the
>>> webpagehttp://tgolden.sc.sabren.com/python/win32_how_do_i/watch_directory_fo...
>>> .
>>> Please sugg
DJ Fadereu wrote:
>
> I need an SMS server running on my WinXP PC, as soon as possible. I'm
> currently using a Nokia 6300 phone which has the S60 platform. I
> downloaded the PySMS by Dave Berkeley from
> http://www.wordhord.co.uk/pysms.html and started testing it, but I
> haven't been able to get
John Machin wrote:
> On May 27, 4:20 pm, Steven Bethard <[EMAIL PROTECTED]> wrote:
>> Steven Bethard wrote:
>>> I just tried to upload new versions of the argparse module to PyPI, but
>>> it seems like I can no longer upload Windows installers:
> [snip]
>> That seems a little weird to me. Are the b
--- BartlebyScrivener <[EMAIL PROTECTED]> wrote:
> On May 26, 1:43 pm, Steve Howell
> <[EMAIL PROTECTED]> wrote:
> > --
> > # def defines a method in Python
> > def tax(itemCharge, taxRate = 0.05):
> > return itemCharge * taxRate
> > print '%.2f' % tax(11.35)
> > p
En Sun, 27 May 2007 09:07:36 -0300, momobear <[EMAIL PROTECTED]> escribió:
>> Instead of extending join(), write a specific method to signal the
>> quitEvent or just let the caller signal it. And I don't see in this
>> example why do you need two different events (one on the thread, another
>> on
On May 26, 8:21 pm, John Machin <[EMAIL PROTECTED]> wrote:
> On May 27, 5:25 am, erikcw <[EMAIL PROTECTED]> wrote:
>
>
>
> > On May 25, 11:28 am, Carsten Haese <[EMAIL PROTECTED]> wrote:
>
> > > On Fri, 2007-05-25 at 09:51 -0500, Dave Borne wrote:
> > > > > I'm trying to run the following query:
>
En Sun, 27 May 2007 12:19:03 -0300, Steven Bethard
<[EMAIL PROTECTED]> escribió:
> Also, I couldn't get the StringIO code from there to work:
>
> >>> import StringIO
> >>> content = open('argparse-0.8.0.win32.exe').read()
Use open("...","rb").read() - the "b" is important on Windows.
--
Gab
--- BartlebyScrivener <[EMAIL PROTECTED]> wrote:
>
> For the person new to programming (doesn't come from
> C or other
> languages), I think you need to add a separate
> explanation of string
> formatting and how it works, or at least add a
> comment that tells them
> you are using string format
Hi all,
I'm a PHP5 developer looking to "broaden my horizons" so to speak by
learning a new language. I emphasize the 5 in PHP since I have fully
engrossed myself in the full OOP of version 5 with my own ground-up
projects as well as some work with PRADO (http://pradosoft.com)
I've dabbled with a
Steve Howell wrote:
> # def defines a method in Python
> def say_hello(name):
> print 'hello', name
> say_hello('Jack')
> say_hello('Jill')
>
Doesn't def define methods *xor* functions, depending on the context?
And in this example, say_hello (*yuck*, underscores ...) is
Gabriel Genellina wrote:
> En Sun, 27 May 2007 12:19:03 -0300, Steven Bethard
> <[EMAIL PROTECTED]> escribió:
>
>> Also, I couldn't get the StringIO code from there to work:
>>
>> >>> import StringIO
>> >>> content = open('argparse-0.8.0.win32.exe').read()
>
> Use open("...","rb").read() - the
quoth the romiro:
> Hi all,
...
> Anyway, my first question was if anyone knows of a tutorial that
> focuses on PHP -> Python learning, in such that there might be a block
> of PHP code alongside an example of how to do the same thing in
> Python. One example of something I've already mapped a com
En Sun, 27 May 2007 12:41:36 -0300, romiro <[EMAIL PROTECTED]> escribió:
> Anyway, my first question was if anyone knows of a tutorial that
> focuses on PHP -> Python learning, in such that there might be a block
> of PHP code alongside an example of how to do the same thing in
I don't know of a
--- romiro <[EMAIL PROTECTED]> wrote:
>
> Anyway, my first question was if anyone knows of a
> tutorial that
> focuses on PHP -> Python learning, in such that
> there might be a block
> of PHP code alongside an example of how to do the
> same thing in
> Python.
I know exactly what you mean, an
On May 27, 9:41 am, romiro <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I'm a PHP5 developer looking to "broaden my horizons" so to speak by
> learning a new language. I emphasize the 5 in PHP since I have fully
> engrossed myself in the full OOP of version 5 with my own ground-up
> projects as well as
On May 27, 3:35 am, Ben Finney <[EMAIL PROTECTED]>
wrote:
> Paul McGuire <[EMAIL PROTECTED]> writes:
> > At this point, I realized that I was taking things too far
> > off-topic, so I decided to start a new thread.
>
> So, uh, what's the purpose of this thread? Did you have a specific
> point to st
--- romiro <[EMAIL PROTECTED]> wrote:
> I've recently tried
> C#, a very short
> lived re-attempt at C++ and Java, and Ruby.
To the extend that you're familiar with C++/Java/Ruby,
you may find this link as an interesting way to see
how Python looks:
http://www.dmh2000.com/cjpr/cmpframe.html
John, thanks for your reply. I will then use the files as input to generate
an index. So the
files are temporary, and provide some attributes in the index. So I do this
multiple times
to gather different attributes, merge, etc.
"John Machin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROT
Steven Bethard wrote:
> Gabriel Genellina wrote:
>> En Sun, 27 May 2007 12:19:03 -0300, Steven Bethard
>> <[EMAIL PROTECTED]> escribió:
>>
>>> Also, I couldn't get the StringIO code from there to work:
>>>
>>> >>> import StringIO
>>> >>> content = open('argparse-0.8.0.win32.exe').read()
>>
>> Us
===
Announcing argparse 0.8
===
The argparse module is an optparse-inspired command line parser that
improves on optparse by supporting:
* positional arguments
* sub-commands
* required options
* options with a variable number of args
* better usage message
--- erikcw <[EMAIL PROTECTED]> wrote:
> >
> > > ('SELECT payment_id FROM amember_payments WHERE
> member_id=%s AND
> > > expire_date > NOW() AND completed=1 AND
> (product_id >11 AND product_id
> > > <21)', (1608L,))
> > > ()
> >
>
> Here is a copy of the table schema and the first 2
> rows.
>
--- Wildemar Wildenburger <[EMAIL PROTECTED]>
wrote:
> Steve Howell wrote:
> > # def defines a method in Python
> > def say_hello(name):
> > print 'hello', name
> > say_hello('Jack')
> > say_hello('Jill')
> >
> Doesn't def define methods *xor* functions,
> depending on
In article <[EMAIL PROTECTED]>,
Gabriel Genellina <[EMAIL PROTECTED]> wrote:
>En Sun, 27 May 2007 12:41:36 -0300, romiro <[EMAIL PROTECTED]> escribió:
>
>> Anyway, my first question was if anyone knows of a tutorial that
>> focuses on PHP -> Python learning, in such that there might be a block
>> o
Steve Howell wrote:
> --- Steven Bethard <[EMAIL PROTECTED]> wrote:
>> Very cool! Do you mind putting this up on the Wiki
>> somewhere so that we
>> can link to it more easily? Maybe something like:
>>
>> http://wiki.python.org/moin/SimplePrograms
>>
>
> Done.
I think I would rewrite the cu
Bejeezus. The description of groupby in the docs is a poster child
for why the docs need user comments. Can someone explain to me in
what sense the name 'uniquekeys' is used this example:
import itertools
mylist = ['a', 1, 'b', 2, 3, 'c']
def isString(x):
s = str(x)
if s == x:
--- 7stud <[EMAIL PROTECTED]> wrote:
> Bejeezus. The description of groupby in the docs is
> a poster child
> for why the docs need user comments. Can someone
> explain to me in
> what sense the name 'uniquekeys' is used this
> example: [...]
>
The groupby method has its uses, but it's behavi
On May 27, 11:28 am, Steve Howell <[EMAIL PROTECTED]> wrote:
> --- 7stud <[EMAIL PROTECTED]> wrote:
> > Bejeezus. The description of groupby in the docs is
> > a poster child
> > for why the docs need user comments. Can someone
> > explain to me in
> > what sense the name 'uniquekeys' is used thi
I have a set of functions to wrap a library. For example,
mylib_init()
mylib_func()
mylib_exit()
or
handle = mylib_init()
mylib_func(handle)
mylib_exit(handle)
In order to call mylib_func(), mylib_init() has to be called once.
When it's done, or when program exits, mylib_exit() should
be called
--- 7stud <[EMAIL PROTECTED]> wrote:
> Bejeezus. The description of groupby in the docs is
> a poster child
> for why the docs need user comments.
I would suggest an example with a little more
concreteness than what's currently there.
For example, this code...
import itertools
syslog_messa
The APL 2007 conference, sponsored by ACM SIGAPL,
has as its principal theme "Arrays and Objects" and,
appropriately, is co-located with OOPSLA 2007, in
Montreal this October.
APL 2007 starts with a tutorial day on Sunday, October 21, followed by a
two-day program on Monday and Tuesday, October
--- Steven Bethard <[EMAIL PROTECTED]> wrote:
> I think I would rewrite the current unit-testing
> example to use the
> standard library unittest module::
>
> # Let's write reusable code, and unit test it.
> def add_money(amounts):
> # do arithmetic in pennies so as not to
>
--- Steven Bethard <[EMAIL PROTECTED]> wrote:
>
> I think I would rewrite the current unit-testing
> example to use the
> standard library unittest module::
>
> # Let's write reusable code, and unit test it.
> def add_money(amounts):
> # do arithmetic in pennies so as not to
Stefan Sonnenberg-Carstens wrote:
> Paul McGuire schrieb:
> > I'm starting a new thread for this topic, so as not to hijack the one
> > started by Steve Howell's excellent post titled "ten small Python
> > programs".
> >
> > In that thread, there was a suggestion that these examples should
> > conf
Carsten Haese wrote:
> On Sun, 2007-05-27 at 07:30 +, OKB (not okblacke) wrote:
>> Underscores are harder to type than any alphanumeric
>> character.
>
> This is a discussion about underscores versus capital letters
> denoting the word boundaries in identifiers. How is an
--- 7stud <[EMAIL PROTECTED]> wrote:
>
> I'd settle for a simple explanation of what it does
> in python.
>
The groupby function prevents you have from having to
write awkward (and possibly broken) code like this:
group = []
lastKey = None
for item in items:
newKey = item.k
--- Steve Howell <[EMAIL PROTECTED]> wrote:
>
> --- 7stud <[EMAIL PROTECTED]> wrote:
>
> > Bejeezus. The description of groupby in the docs
> is
> > a poster child
> > for why the docs need user comments.
>
Regarding the pitfalls of groupby in general (even
assuming we had better documenta
Steve Howell wrote:
> --- Steven Bethard <[EMAIL PROTECTED]> wrote:
>> I think I would rewrite the current unit-testing
>> example to use the
>> standard library unittest module::
>>
>> # Let's write reusable code, and unit test it.
>> def add_money(amounts):
>> # do arithmetic
"OKB (not okblacke)" <[EMAIL PROTECTED]> writes:
> Underscores are harder to type than any alphanumeric character.
I know of no keyboard layout in common use where it's more complicated
than +, exactly the same as a single uppercase
letter. Care to enlighten me?
--
\"Conscien
Stefan Sonnenberg-Carstens <[EMAIL PROTECTED]> writes:
> I prefer mixedCaseStyle, and I think that should be "standard",
I dislike it. It's inconsistent, and confusingly similar to
TitleCaseStyle used for class names in Python.
> as this style is commonly used in all "major" languages , for
> ex
Steve Howell wrote:
> --- Steven Bethard <[EMAIL PROTECTED]> wrote:
>
>> I think I would rewrite the current unit-testing
>> example to use the
>> standard library unittest module::
>>
>> # Let's write reusable code, and unit test it.
>> def add_money(amounts):
>> # do arithmet
--- Steven Bethard <[EMAIL PROTECTED]> wrote:
> Steve Howell wrote:
> > --- Steven Bethard <[EMAIL PROTECTED]>
> wrote:
> >> I think I would rewrite the current unit-testing
> >> example to use the
> >> standard library unittest module::
> >>
> >> # Let's write reusable code, and unit test
Steve Howell wrote:
> --- Steven Bethard <[EMAIL PROTECTED]> wrote:
>
>> Steve Howell wrote:
>>> --- Steven Bethard <[EMAIL PROTECTED]>
>> wrote:
I think I would rewrite the current unit-testing
example to use the
standard library unittest module::
# Let's write reus
--- Steven Bethard <[EMAIL PROTECTED]> wrote:
> Have you tried py.test?
>
> http://codespeak.net/py/dist/test.html
>
> I've heard good things about it, but haven't gotten
> around to trying it
> yet. Here's a two-line test suite from the page
> above:
>
> def test_answer():
>
--- Steven Bethard <[EMAIL PROTECTED]> wrote:
> >
> > Maybe this is the first good example that
> motivates a
> > hyperlink to alternatives. Would you accept the
> idea
> > that we keep my original example on the
> SimplePrograms
> > page, but we link to a UnitTestingPhilosophies
> page,
> > and
On Sun, 2007-05-27 at 10:17 -0700, 7stud wrote:
> Bejeezus. The description of groupby in the docs is a poster child
> for why the docs need user comments. Can someone explain to me in
> what sense the name 'uniquekeys' is used this example:
>
>
> import itertools
>
> mylist = ['a', 1, 'b', 2,
Paul McGuire <[EMAIL PROTECTED]> writes:
> code about once/year. But it does mean that additions to the external
> API to the std lib will contain method calls such as get_files,
> send_message, delete_record, etc. I think this just promotes a
> perception of Python as "so last century."
I think
Steve Howell wrote:
> --- erikcw <[EMAIL PROTECTED]> wrote:
('SELECT payment_id FROM amember_payments WHERE
>> member_id=%s AND
expire_date > NOW() AND completed=1 AND
>> (product_id >11 AND product_id
<21)', (1608L,))
()
>> Here is a copy of the table schema and the first 2
>>
Steve Howell schrieb:
> --- Steve Howell <[EMAIL PROTECTED]> wrote:
>
>> --- 7stud <[EMAIL PROTECTED]> wrote:
>>
>>> Bejeezus. The description of groupby in the docs
>> is
>>> a poster child
>>> for why the docs need user comments.
>
> Regarding the pitfalls of groupby in general (even
> assum
erikcw wrote:
> On May 26, 8:21 pm, John Machin <[EMAIL PROTECTED]> wrote:
>> On May 27, 5:25 am, erikcw <[EMAIL PROTECTED]> wrote:
>>
>>
>>
>>> On May 25, 11:28 am, Carsten Haese <[EMAIL PROTECTED]> wrote:
On Fri, 2007-05-25 at 09:51 -0500, Dave Borne wrote:
>> I'm trying to run the follo
Steven Bethard <[EMAIL PROTECTED]> writes:
> I think I would rewrite the current unit-testing example to use the
> standard library unittest module::
I think these days we're supposed to like doctest better than unittest.
--
http://mail.python.org/mailman/listinfo/python-list
On May 27, 2007, at 4:01 PM, Steve Holden wrote:
> erikcw wrote:
>> On May 26, 8:21 pm, John Machin <[EMAIL PROTECTED]> wrote:
>>> On May 27, 5:25 am, erikcw <[EMAIL PROTECTED]> wrote:
>>>
>>>
>>>
On May 25, 11:28 am, Carsten Haese <[EMAIL PROTECTED]> wrote:
> On Fri, 2007-05-25 at 09:51
Ben Finney <[EMAIL PROTECTED]> wrote:
> Is C no longer a "major" language? The long-standing convention there
> is for lower_case_with_underscores.
Which dates back to the days of ASR-33's which only had one case (upper
case, as a matter of fact). Does nobody else remember C compilers which
acc
Hi,
I'm trying to turn o list of objects into a dictionary using a list
comprehension.
Something like
entries = {}
[entries[int(d.date.strftime('%m'))] = d.id] for d in links]
I keep getting errors when I try to do it. Is it possible? Do
dictionary objects have a method equivalent to [].appe
On May 27, 4:01 pm, Steve Holden <[EMAIL PROTECTED]> wrote:
> erikcw wrote:
> > On May 26, 8:21 pm, John Machin <[EMAIL PROTECTED]> wrote:
> >> On May 27, 5:25 am, erikcw <[EMAIL PROTECTED]> wrote:
>
> >>> On May 25, 11:28 am, Carsten Haese <[EMAIL PROTECTED]> wrote:
> On Fri, 2007-05-25 at 09
On May 27, 1:55 pm, erikcw <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm trying to turn o list of objects into a dictionary using a list
> comprehension.
>
> Something like
>
> entries = {}
> [entries[int(d.date.strftime('%m'))] = d.id] for d in links]
>
> I keep getting errors when I try to do it. Is
erikcw schrieb:
> Hi,
>
> I'm trying to turn o list of objects into a dictionary using a list
> comprehension.
>
> Something like
>
> entries = {}
> [entries[int(d.date.strftime('%m'))] = d.id] for d in links]
>
> I keep getting errors when I try to do it. Is it possible? Do
> dictionary objects
On 27 mai, 22:55, erikcw <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm trying to turn o list of objects into a dictionary using a list
> comprehension.
>
> Something like
>
> entries = {}
> [entries[int(d.date.strftime('%m'))] = d.id] for d in links]
>
> I keep getting errors when I try to do it. Is i
I have this code:
import xml.parsers.expat
def start_element(name, attrs):
print 'Start element:', name, attrs
def end_element(name):
print 'End element:', name
def char_data(data):
print 'Character data:', repr(data)
p = xml.parsers.expat.ParserCreate()
p.StartElementHandler = start_e
--- paul <[EMAIL PROTECTED]> wrote:
> >
> > Regarding the pitfalls of groupby in general (even
> > assuming we had better documentation), I invite
> people
> > to view the following posting that I made on
> > python-ideas, entitled "SQL-like way to manipulate
> > Python data structures":
> >
>
--- Carsten Haese <[EMAIL PROTECTED]> wrote:
> On Sun, 2007-05-27 at 10:17 -0700, 7stud wrote:
> > Bejeezus. The description of groupby in the docs
> is a poster child
> > for why the docs need user comments. Can someone
> explain to me in
> > what sense the name 'uniquekeys' is used this
> exa
Maybe you can try python binding for gammu, which works great for me.
HTH
Petr Jakes
http://cihar.com/gammu/python/
--
http://mail.python.org/mailman/listinfo/python-list
In the python documentation section 14.3.2.6 (http://docs.python.org/
lib/optparse-generating-help.html) in the last line it is written
"options that have a default value can include %default in the help
string--optparse will replace it with str() of the option's default
value. If an option has no
On May 28, 12:46 am, Steven D'Aprano
<[EMAIL PROTECTED]> wrote:
> On Sun, 27 May 2007 06:44:01 -0700, Eric wrote:
> > words is a big long array of strings. What I want to do is find
> > consecutive sequences of words that have the first letter capitalized,
> > and then call doSomething on them. (
--- John Machin <[EMAIL PROTECTED]> wrote:
(And you can
> > > ignore the fact that
> > > it won't find a sequence at the very end of
> words, that is fine for my
> > > purposes).
> > [...]
>
> Bzzzt. Needs the following code at the end:
> if accumulator:
> doSomething(accumulator)
>
FWIW th
On May 25, 6:51 am, Jia Lu <[EMAIL PROTECTED]> wrote:
> Hi all
>
> I'm trying to parsing html with re module.
>
> html = """
>
>
>
> DATA1DATA2DATA3 HT>DATA4
>
>
> DATA5DATA6DATA7DATA8
>
>
> """
>
> I want to get DATA1-8 from that string.(DATA maybe not english words.)
> Can anyone tell me h
On Sun, 27 May 2007 14:55:42 -0700, John Machin wrote:
> On May 28, 12:46 am, Steven D'Aprano
> <[EMAIL PROTECTED]> wrote:
>> On Sun, 27 May 2007 06:44:01 -0700, Eric wrote:
>> > words is a big long array of strings. What I want to do is find
>> > consecutive sequences of words that have the firs
Steve Howell wrote:
> I've always thought that the best way to introduce new
> programmers to Python is to show them small code
> examples.
You could try this wiki page:
http://rosettacode.org/wiki/Main_Page
It has a fair amount of Python examples as well as many more other
languages (doing
Shatadal wrote:
> In the python documentation section 14.3.2.6 (http://docs.python.org/
> lib/optparse-generating-help.html) in the last line it is written
>
> "options that have a default value can include %default in the help
> string--optparse will replace it with str() of the option's default
--- Steven D'Aprano wrote:
> On Sun, 27 May 2007 14:55:42 -0700, John Machin
> wrote:
> > Bzzzt.
> Bzzzt!
Can we please refrain from buzzer sounds in this
mostly civil forum, even if one beep deserves another?
__
1 - 100 of 127 matches
Mail list logo