Îʸö¹ØÓÚemuleµÄÎÊÌâ
è¿æ¥æ¾ä¸ªä¸è¥¿ï¼æåå¨emule䏿¾å°äºï¼è¿åªæä¸ä¸ªæº æéçäºå天乿²¡è½®å°.ï¼æåæ¾äºä¸ªåå廿±æ¡£äº å¹³æ¥å¾å°ç¨emule æ³é®é®emuleæéå积åçå ³ç³» æ¯ä¸æ¯ç§¯åæ¯ä¸å¯¹ä¸çï¼å¹¶ä¸æ¯æèªå·±æ»çä¸ä¼ ä¸è½½éæ¥è®¡ç®çï¼ å¦æå¯¹æ¹ä¸ä»æè¿éä¸è½½ä¸è¥¿ï¼æåªè½éè¿æéæ¶é´æ¥æé«èªå·±ç积åï¼ æç»å ¶ä»äººçä¸ä¼ éæ æ³æ¹åæå¨å¯¹æ¹ç积å�? -- http://mail.python.org/mailman/listinfo/python-list
[help] how to generate a empty ".MDB" file using python
Hi all:
I working in MS window environment. Now I want to use a python
script to import some data from CSV file to MDB file.
but I have some problems about creating MDB file in DAO.
I am using attached code , but the last line seems invalid.
Does anyone could help me. Thanks!
import win32com.client
eng=win32com.client.Dispatch("DAO.DBEngine.36")
eng.CreateDatabase("d:\\temp.mdb")
Regards
Denton
--
http://mail.python.org/mailman/listinfo/python-list
Integrating a code generator into IDLE
Code generators seem to be popular in Python. (http://www.google.com/search?q=python+code-generator) I have one that I'd like to integrate into IDLE. Ideally, I'd like to (1) have a new file type show up when I use the File/Open dialog, and (2) have a function key that lets me run my generator against the file, just like F5 lets me run my Python code; ideally, I'd like to re-purpose the F5 key to be file-type aware. I've got a simple extension written that uses the F6 key to "compile" my files, but two goals I've listed seem a bit beyond me. Does anyone have any advice/pointers? Or is one or both ideas impractical? Thanks! -- http://mail.python.org/mailman/listinfo/python-list
Re: Python and Flaming Thunder
John Salerno wrote: "Dave Parker" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On May 20, 7:05 pm, Collin <[EMAIL PROTECTED]> wrote: --- For example, consider the two statements: x = 8 x = 10 The reaction from most math teachers (and kids) was "one of those is wrong because x can't equal 2 different things at the same time". --- Aw, come on. I'm a novice programmer but even after reading the most basic of introductions to a programming language I can tell that x is being assigned one value, then another. I've long believed that '=' should be banned from programming languages. Use '==' for equality tests, and ':=' for assignments. -- http://mail.python.org/mailman/listinfo/python-list
Re: Need help porting Perl function
kj wrote: Hi. I'd like to port a Perl function that does something I don't know how to do in Python. (In fact, it may even be something that is distinctly un-Pythonic!) The original Perl function takes a reference to an array, removes from this array all the elements that satisfy a particular criterion, and returns the list consisting of the removed elements. Hence this function returns a value *and* has a major side effect, namely the target array of the original argument will be modified (this is the part I suspect may be un-Pythonic). The two solutions thus far use the .index() method, which itself runs in O(n) time. This means that the provided functions run in O(n^2) time, which can be a problem if the list is big. I'd go with this: def partition(alist, criteria): list1, list2 = [], [] for item in alist: if criteria(item): list1.append(item) else: list2.append(item) return (list1, list2) def mod(alist, criteria=lambda x: x % 2 == 0): alist[:], blist = partition(alist, criteria) return blist >>> partition(range(10), lambda x: x % 2 == 0) ([0, 2, 4, 6, 8], [1, 3, 5, 7, 9]) >>> l=range(10) >>> mod(l) [1, 3, 5, 7, 9] >>> l [0, 2, 4, 6, 8] -- http://mail.python.org/mailman/listinfo/python-list
Re: simple question on list manipulation from a newbie
Sengly wrote:
Dear all,
I am working with wordnet and I am a python newbie. I'd like to know
how can I transfer a list below
In [69]: dog
Out[69]:
[{noun: dog, domestic_dog, Canis_familiaris},
{noun: frump, dog},
{noun: dog},
{noun: cad, bounder, blackguard, dog, hound, heel},
{noun: frank, frankfurter, hotdog, hot_dog, dog, wiener, wienerwurst,
weenie},
{noun: pawl, detent, click, dog},
{noun: andiron, firedog, dog, dog-iron}]
to a list like this with python:
[dog, domestic_dog, Canis_familiaris,
frump, dog,
dog,
cad, bounder, blackguard, dog, hound, heel,
frank, frankfurter, hotdog, hot_dog, dog, wiener, wienerwurst,
weenie},
pawl, detent, click, dog},
andiron, firedog, dog, dog-iron]
I can't help you with the formatting, but here's a solution using Python
data structures:
>>> alist = [
{'noun': ('dog', 'domestic_dog', 'Canis_familiaris')},
{'noun': ('frump', 'dog')},
{'noun': ('dog',)},
{'noun': ('cad', 'bounder', 'blackguard', 'dog', 'hound', 'heel')},
{'noun': ('frank', 'frankfurter', 'hotdog', 'hot_dog', 'dog',
'wiener', 'wienerwurst', 'weenie')},
{'noun': ('pawl', 'detent', 'click', 'dog')},
{'noun': ('andiron', 'firedog', 'dog', 'dog-iron')},
]
>>> merged = {}
>>> for d in alist:
for key, value in d.iteritems():
merged.setdefault(key, []).extend(value)
>>> merged
{'noun': ['dog', 'domestic_dog', 'Canis_familiaris', 'frump', 'dog',
'dog', 'cad', 'bounder', 'blackguard', 'dog', 'hound', 'heel', 'frank',
'frankfurter', 'hotdog', 'hot_dog', 'dog', 'wiener', 'wienerwurst',
'weenie', 'pawl', 'detent', 'click', 'dog', 'andiron', 'firedog', 'dog',
'dog-iron']}
--
http://mail.python.org/mailman/listinfo/python-list
