Re: Finding IP address of localhost via socket API (or other API)

2008-08-05 Thread David York
I'm going to look into the Internet Gateway Device protocol and see what it has to offer. If it is more work than it is work I'm going with Steven's suggestion (nice code BTW). And yes, you guys understood what I was asking - I wanted the internet IP address of my machine, not the local subnet fa

Finding IP address of localhost via socket API (or other API)

2008-08-05 Thread David York
Does anybody know how to find the real IP address (e.g.: address visible to internet) of a machine via Python? In other words I have a machine with an IP address something like 192.168.1.5, an address given to me by a router. The router's address (and thus my machine's address) to the outside worl

Porting python to C++

2008-07-25 Thread David York
Hello, I'm a longtime lurker of python-list, python-C++ and a couple of others. I have a commercial project being prototyped in Python, brought to a very fine level of completion and which needs to be ported to C++. I would like to outsource this project - does anybody have any experience with Py

Re: eggs considered harmful

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

mxtextools, py2app, and intel vs. PPC

2007-06-05 Thread Ian A. York
x package from source, and from the prebuilt binary, without fixing the problem. Anyone know if my guess is right, that the mx package isn't coming in as a universal? And if so, if there's a way to force it to be universal, or some other simple fix for my problem? Thanks, Ian --

Re: Regular expression confusion

2006-09-23 Thread York
Oh, that's right, the second arg is escaped by re compiler too. Thank you, John. York John Machin wrote: > York wrote: > >>I have two backslash - a. and I want to replace them with one backslash, >>but I failed: >> >> >>>

Regular expression confusion

2006-09-23 Thread York
repl raise error, v # invalid expression sre_constants.error: bogus escape (end of line) >>> anybody knows why? Thanks, York -- http://mail.python.org/mailman/listinfo/python-list

Re: for loop question

2006-07-06 Thread York
for a in range(2, len(foo)): print a or maybe you need for a in range(1, len(foo)): print a ? York bruce wrote: > hi.. > > basic foor/loop question.. > > i can do: > > for a in foo > print a > > if i want to do something like > for a, 2, foo >

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: "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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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

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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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), ''): .

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: 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

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: Proposal: Inline Import

2005-12-10 Thread Benji York
Shane Hathaway wrote: > Benji York wrote: > >> OK, good. You won't have to worry about that. :) > > You didn't give a reason for disliking it. Oh, I don't particularly dislike it. I hadn't come up with a reason to like or dislike it, other than a pre

Re: Proposal: Inline Import

2005-12-09 Thread Benji York
Shane Hathaway wrote: > Benji York wrote: [a quicker, but still manual, way to handle adding new imports] > That's something the computer should do for me. It's busywork. > Eclipse practically eliminates this busywork when I'm writing Java > code: if I autocomplete a

Re: Proposal: Inline Import

2005-12-09 Thread Benji York
Shane Hathaway wrote: > I'd like a way to import modules at the point where I need the > functionality, rather than remember to import ahead of time. This might > eliminate a step in my coding process. Currently, my process is I > change code and later scan my changes to make matching changes

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-09 Thread Benji York
urrent class ? Could be a cool feature here :) I've been using a Vim script for a while that adds the name of current class, function, or Class.Method to the status line and it helps quite a bit. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-04 Thread Benji York
27;m only fervent about people picking a good editor (equivalent to Vim or Emacs) and learning it well. Other than that I don't care. I'm not as diplomatic about tabs. :) -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-04 Thread Benji York
cenarios where spaces cause > problems, too. Only if you don't know how decent editors behave. :) -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: Default method arguments

2005-11-15 Thread Benji York
rker: > x = self.data > print x I'll add my 2 cents to the mix: default = object() class A(object): def __init__(self, n): self.data = n def f(self, x=default): if x is default: x = self.data print x -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: debugger

2005-11-08 Thread Benji York
[EMAIL PROTECTED] wrote: > Benji York wrote: >>You might like Winpdb: >>http://www.digitalpeers.com/pythondebugger/ > > Not Found > > The requested URL /pythondebugger/-- was not found on this server. > Apache/2.0.52 (Red Hat) Server at www.digitalpeers.com Port 80

Re: debugger

2005-11-08 Thread Benji York
mclaugb wrote: > Is there a decent debugger to use with IDL? I have briefly about "PDB" but > this looks pretty limited in features and difficult to use. You might like Winpdb: http://www.digitalpeers.com/pythondebugger/ -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: which feature of python do you like most?

