Re: Construct raw strings?

2005-09-07 Thread Benji York
; r' in front using the os.path.join-method in my code. It's not join that's getting you, it's the non-raw string representation in path_to_scan. Use either 'd:\test_images' or 'd:\\test_images' instead. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: Construct raw strings?

2005-09-08 Thread Benji York
Peter Hansen wrote: > Benji York wrote: > >> It's not join that's getting you, it's the non-raw string >> representation in path_to_scan. Use either 'd:\test_images' or >> 'd:\\test_images' instead. > > Benji, you're confusin

Re: job scheduling framework?

2005-09-08 Thread Benji York
eresting to extend it in the direction you're talking about. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: python script under windows

2005-09-09 Thread Benji York
Jan Gregor wrote: > I run python script on another computer and want to "survive" that > script after my logout. Start at http://www.python.org/windows/win32/#NTServices. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: Grouping lists

2005-09-09 Thread Benji York
python.org/lib/itertools-functions.html -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

[Fwd: Sept 14 Fredericksburg, VA ZPUG: Packaging with zpkg, review of Python Cookbook 2nd ed]

2005-09-12 Thread Benji York
Please join us September 14, 7:30-9:00 PM, for the fourth meeting of the Fredericksburg, VA Zope and Python User Group ("ZPUG"). This meeting has three features of note. - Fred Drake, Zope Corp Senior Software Engineer, Python core developer, and Python documentation maintainer and editor will p

Re: Brute force sudoku cracker

2005-09-17 Thread Benji York
Sybren Stuvel wrote: >>def all(seq, pred=bool): > > What's this? What is bool? See http://docs.python.org/lib/built-in-funcs.html#l2h-10 -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: testing a website from python

2005-09-21 Thread Benji York
rsion in the next few days. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: distutils and decorators

2005-09-21 Thread Benji York
test the functionality of the decorator. Therefore I'd switch to 2.3 compatible syntax instead. Something like: def foo(): pass foo = cherrypy.expose("1")(foo) -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: Perl's documentation come of age

2005-09-21 Thread Benji York
sting code. I could imagine that other people might not find it that useful, but the "who uses that!?" response is hard for me to understand. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: distutils and decorators

2005-09-21 Thread Benji York
or (with args)' @expose("1") def foo(): pass print 'before direct 1' def bar(): pass baz = expose(bar) print 'before direct 2' bux = expose("1")(bar) Here's it's output (2.4.1 on Linux): % python /tmp/1.py before decorator (no

Re: send mail through webmail

