Re: for -- else: what was the motivation?

2022-10-22 Thread Drew Pierson
the fuck? On Sat, Oct 22, 2022 at 9:06 AM Peter J. Holzer wrote: > On 2022-10-19 12:10:52 +1100, Chris Angelico wrote: > > On Wed, 19 Oct 2022 at 12:01, Peter J. Holzer wrote: > > > On 2022-10-17 09:25:00 +0200, Karsten Hilbert wrote: > > > > http://literateprogramming.com/ > > > > > > Right.

[issue41828] No longer able to override DATA_UPLOAD_MAX_MEMORY_SIZE outside of settings.py

2020-09-22 Thread Drew Scholz
Drew Scholz added the comment: I think you are right. I'll move this to the Django bug tracker. Thank you. -- ___ Python tracker <https://bugs.python.org/issue41

[issue41828] No longer able to override DATA_UPLOAD_MAX_MEMORY_SIZE outside of settings.py

2020-09-21 Thread Drew Scholz
New submission from Drew Scholz : After upgrading our Django 1.11 project from Python 2.7 to 3.7, our single endpoint decorator to override django conf settings no longer works. requests.py inside the virtual environment /lib/python3.7/site-packages/django/http triggers the RequestDataTooBig

[issue39346] gzip module only supports half of possible read/write scenarios

2020-01-15 Thread Drew DeVault
New submission from Drew DeVault : A gzip file can have uncompressed data written to it, writing compressed data to the underlying file. It can also have uncompressed data read from it, reading compressed data from the underlying file. However, it does not support reading compressed data

[issue39346] gzip module only supports half of possible read/write scenarios

2020-01-15 Thread Drew DeVault
Change by Drew DeVault : -- type: -> enhancement ___ Python tracker <https://bugs.python.org/issue39346> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue39119] email/_header_value_parser.py:parse_message_id: UnblondLocalError

2019-12-30 Thread Drew DeVault
Drew DeVault added the comment: Sorry for the delay, was travelling for the holidays. I'll check that this is not an issue with 3.8.1. Thanks! -- ___ Python tracker <https://bugs.python.org/issue39

[issue39119] email/_header_value_parser.py:parse_message_id: UnblondLocalError