2005-11-08 Thread Benji York
[EMAIL PROTECTED] wrote: > I have no idea why people are so facinating with python. > So I post this question: What do you use in your dairy work with > python? I can't imagine why you're confused. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

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

2005-11-02 Thread Benji York
Please join us November 9, 7:30-9:00 PM, for the sixth meeting of the Fredericksburg, VA Zope and Python User Group ("ZPUG"). Squid and Zope! Using Zope for newspaper publishing! The dangers of object oriented inheritance! Free food! * Andrew Sawyers will discuss using the open source cache

Re: String Identity Test

2005-11-01 Thread Benji York
s the same thing for strings? Nope: >>> a = 'te' + 'st' >>> b = 'test' >>> a is b False You're seeing a coincidence of the implementation. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: Function to execute only once

2005-10-14 Thread Benji York
PyPK wrote: > now I want execute() function to get executed only once. That is the > first time it is accessed. How about just calculating the value at import time? -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: Problems with properties

2005-10-14 Thread Benji York
self._command = command @property def command(self): return self._command -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: read serial data from a barcode reader/scanner using python

2005-10-10 Thread Benji York
options see Google (then here if answers are not forthcoming). -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: Matching zero only once using RE

2005-10-07 Thread Benji York
u have found 0 matches" in pagetext: print 'yes' else: print 'no' -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: So far

2005-10-06 Thread Benji York
. It's cheap and has a demo version you can download (the demo can't save your designs, but can generate code so you can try it out). -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: New project coming up...stay with Python, or go with a dot net language??? Your thoughts please!

2005-10-04 Thread Benji York
Luis M. Gonzalez wrote: > If not Ironpython, Boo (which could be considered almost an static > version of Python for .NET) would be a great choice. You could also use Python for .Net (http://www.zope.org/Members/Brian/PythonNet). -- Benji York -- http://mail.python.org/mailman/listinfo/

Re: Finding the Process Path

2005-10-03 Thread Benji York
Peck, Jon wrote: > I have Python code running in an application, and I would like to find > the full path of the process executable where it is running. Like this? >>> import sys >>> sys.executable '/usr/bin/python' -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: Automating, Building, Testing and Deploying to Production Server

2005-10-03 Thread Benji York
t the ability to "roll back" make a new buildout and switch to it (therefore we can switch back to the previous build). We don't do it this way, but because the buildout for a particular project is itself versioned, you could just "svn up" to the previous version and

Re: How is wxWindows related to Python?

2005-10-01 Thread Benji York
27;s been renamed wxWidgets at the demand of Microsoft) is for C++. You're looking for wxPython: http://wxpython.org/ -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: list.join()... re.join()...? Do they exist? (newbie questions...)

2005-10-01 Thread Benji York
at_list) > > But it seems to me that there is probably something more pythonic than > having to go about it in such a laborious fashion Indeed. :) cat_list = '|'.join(List) -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: number of python users

2005-09-29 Thread Benji York
system Python is used by default. You can always provide your own if you wish. Zope 3 is much more like a "normal" Python library in this respect. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.4 under WinXP, free VC71 toolkit and VC6 libraries

2005-09-27 Thread Benji York
Berthold Höllmann wrote: > I'm sure ctypes doesnot work on Linux and Solaris, but my code has > to. I've used ctypes to great effect on Linux. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: [RFC] Parametric Polymorphism

2005-09-25 Thread Benji York
to the Lisp/CLOS > implementation of methods. Take a look at PJE's generic function implementation. PyCon slides here: http://www.python.org/pycon/2005/papers/53/PyCon05Talk.html. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: Accessing class variable at class creation time

2005-09-24 Thread Benji York
Jan-Ole Esleben wrote: > That doesn't really give him a way of using the class variable inside a > method. Oh! I must have misunderstood the question. I'd like to know more about why the OP wants to do this; a small example would help narrow down the possibilities. -- Ben

Re: Accessing class variable at class creation time

2005-09-23 Thread Benji York
'A'? How about this: >>> class A: ... X = 2 ... print X ... 2 -- 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: 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: 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: 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: 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: 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: very high-level IO functions?

2005-09-21 Thread York
Thank you, Tom. -York Tom Anderson wrote: > On Mon, 19 Sep 2005, Bruno Desthuilliers wrote: > >> York a écrit : >> (snip) >> >>> I love python. However, as a biologist, I like some high-levels >>> functions in R. I don't want to sp

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
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: 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: very high-level IO functions?