2005-09-21 Thread Benji York
ge zope.testbrowser (http://svn.zope.org/Zope3/branches/testbrowser-integration/src/zope/testbrowser/ and http://benjiyork.com/zope.testbrowser-0.1.tgz). See the README.txt for general info and over_the_wire.txt for how to use it to access web sites. -- Benji York -- http://mail.python.o

Re: send mail through webmail

2005-09-21 Thread Benji York
Benji York wrote: > You can also try the almost-publicly-available package zope.testbrowser > (http://svn.zope.org/Zope3/branches/testbrowser-integration/src/zope/testbrowser/ > > and http://benjiyork.com/zope.testbrowser-0.1.tgz). I forgot to mention that it requires the ZopeInter

Re: testing a website from python

2005-09-21 Thread Benji York
Achim Domma (SyynX Solutions GmbH) wrote: > Benji York wrote: >>If there is any interest I'll try to package up a stand-alone version in >>the next few days. > > I think that would be a very usefull tool. Currently I'm using httpunit > with Jython but a python

Re: Calling python scripts from C# programs

2005-09-21 Thread Benji York
[EMAIL PROTECTED] wrote: > I want to call (execute) some python scripts from my C# program. See http://www.zope.org/Members/Brian/PythonNet. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: Linux/Python -> SQL*Server Connexion chain

2005-09-22 Thread Benji York
see an alpha version at http://benjiyork.com/software.html. I'm not using it any more, but have a more recent version that I really should package up. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: Reportlab and Barcodes

2005-02-09 Thread Benji York
Josh wrote: I need someone to explain to me how to output a Code39 barcode to a Reportlab PDF. This may not help you directly, but I've made use of it in the past: a very nice and totally free 3 of 9 TrueType font. http://www.barcodesinc.com/free-barcode-font/ -- Benji -- http://mail.python.org/

Re: Considering python - have a few questions.

2005-02-12 Thread Benji York
threads here about connecting to Access. I don't mind working hard to learn how to do it I just want to know if Python is a good choice or not! I'd definitely say so. Have fun! -- Benji York [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: naming convention for scalars, lists, dictionaries ...

2005-02-28 Thread Benji York
Jack Diederich wrote: Ditto for me, plural implies list and singular implies instance, for (contact) in contacts: # do something with contact May I ask why you place the parenthesis in the for statement? -- Benji -- http://mail.python.org/mailman/listinfo/python-list

Re: An Odd Little Script

2005-03-09 Thread Benji York
with EDI documents. If so, there have been some recent discussions (and code) here. This Google Groups search will probably help: http://groups-beta.google.com/groups?q=group:comp.lang.python+edi&start=0&scoring=d&; (http://tinyurl.com/6urby). -- Benji York Sr. Software Engineer

Re: Web framework

2005-03-14 Thread Benji York
ests that help developers understand the various parts of the system. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: Lowercasing Items in a List

2004-12-16 Thread Benji York
ass-map match-any cmap2', 'match any', 'policy-map policy1', 'class cmap1', 'policy-map policy2', 'service-policy policy1', 'class cmap2'] -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: odbc script

2004-12-19 Thread Benji York
Chris wrote: what ever is the last loop through doesn't seem to update the database? Try a conn.commit() after your loop. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: odbc for solid

2004-12-23 Thread Benji York
ounds like something you'd want to use, download my python interface (being merged into the main project soon-ish) from http://benjiyork.com/odbtp.html. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: sql server support from linux

2004-12-23 Thread Benji York
#x27;ll be merged into the main ODBTP project sometime after the new year. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: odbc script

2004-12-23 Thread Benji York
rough ADO. It presents a standard DB-API 2.0 interface. I've had good luck with it. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: String backslash characters

2004-12-23 Thread Benji York
epted? It would appear that the parser reads \377 as a single character and \378 as two (\37 and the "8" character). I'm somewhat surprised you're seeing a heart and an 8. What OS/language combination are you using? If you're using English Windows you can get a heart and a

Re: odbc script

2004-12-24 Thread Benji York
Michele Petrazzo wrote: Of course, if you want to help me to make it db-api 2 compatible, you are welcome! Unfortunately I don't have much time to volunteer, but when you embark on the road to DB API 2.0 compliance I have a fairly extensive test suite you can have. -- Benji York --

Re: Lambda going out of fashion

2004-12-24 Thread Benji York
The apply above is equivalent to >>> len('H', 'e', 'l', 'l', 'o', '!') Which gives the same error: Traceback (most recent call last): File "", line 1, in ? TypeError: len() takes exactly one argument (6 g

Re: Python Google Server

2005-04-15 Thread Benji York
nly) proxy. Here's an example: http://google.com/translate_c?langpair=en%7Cen&u=http://python.org/ -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: Still Loving Python

2005-12-13 Thread Benji York
Ivan Voras wrote: > Are there any easy GUI builders for any Python-supported toolkits? wxDesigner is a really good commercial product, it's pretty inexpensive, too. http://www.roebling.de/ -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: Which Python web framework is most like Ruby on Rails?

2005-12-19 Thread Benji York
Russell E. Owen wrote: > I disagree. Once you've picked a database (not trivial in itself, of > course), you typically only have a few options for talking to in in > Python. Perhaps it's off-topic for this thread, but I think "picking a database" is the first mistake most people make. It's a f

Fredericksburg, VA ZPUG Meeting: January 11, 7:30-9:00 PM

2006-01-06 Thread Benji York
Please join us January 11, 7:30-9:00 PM, for the seventh meeting of the Fredericksburg, VA Zope and Python User Group ("ZPUG"). Squid and Zope! Python and Zope roundtable! Free food! * Andrew Sawyers will discuss using the open source cache server Squid with Zope, including a discussion of th

Re: proposal: another file iterator

2006-01-15 Thread Benji York
n with the impending doom of lambda > in mind, so that this would work: > > for chunk in iter('', f.read, blocksize): ... > > But it's a bit late now. How about this instead (will work in 2.5): for chunk in iter(partial(f.read, blocksize), ''): .

Re: "groupby" is brilliant!

2006-06-13 Thread Benji York
Frank Millman wrote: > reader = csv.reader(open('trans.csv', 'rb')) > rows = [] > for row in reader: > rows.append(row) Why do you create a list of rows instead of just iterating over the reader directly? -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: a good programming text editor (not IDE)

2006-06-15 Thread Benji York
BartlebyScrivener wrote: > Emacs must be dying if this thread could get all the way to 20 with > nobody arguing with the vi folks. heh :) > Will the Windows vim and gvim users vouch for its stability on > Windows? It's very stable on Windows. -- Benji York -- http://mail.p

Re: How do I dynamically create functions without lambda?

2006-02-02 Thread Benji York
m -- and the situation, believe me, is > no different in programming. It's apparently no different anywhere: http://www.phule.net/mirrors/unskilled-and-unaware.html -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: What editor shall I use?

2006-02-08 Thread Benji York
Python-specific, but I highly recommend Steve Oualline's Vim book (http://www.amazon.com/gp/product/0735710015). -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: zope 3.2 and imprt errors

2006-02-17 Thread Benji York
more information. > >>>>from zope.app import container >>>>container.interfaces > > Traceback (most recent call last): > File "", line 1, in ? > AttributeError: 'module' object has no attribute 'interfaces' Try this instead: >>

Re: define loop statement?

2006-02-18 Thread Benji York
_counter(limit)-1) return get_repeat_counter(limit) while repeat(10): print 'OK' Without more work it doesn't allow nested loops though. And for the record, if you're worrying about Python's counted loop construct you need better things to worry about. -- Benji

Re: editor for Python on Linux

2006-02-19 Thread Benji York
s the wonderful Vim instead, so seriousness has been maintained. To the OP: a serious editor is a basic necessity of coding, so pick Emacs, Vim, or something equivalent. Just make sure it's customizable and you enjoy customizing it because you'll want to. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: editor for Python on Linux

2006-02-20 Thread Benji York
certainly give you those and *so* much more. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: why don't many test frameworks support file-output?

2006-02-23 Thread Benji York
kanchy kang wrote: > i browsed the following frameworks briefly: nose, OOBTest, > testosterone, py.test, Sancho ... and found out they do support > imediate screen-output only. You can redirect stdout to a file. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: time.sleep(1) sometimes runs for 200 seconds under windows

2006-02-23 Thread Benji York
tching routine. Also, the suspension time may be longer than requested by an arbitrary amount because of the scheduling of other activity in the system. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: time.sleep(1) sometimes runs for 200 seconds under windows

2006-02-23 Thread Benji York
diagnose. Good luck! Let us know how it turns out, I'm curious. :) -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: Mouseclick

2005-05-02 Thread Benji York
PostMessage(GetForegroundWindow(), WM_RBUTTONDOWN, MK_RBUTTON, 0); PostMessage(GetForegroundWindow(), WM_RBUTTONUP, 0, 0); } -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: How to learn OO of python?