2019-12-22 Thread Drew DeVault
New submission from Drew DeVault : File "/usr/lib/python3.8/site-packages/emailthreads/threads.py", line 14, in get_message_by_id if msg["message-id"] == msg_id: File "/usr/lib/python3.8/email/message.py", line 391, in __getitem__ return self.get(na

[issue36636] Inner exception is not being raised using asyncio.gather

2019-04-15 Thread Drew Budwin
New submission from Drew Budwin : Using Python 3.7, I am trying to catch an exception and re-raise it by following an example I found on StackOverflow (https://stackoverflow.com/a/6246394/1595510). While the example does work, it doesn't seem to work for all situations. Below I have two

Re: Installing ssdeep on Portable Python

2016-03-08 Thread morr . drew
Were you able to solve this problem? I am also seeing this On Thursday, March 20, 2014 at 2:22:19 PM UTC-4, lagu...@mail.com wrote: > Portable Python 2.7 for Windows, the Python application have dependency on > ssdeep-2.10, which is a binary exe. > > The ssdeep (libfuzzy) installation example

[issue19868] Importing humanhash and uuid causes a segmentation fault crash

2013-12-02 Thread Drew
New submission from Drew: $ pip-3.3 install humanhash $ python3 Python 3.3.2 (v3.3.2:d047928ae3f6, May 13 2013, 13:52:24) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type help, copyright, credits or license for more information. import uuid import humanhash Segmentation fault: 11

python-list history

2013-11-26 Thread Drew Crawford
Hello folks, I’m interested in digging up some Python mailing list archives from ages past. Google Groups’ archive goes sporadically back to ’94, but clearly the list is older. Does any one have a lead on where I could get an archive of the very oldest posts to this list? Drew -- https

Re: How to pass class instance to a method?

2012-11-26 Thread Drew
On Sunday, November 25, 2012 7:11:29 AM UTC-5, ALeX inSide wrote: How to statically type an instance of class that I pass to a method of other instance? I suppose there shall be some kind of method decorator to treat an argument as an instance of class? Generally it is needed so

[issue15303] Minor revision to the BaseWidget._setup method in Tkinter

2012-07-09 Thread Drew French
New submission from Drew French rectangletan...@gmail.com: In the BaseWidget._setup method, master is evaluated as a Boolean (when Tkinter attempts to find a parent for the widget). I think it should really be evaluated against None, seeing as that is the default master keyword argument value

[issue15189] tkinter.messagebox does not use the application's icon

2012-07-09 Thread Drew French
Drew French rectangletan...@gmail.com added the comment: This is also true for some of the other dialogs (such as the file dialogs). Does anyone know if this behavior can be changed in Tk itself? -- nosy: +Drew.French ___ Python tracker rep

[issue12140] Crash upon start up

2011-05-24 Thread Philip Drew
Philip Drew pwtd...@gmail.com added the comment: Ok, python now works in command prompt, but IDLE still wont run. Also, PYTHONHOME needs to be reset on every start up of command prompt. -- ___ Python tracker rep...@bugs.python.org http

[issue12140] Crash upon start up

2011-05-24 Thread Philip Drew
Philip Drew pwtd...@gmail.com added the comment: Awesome. It's fixed- do you still want to know whether or not the game works. In case it helps, I installed the game before python -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue12140] Crash upon start up

2011-05-23 Thread Philip Drew
Philip Drew pwtd...@gmail.com added the comment: Reinstalling makes no difference- have tried multiple times -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12140

[issue12140] Crash upon start up

2011-05-23 Thread Philip Drew
Philip Drew pwtd...@gmail.com added the comment: Gave it a go: the prompt appears, but none of the functions work thereafter C:\Users\PWTDc:\Python27\python -S Python 2.7.1 (r271:86832, Nov 27 2010, 18:30:46) [MSC v.1500 32 bit (Intel)] on win32 print hello LookupError: no codec search

[issue12140] Crash upon start up

2011-05-23 Thread Philip Drew
Philip Drew pwtd...@gmail.com added the comment: C:\Users\PWTDset PY PYTHONHOME=c:\program files (x86)\steam\steamapps\common\alien swarm\swarm\..\sdktools\python\2.5 C:\Users\PWTDchcp Active code page: 850 C:\Users\PWTD -- ___ Python tracker rep

[issue12140] Crash upon start up

2011-05-22 Thread Philip Drew
Philip Drew pwtd...@gmail.com added the comment: The error message is: ImportError: No module named site. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12140

[issue12140] Crash upon start up

2011-05-22 Thread Philip Drew
Philip Drew pwtd...@gmail.com added the comment: The site module is in the right place This is what I got running the -v flag: (I don't know what you're looking for) Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Users\PWTDc:\Python27

[issue12140] Crash upon start up

2011-05-21 Thread Philip Drew
New submission from Philip Drew pwtd...@gmail.com: Upon execution of python.exe a command line box appears for a fraction of a second, closes and is followed by nothing. On executing IDLE from the start menu, nothing happens. I have installed python to C:\Python27 using the python windows

Re: python on iPad (PyPad)

2011-05-05 Thread Drew
to a server just to run python code. Matt. There's a Pypad on SourceForge, but it is flagged as no longer under active development. Dead or just sleeping? Is this Pypad distinct from that old one on SourceForge? Or a revival? OpenSource? Drew -- http://mail.python.org/mailman/listinfo/python

[issue5301] add mimetype for image/vnd.microsoft.icon (patch)

2009-02-17 Thread Drew Hintz
New submission from Drew Hintz d...@overt.org: Adds a mimetype entry for image/vnd.microsoft.icon This mimetype is commonly used for favicon.ico files and is registered with IANA. -- components: Library (Lib) files: mimetypes.py.diff keywords: patch messages: 82373 nosy: adhintz

Re: Need help improving number guessing game

2008-12-16 Thread r . drew . davis
such that you can tell from that which revision of the source code to look at if you are tracking down a fix for a problem they have encountered and reported to you. Drew -- http://mail.python.org/mailman/listinfo/python-list

filter func chaining

2008-11-28 Thread Drew Schaeffer
TypeError: Asset object at 0x002B is not enumerable Am I going about this totally wrong? Is there a better solution? Thanks. Drew Schaeffer -- http://mail.python.org/mailman/listinfo/python-list

Re: greatest and least of these...

2007-10-23 Thread Jason Drew
What do you mean when you say the menu doesn't kick in? Do you get an exception, or does simply nothing happen? Before the if statements, you should put print choice so you can see what value is being returned by the input function. Also maybe print type(choice) for a bit more inspection.

FastCGI on Windows: socket.fromfd() support?

2007-10-10 Thread Drew
Microsoft's IIS server recently added native support for FastCGI. The big roadblock to Python support seems to be that socket.fromfd() doesn't work on Windows. Are there any plans to add this or similar functionality to the Windows build? Thanks, Drew -- http://mail.python.org/mailman/listinfo

Re: simple regular expression problem

2007-09-17 Thread Jason Drew
You just need a one-character addition to your regex: regex = re.compile(r'organisatie.*?/organisatie', re.S) Note, there is now a question mark (?) after the .* By default, regular expressions are greedy and will grab as much text as possible when making a match. So your original expression

Re: simple regular expression problem

2007-09-17 Thread Jason Drew
, duikboot [EMAIL PROTECTED] wrote: Thank you very much, it works. I guess I didn't read it right. Arjen On Sep 17, 3:22 pm, Jason Drew [EMAIL PROTECTED] wrote: You just need a one-character addition to your regex: regex = re.compile(r'organisatie.*?/organisatie', re.S) Note, there is now

Re: Lists in classes

2007-07-12 Thread Jason Drew
Thanks for clearing up the other incorrect answers! In true Python fashion, I would also remind everyone of the *documentation* - in particular the Python tutorial. These are very elementary mistakes to be making - even worse as part of attempted answers. The Python tutorial is at

Re: Simple csv read/write

2007-04-26 Thread Drew
On Apr 24, 8:35 pm, John Machin [EMAIL PROTECTED] wrote: On 25/04/2007 8:27 AM, Drew wrote: Ok, I'm trying to do the simplest read/write from one csv file to another. For some reason, every other row on the output file is a blank row. What am I doing wrong? import csv reader

Blank rows resulting from simple csv script

2007-04-24 Thread Drew
: if row[3] == '0': writer.writerow(row) This is writing out the correct rows, however it is writing a blank row between each of the rows written out. Any ideas? Thanks, Drew -- http://mail.python.org/mailman/listinfo/python-list

Blank rows resulting from simple csv script

2007-04-24 Thread Drew
: if row[3] == '0': writer.writerow(row) This is writing out the correct rows, however it is writing a blank row between each of the rows written out. Any ideas? Thanks, Drew -- http://mail.python.org/mailman/listinfo/python-list

Simple csv read/write

2007-04-24 Thread Drew
Ok, I'm trying to do the simplest read/write from one csv file to another. For some reason, every other row on the output file is a blank row. What am I doing wrong? import csv reader = csv.reader(open('current.csv')) writer = csv.writer(open('new.csv','w')) for line in reader:

Re: Code Explaination: Spelling correction code

2007-04-12 Thread Drew
On Apr 11, 11:27 pm, Steven Bethard [EMAIL PROTECTED] wrote: Drew wrote: I recently saw this website:http://www.norvig.com/spell-correct.html All the code makes sense to me save one line: def known_edits2(word): return set(e2 for e1 in edits1(word) for e2 in edits1(e1) if e2

Re: Code Explaination: Spelling correction code

2007-04-12 Thread Drew
On Apr 12, 10:28 am, Steven Bethard [EMAIL PROTECTED] wrote: Drew wrote: On Apr 11, 11:27 pm, Steven Bethard [EMAIL PROTECTED] wrote: Drew wrote: def known_edits2(word): return set(e2 for e1 in edits1(word) for e2 in edits1(e1) if e2 in NWORDS) This is the same as: result

Code Explaination: Spelling correction code

2007-04-11 Thread Drew
I recently saw this website: http://www.norvig.com/spell-correct.html All the code makes sense to me save one line: def known_edits2(word): return set(e2 for e1 in edits1(word) for e2 in edits1(e1) if e2 in NWORDS) I understand (from seeing a ruby version of the code) that the goal here is

dict.items() vs dict.iteritems and similar questions

2007-03-14 Thread Drew
() essentially gives you an iterator across a range, so it should be used when iterating. Should you only use range() when want to physically store the range as a list? Thanks, Drew -- http://mail.python.org/mailman/listinfo/python-list

Re: dict.items() vs dict.iteritems and similar questions

2007-03-14 Thread Drew
the original container in the loop. A+ Laurent. Laurent - Extremely helpful, exactly what I was looking for. Thanks, Drew -- http://mail.python.org/mailman/listinfo/python-list

Re: dict.items() vs dict.iteritems and similar questions

2007-03-14 Thread Drew
On Mar 14, 2:53 pm, [EMAIL PROTECTED] wrote: When is it appropriate to use dict.items() vs dict.iteritems. Laurent Both work, you may prefer xrange/iteritems for iteration on Laurent large collections... I find iteranything to be extremely ugly and hope to avoid using them

Re: Converting a list to a dictionary

2007-03-14 Thread Drew
On Mar 14, 4:52 pm, Bruno Desthuilliers [EMAIL PROTECTED] wrote: res_dict = dict((r.get_id(), r) for r in res_list) I'm using Python2.5 and it seems that this only gives me a hash with the first id and first record. Am I doing something wrong? class Person(): ... def __init__(self): ...

Re: Converting a list to a dictionary

2007-03-14 Thread Drew
On Mar 14, 4:43 pm, Samuel [EMAIL PROTECTED] wrote: What this does is it maps the id to the object. In your case, you only have one id. -Samuel This is interesting behavior, but may not be what the original poster intended. If I understand correctly, this means that if more than one object

Re: Converting a list to a dictionary

2007-03-14 Thread Drew
On Mar 14, 4:52 pm, Samuel [EMAIL PROTECTED] wrote: On Mar 14, 9:48 pm, Drew [EMAIL PROTECTED] wrote: This is interesting behavior, but may not be what the original poster intended. I am the original poster :). If I understand correctly, this means that if more than one object shares

Iterating across a filtered list

2007-03-13 Thread Drew
All - I'm currently writing a toy program as I learn python that acts as a simple address book. I've run across a situation in my search function where I want to iterate across a filtered list. My code is working just fine, but I'm wondering if this is the most elegant way to do this.

Re: Iterating across a filtered list

2007-03-13 Thread Drew
are are quite helpful. Thanks, Drew -- http://mail.python.org/mailman/listinfo/python-list

List Behavior when inserting new items

2007-01-29 Thread Drew
easily? Thanks, Drew -- http://mail.python.org/mailman/listinfo/python-list

Re: List Behavior when inserting new items

2007-01-29 Thread Drew
an element, I could find the difference between the size of the list and the desired index and fill in the range between with values, however I just wanted to see if there was a more natural way in the language. Thanks, Drew -- http://mail.python.org/mailman/listinfo/python-list

Re: List Behavior when inserting new items

2007-01-29 Thread Drew
Is there any way to produce this kind of behavior easily?Hints: [None] * 5 [None, None, None, None, None] [1, 2, 3, None] + [10] [1, 2, 3, None, 10] HTH That is exactly what I was looking for. I'm actually working on some problems at http://codgolf.com. I find it helps me to learn a

Re: multiple file deletes using ftp.delete

2007-01-20 Thread Drew
On Jan 19, 11:16 pm, Drew [EMAIL PROTECTED] wrote: Hi all I'm fairly new to python so please forgive my lack of comprehension of the obvious. I'm writing a script to ftp files to a server. This script will run weekly. Part of the script first deletes the previous weeks files. The problem

multiple file deletes using ftp.delete

2007-01-19 Thread Drew
of the files that need to be deleted. All the files start with the same string but have different extensions (eg drew.1 drew.2 drew.tmp drew.hlp). So I was wondering if anybody knows how to use a wild card similar to * in UNIX to do the delete? Something like: ftp.delete(drew.*) Any help or suggestions

Zenoss Version 0.22.3 Available

2006-09-18 Thread Drew Bray
. (http://www.zenoss.org/ about/news_items/articles/nw-10towatch) Zenoss is currently hiring talented Zope Python developers. Join the team! http://www.zenoss.org/jobs. Enjoy, Drew Project Zenoss [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: How to move optparse from main to function?

2006-02-24 Thread Jason Drew
You're welcome! As usual, each of us is free to write the code whichever way works best for the particular problem at hand. That's why the module documentation often avoids advocating here-is-the-one-best-way-to-do-it. I just like sticking all the option setup stuff in a single function because

Re: How to move optparse from main to function?

2006-02-23 Thread Jason Drew
As pointed out, the module documentation is helpful. For your 'test' option, I don't think 'action=count' is the best action. 'Test' is basically an on/off option, so why count it? I would use: parser.add_option(-t, --test, action=store_true, dest=optparse_test, default=False, help=testing

Re: converting sqlite return values

2006-02-20 Thread Jason Drew
Hi, You can use the built-in function eval to return how Python evaluates your string. For example: eval( '(1,2,3,4)' ) (1, 2, 3, 4) In other words, eval will take your string that looks like a tuple, and return an actual tuple object. Note that the 'u' prefix in your string will cause an

Re: Guido at Google

2005-12-22 Thread drew . smathers
And I have around one year to wait for Ruby to get rid of the nasty syntax copied from Perl and make it look as beautiful as Python Then I'll consider switching. ;) Ummm, I'm sorry, did you say clean reflective meta-model??? So this: caller[0] =~ /in `([^']+)'/ ? $1 : '(anonymous)' vs.

Re: Sorta noob question - file vs. open?

2005-08-23 Thread Jason Drew
Both your code snippets above work should work OK. If it seems like a file isn't being written, maybe you should specify its full path so you are sure about where to check for it. On the file-or-open question, the Python docs state, The intent is for open() to continue to be preferred for use as

Re: Documentation

2005-08-10 Thread Jason Drew
The standard pydoc module is very useful. A simple example of how you could use it: import pydoc mymodule = pydoc.importfile(rC:\My Py\my_foo.py) html = pydoc.html.page(pydoc.describe(mymodule), pydoc.html.document(mymodule)) open(foo.html, w).write(html) Then you have a nice foo.html

Re: What is Python?!

2005-08-10 Thread Jason Drew
Roy Smith wrote: there's a system called Jython, which lets you compile Java source to Python byte code. Don't you have that the wrong way 'round? From the Jython website: Jython is an implementation of the high-level, dynamic, object-oriented language Python written in 100% Pure Java, and

Re: Hiding

2005-08-01 Thread Jason Drew
Ah, good point, thanks. Must stop forgetting that C:\file.txt is bad. The whole open()/file() clairification is useful too. The Python docs for the file() constructor simply state that, File objects ... can be created with the built-in constructor file() described in section 2.1, 'Built-in

Re: Hiding

2005-07-29 Thread Jason Drew
Well, using the open function in Python doesn't launch any application associated with the file (such as Media Player). It just makes the contents of the file accessible to your Python code. Also, I think using file(C:\file.txt) is now preferred to open(C:\file.txt). To answer the specific

Re: retrieve data from 2 database

2005-07-28 Thread Jason Drew
For a start, asking a better question will get better answers: http://www.catb.org/~esr/faqs/smart-questions.html Googling for python odbc gives this as the first result: http://www.python.org/windows/win32/odbc.html In general, how you compare database tables will depend a lot on the nature of

Re: tuple to string?

2005-07-22 Thread Jason Drew
''.join((chr(e) for e in (0x73, 0x70, 0x61, 0x6D))) -- http://mail.python.org/mailman/listinfo/python-list

Re: Changing size of Win2k/XP console?

2005-07-14 Thread Jason Drew
SetConsoleWindowInfo looks like a better candidate. See http://tinyurl.com/budzk (I.e. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/setconsolewindowinfo.asp) Haven't tried it though. Good luck! -- http://mail.python.org/mailman/listinfo/python-list

MySQL newsgroup proposal.

2005-06-06 Thread William Drew
ANNOUNCEMENT: A RFD (REQUEST FOR DISCUSSION) has been posted for the creation of a new Usenet newsgroup: comp.databases.mysql The proposal and related discussion can be read in the Usenet group news.groups ... feel free to weigh in and make any suggestions you may have. Message-ID:

Re: Convert from numbers to letters

2005-05-20 Thread Jason Drew
Sorry, scratch that P.S.! The act of hitting Send seems to be a great way of realising one's mistakes. Of course you need colnr - m for those times when m is set to 26. Remembered that when I wrote it, forgot it 2 paragraphs later! -- http://mail.python.org/mailman/listinfo/python-list

Re: Convert from numbers to letters

2005-05-20 Thread Jason Drew
Hey, that's good. Thanks Steve. Hadn't seen it before. One to use. Funny that Pythonwin's argument-prompter (or whatever that feature is called) doesn't seem to like it. E.g. if I have def f(tupl): print tupl Then at the Pythonwin prompt when I type f( I correctly get (tupl) in the argument

Re: Convert from numbers to letters

2005-05-19 Thread Jason Drew
We weren't really backwards; just gave a full solution to a half-stated problem. Bill, you've forgotten the least-lines-of-code requirement :-) Mine's still a one-liner (chopped up so line breaks don't break it): z = lambda cp: (int(cp[min([i for \ i in xrange(0, len(cp)) if \

Re: Convert from numbers to letters

2005-05-19 Thread Jason Drew
Oh yeah, oops, thanks. (I mean the line continuations, not the alleged sin against man and nature, an accusation which I can only assume is motivated by jealousy :-) Or fear? They threw sticks at Frankenstein's monster too. And he turned out alright. My elegant line of code started out without

Re: CGI on Windows

2005-05-16 Thread Jason Drew
I believe you're experiencing a bug that I also encountered, and for which there is a patch. See: http://sourceforge.net/tracker/?group_id=5470atid=105470func=detailaid=1110478 Fixing os.py as described in the patch fixed all my CGI-related problems. Hope it does for you too! Jason --

Re: CGI on Windows

2005-05-16 Thread Jason Drew
Rainer Mansfeld wrote: Jason Drew wrote: I believe you're experiencing a bug that I also encountered, and for which there is a patch. See: http://sourceforge.net/tracker/?group_id=5470atid=105470func=detailaid=1110478 Fixing os.py as described in the patch fixed all my CGI-related