2005-09-19 Thread York
Your are right, a program cannot be smarter than its programmer. However I need a program to parse any table-format data files offered by user. R offer such a function, I hope python such a function too. -York > While it may "attempt" to recognize the types, it in fact can

Re: very high-level IO functions?

2005-09-19 Thread York
Caleb Hattingh wrote: > York > > Short answer: yes > Brilliant! and what are they? > We use python and R at work, and in general you will find python syntax > a little cleaner for functionality they have in common. R is better > for some of the more hard-wired stats s

very high-level IO functions?

2005-09-19 Thread York
ite a table of R data into it. Is there any python packages do similar things? -York -- http://mail.python.org/mailman/listinfo/python-list

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: Run VPython on FC3

2005-09-16 Thread York
Artur M. Piwko wrote: > In the darkest hour on Fri, 16 Sep 2005 10:44:34 -0700, > York <[EMAIL PROTECTED]> screamed: > >>It seems Python cannot open/find the file "libgtkgl.so.4", but it >>definitely lies in the lib directory: >> >>/usr/local/lib

Run VPython on FC3

2005-09-16 Thread York
t seems Python cannot open/find the file "libgtkgl.so.4", but it definitely lies in the lib directory: /usr/local/lib/libgtkgl.so.4.0.0 /usr/local/lib/libgtkgl.so.4 Does anybody know a solution for this problem? Thanks very much, 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: Grouping lists

2005-09-09 Thread Benji York
python.org/lib/itertools-functions.html -- 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: 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: 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: 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: Getting the bytes or percent uploaded/downloaded through FTP?

2005-09-05 Thread Benji York
x27;*10) sys.stderr.write('\b'*10) import urllib urllib.urlretrieve(url, destination, reporter) sys.stderr.write('\n') -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: learning python

2005-09-04 Thread Benji York
gt;>Did you even bother doing a web search? "Learn Python" or "Python >>tutorial" would be enough. > > > yeah, see i didnt even think of that. > > thanks man That was either a very gracious way to take a public correction, or an expertly executed bit

Re: defining classes

2005-09-02 Thread Benji York
st recent call last): > File "", line 1, in ? > AttributeError: foo2 instance has no attribute 'j' Works for me (Python 2.4). >>> class foo2: ... def __init__(self): ... self.j = 5 ... >>> h = foo2() >>> h.j 5 Perhaps there is some st

Re: Python / web

2005-09-02 Thread Benji York
th Zope, but I > found that it tended to own the resulting code, such that reusing it > in another framework would be a PITA. This is much less the case for Zope 3, the separation between domain and presentation code is much easier to maintain. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: OpenSource documentation problems

2005-08-30 Thread Benji York
etc). Are you referring to Zope 2 or 3 here? I ask because I consider the Zope 3 code (at least the parts written in the last couple years) to be some of the best (externally) documented code I've worked with. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: how to join two Dictionary together?

2005-08-30 Thread Benji York
See http://docs.python.org/lib/typesmapping.html for a description of the "update" method. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: variable hell

2005-08-25 Thread Benji York
odified: the effects on the corresponding symbol table are undefined. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: Unix diff command under Window.

2005-08-24 Thread Benji York
TonyHa wrote: > Does any one have using Python to write a Unix "diff" command for > Window? No, but you can get the *actual* diff command for Windows: http://unxutils.sourceforge.net/ -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: Logging all activity on a tty/pty?

2005-08-24 Thread Benji York
Dan Stromberg wrote: > Is there a way, using python, to (voluntarily) log all activity in a > given shell, in a way that should work on pretty much all *ix's with a > port of python? If it's just a simple transcript you're wanting see "man script". -- Benji

Re: Sanitizing untrusted code for eval()

2005-08-22 Thread Benji York
For example, since your doing JSON, you don't even need to allow multiplication. If you only allowed dictionaries with string keys and a restricted set of types as values, you'd be pretty close. But once you're at that point you might as well use your own parser and not use e

Re: How to get a unique id for bound methods?

2005-08-19 Thread Benji York
you'll get the best advice from this group if you tell us what the larger problem is that you're trying to solve. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: creating/modifying sparse files on linux

2005-08-18 Thread Benji York
allocate, copy, and deallocate 100 successively longer > temporary strings and is a noticeable O(n**2) operation. Not exactly. CPython 2.4 added an optimization of "+=" for strings. The for loop above takes about 1 second do execute on my machine. You are correct in that it

  1   2   >