2005-05-21 Thread Benji York
cs.python.org/lib/built-in-funcs.html: A class method receives the class as implicit first argument, just like an instance method receives the instance. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: a dict problem

2005-05-28 Thread Benji York
orted order. If so, here's how: >>> d = {'a': 1, 'b': 2, 'c':3} >>> d {'a': 1, 'c': 3, 'b': 2} >>> v = d.values() >>> v [1, 3, 2] >>> v.sort() >>> v [1, 2, 3] -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: Case Sensitive, Multiline Comments

2005-05-30 Thread Benji York
What I want to know is how Mangus wrote an entire message fully justified. I looked for extra spaces and other cheats but only found a couple of superfluous exclamation marks. Well done! He must be a justification wizard. I wish I could do that too. :) -- Benji York -- http://mail.python.org

Re: Case Sensitive, Multiline Comments

2005-05-30 Thread Benji York
t know if people regularly put two spaces after commas though. I know I don't. I did spot a couple of extra quotation marks, but I guess I can give him those. :) -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: how to prepend string to a string?

2005-05-30 Thread Benji York
List): > # string += '>> %s'%dirList.pop()#() > # How about string = whatever + string? Note that recommended form is to build a list of strings and then use ''.join(all_my_strings) to form the final result. After saying all that, here's

Re: How to run functions in the background?

2005-05-30 Thread Benji York
Ognjen Bezanov wrote: > Is there anywhere where I can find out about queues, for people who know > python but have not had a lot of experience with threaded programs? Cheers FOLDOC to the rescue: http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?queue -- Benji York -- http://mail.python.org/m

Re: test

