wormwood_3 wrote:
You can use d.__getitem__ as the key function for a sort of the keys.
__getitem__() is the special method that is called for indexing a
dictionary (or a list).
Just curious: Is there a reason to use __getitem__() over itemgetter (used in
the example in my reply)?
wormwood_3 [EMAIL PROTECTED] wrote
def lookup(self):
...
for potdomain in self.potdomains:
try:
who.whois(potdomain)
self.availdomains.append(potdomain)
except 'NoSuchDomain':
pass
This may, however, be
On 8/7/07, Mike Hansen [EMAIL PROTECTED] wrote:
Is anyone aware of any large scale web apps developed in Python?
Please let
me know of any that you know of...
I think that reddit.com switched from LISP to Python a while back.
Mike
___
Thats a great solution, thanks! I've googled a bit for manipulation of
sets into other data structure(lists, arrays) and not seen much. Is the
only way of interconversion a brute force method?
i.e a = set([1, 2, 3])
b = []
for thing in a:
b.append(thing)
Andy
wormwood_3 wrote:
You can use d.__getitem__ as the key function for a sort of the keys.
__getitem__() is the special method that is called for indexing a
dictionary (or a list).
Just curious: Is there a reason to use __getitem__() over itemgetter
(used in the example in my reply)?
The
Tiger12506 wrote:
Just curious: Is there a reason to use __getitem__() over itemgetter (used
in the example in my reply)?
__getitem__ is a method builtin to a dict object. itemgetter 1) has to be
imported 2) is more generically used, therefore probably using a more
generic/slower
Andy Cheesman wrote:
I've googled a bit for manipulation of
sets into other data structure(lists, arrays) and not seen much. Is the
only way of interconversion a brute force method?
i.e a = set([1, 2, 3])
b = []
for thing in a:
b.append(thing)
No, a set is a
sorry all, i did mean greatest to least, thanks for all the help here
shawn
On 8/8/07, Kent Johnson [EMAIL PROTECTED] wrote:
Tiger12506 wrote:
Just curious: Is there a reason to use __getitem__() over itemgetter
(used
in the example in my reply)?
__getitem__ is a method builtin to a
Dear All,
I made a small script to emulate a jetdirect device and capture the data
sent
from SAP to three separate barcode printers.
I need it to make backup for the SAP printing, as I can place the captured
files onto a local server and place a small batch file beside them,
that can be used
Hi,
I'm in the process of cleaning some html files with BeautifulSoup and
I want to remove all traces of the tables. Here is the bit of the code
that deals with tables:
def remove(soup, tagname):
for tag in soup.findAll(tagname):
contents = tag.contents
parent = tag.parent
Andy Cheesman [EMAIL PROTECTED] wrote
only way of interconversion a brute force method?
i.e a = set([1, 2, 3])
b = []
for thing in a:
b.append(thing)
Which looks a lot like a list comprehension:
b = [member for member in Set([1,2,3])]
HTH,
--
Alan Gauld
Author of the Learn to Program
--
Diego Lindoso.
Fone: 3466-2387
Cel : 9634-5993
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Kent Johnson [EMAIL PROTECTED] wrote
No, a set is a sequence, you can convert it to a list directly:
b = list(a)
But this is better than an LC obviously! :-)
Alan G
___
Tutor maillist - Tutor@python.org
Diego Lindoso wrote:
--
Diego Lindoso.
Fone: 3466-2387
Cel : 9634-5993
Beeep! Beep beep boop boop beep
cs shhk shhk csh
[connection timeout]
-Luke
___
Tutor maillist - Tutor@python.org
I have written a script which checks all of my servers at predetermined
intervals.
code:
try:
page = urllib2.urlopen(url)
soup= page.read()
reex = re.compile(regex)
test = re.findall(reex,soup)
except
Bob Larsen wrote:
I have written a script which checks all of my servers at predetermined
intervals.
code:
try:
page = urllib2.urlopen(url)
soup= page.read()
reex = re.compile(regex)
test =
Bob Larsen [EMAIL PROTECTED] wrote
It won't help with your problem but...
try:
page = urllib2.urlopen(url)
soup= page.read()
reex = re.compile(regex)
test = re.findall(reex,soup)
You could change this to
Alan Gauld wrote:
There is a python Bug:
http://sourceforge.net/tracker/index.php?func=detailaid=1486335group_id=5470atid=105470
http://sourceforge.net/tracker/index.php?func=detailaid=1486335group_id=5470atid=105470
that states this is caused by a missing EOF, and is not a big deal
Any
I have five data files, that are used to build a database.
1.txt
2.txt
3.txt
4.text
5.txt
I want to build a database using a persistent dictionary (shelve).
The specifications are that the key for each dictionary keyword pair, is the
lefthand side
value of the # sign, and the corresponding
On Wed, 8 Aug 2007, TheSarge wrote:
I have five data files, that are used to build a database.
1.txt
2.txt
3.txt
4.text
5.txt
I want to build a database using a persistent dictionary (shelve).
The specifications are that the key for each dictionary keyword pair, is the
lefthand
Bookpool is having a sale on all books from Addison-Wesley and Prentice
Hall. In my opinion these are two of the best publishers for top-notch
computer titles.
A few Python books on sale:
Core Python Programming $27.25
http://www.bookpool.com/sm/0132269937
Rapid Web Applications with
21 matches
Mail list logo