2005-06-08 Thread Benji York
tly the same way (same path, same Python, same user, etc.) that you are running your tests. Your file name may not match mine, but if it points to something other than the standard library, you've found the problem. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: Abstract and concrete syntax

2005-06-10 Thread Benji York
: self.x = x self.y = y return property(fget, fset) It doesn't have the "one-liner" appeal of the lambda version, but it reads well. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: implicit variable declaration and access

2005-06-13 Thread Benji York
;my_var' >>> globals()[x] = 7 >>> my_var 7 If you want to set an attribute on a particular object (which is more likely), you can do this: >>> class C: ... pass ... >>> c = C() >>> setattr(c, x, 8) >>> c.my_var 8 > code = 'print

Re: eggs considered harmful

2007-06-25 Thread Benji York
/zodb-dev). -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: Missing interfaces in Python...

2006-04-17 Thread Benji York
system is quite good, but it's also quite different from what he's probably expecting. On the up side, it's probably much better than what he's expecting too. :) -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: Zope 3

2006-04-25 Thread Benji York
the OP: http://www.benjiyork.com/quick_start -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: Python & SSL

2006-05-02 Thread Benji York
d M2Crypto instead: http://wiki.osafoundation.org/bin/view/Projects/MeTooCrypto -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: ConfigParser and multiple option names

2006-05-02 Thread Benji York
/home/whoever ...and then use str.split() in my program. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: Progamming python without a keyboard

2006-05-05 Thread Benji York
nition on Windows and complete control of the > environment on Linux. I'm interested in what you mean here. My interpretation is that you want to/are building a system to interact with a Linux desktop from a Windows box leveraging the voice recognition built into Windows. Is this righ

Re: Active Directory Authentication

2006-05-05 Thread Benji York
e # credentials were not valid. return False -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: unittest.main-workalike that runs doctests too?

2006-05-05 Thread Benji York
et the code (via Subversion) at svn://svn.zope.org/repos/main/zope.testing/trunk and browse the code (including docs) at http://svn.zope.org/zope.testing/trunk/. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: unittest.main-workalike that runs doctests too?

2006-05-05 Thread Benji York
John J Lee wrote: > Is there a page that describes the Zope SVN layout? Not that I know of. It basically goes like this: if it's not a top-level project (like zope.testing), it's either in Zope (for Zope 2 stuff) or Zope3 (for Zope 3 stuff). -- Benji York -- http://mail.pytho

Re: Process forking on Windows - or what is MQSeries

2006-05-19 Thread Benji York
n queue (an on-disk directory perhaps) and have the triggered program return after doing that. Then you can have a separate, long-running program process the messages. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: why no block comments in Python?

2006-03-09 Thread Benji York
examples or well documented not-meant-for-documentation unit/functional/integration tests is terrific. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: Localized month names?

2006-03-13 Thread Benji York
Jarek Zgoda wrote: > How do I get a list of localized month names for current locale? The > first thing that came to my mind was an ugly hack: >>> import locale >>> locale.nl_langinfo(locale.MON_1) 'January' -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: Have you ever considered of mousing ambidextrously?

2006-03-19 Thread Benji York
x2vnc to control both with one keyboard and mouse. Unfortunately neither x2vnc or Synergy really fulfill my needs though, so I'm working on a replacement. Actually I'm writing this email instead of working on it, back to the (Vim) mines. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: Difference between 'is' and '=='

2006-03-27 Thread Benji York
mwql wrote: > It's really strange, > > if > a = 1 > b = 1 > a is b ==> True > > the same thing applies for strings Not quite: >>> 'abc' is 'abc' True >>> 'abc' is 'ab' + 'c' False -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: doctest, unittest, or if __name__='__main__'

2006-03-27 Thread Benji York
ts in a big way (and they've paid off in a big way too). Obviously we test lots of web apps and had to come up with something to allow us to do decent doctests of them. Unsurprisingly it's documented with a doctest: http://svn.zope.org/*checkout*/Zope3/trunk/src/zope/testbrowser/RE

Re: a hobbyist's dilemma

2006-03-29 Thread Benji York
John Salerno wrote: > Now that I've learned much of Python, I'm sort of stuck with what to do > with it. http://www.pythonchallenge.com/ You can (thank|curse) me later. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: Very stupid question.

2006-03-30 Thread Benji York
t. You can get a "file object" by opening a file (on disk), but it doesn't make much sense to have to open a file just to see how big it is. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

<    1   2