/zodb-dev).
--
Benji York
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
e
# credentials were not valid.
return False
--
Benji York
--
http://mail.python.org/mailman/listinfo/python-list
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
/home/whoever
...and then use str.split() in my program.
--
Benji York
--
http://mail.python.org/mailman/listinfo/python-list
d M2Crypto instead:
http://wiki.osafoundation.org/bin/view/Projects/MeTooCrypto
--
Benji York
--
http://mail.python.org/mailman/listinfo/python-list
the
OP: http://www.benjiyork.com/quick_start
--
Benji York
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
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
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
examples or well documented
not-meant-for-documentation unit/functional/integration tests is terrific.
--
Benji York
--
http://mail.python.org/mailman/listinfo/python-list
diagnose. Good luck! Let us know how it turns
out, I'm curious. :)
--
Benji York
--
http://mail.python.org/mailman/listinfo/python-list
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
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
certainly give you those and *so* much more.
--
Benji York
--
http://mail.python.org/mailman/listinfo/python-list
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
_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
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:
>>
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
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
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), ''): .
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
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
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
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
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
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
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
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
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
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
[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
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
[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
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
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
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
self._command = command
@property
def command(self):
return self._command
--
Benji York
--
http://mail.python.org/mailman/listinfo/python-list
options see Google (then here if answers are not forthcoming).
--
Benji York
--
http://mail.python.org/mailman/listinfo/python-list
u have found 0 matches" in pagetext:
print 'yes'
else:
print 'no'
--
Benji York
--
http://mail.python.org/mailman/listinfo/python-list
. 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
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/
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
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
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
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
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
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
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
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
'A'?
How about this:
>>> class A:
... X = 2
... print X
...
2
--
Benji York
--
http://mail.python.org/mailman/listinfo/python-list
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
[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
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
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
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
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
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
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
rsion in
the next few days.
--
Benji York
--
http://mail.python.org/mailman/listinfo/python-list
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
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
python.org/lib/itertools-functions.html
--
Benji York
--
http://mail.python.org/mailman/listinfo/python-list
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
eresting to extend it in the
direction you're talking about.
--
Benji York
--
http://mail.python.org/mailman/listinfo/python-list
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
; 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
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
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
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
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
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
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
odified: the effects on the
corresponding symbol table are undefined.
--
Benji York
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
option, often None.
def my_func(a, b, c=None):
if c is None:
do something
If None is a valid value, make one that isn't:
unspecified = object()
def my_func(a, b, c=unspecified):
if c is unspecified:
do something
--
Benji York
--
http://mail.python.org/mail
Simon Brunning wrote:
> I think that copy is very rarely used. I don't think I've ever imported it.
>
> Or is it just me?
I rarely use copy, and almost always regret it when I do.
--
Benji York
--
http://mail.python.org/mailman/listinfo/python-list
Madhusudan Singh wrote:
> Is there such a thing for python ? Like Qt Designer for instance ?
I've had great success with wxDesigner (http://www.roebling.de/). It is
a commercial product ($129 for a single license), but it does an
exceptional job.
--
Benji York
--
http://mail.py
Evil Bastard wrote:
> I'm currently tackling the problem of implementing a python to assembler
> compiler for PIC 18Fxxx microcontrollers
Perhaps porting Pyrex would be easier. Pyrex takes a python-like syntax
(plus type information, etc.) and emits C, which is then compiled.
--
to find hosting services with Python
> installed and supported.
See http://wiki.python.org/moin/PythonHosting and remember that Google
is your friend.
--
Benji York
--
http://mail.python.org/mailman/listinfo/python-list
Tom Anderson wrote:
> I don't have python 2.4; anyone care to check how they compare there? I
> used the following timer function:
I think on 2.4 the new "key" option to list.sort would be the fastest
way to accomplish what you want.
--
Benji York
--
http://mail.python
).
After that you have to understand how the parallel port works, but I'll
assume you already do or can use the web to figure it out.
--
Benji York
--
http://mail.python.org/mailman/listinfo/python-list
uthor would like an example so he can "fix" it.
--
Benji York
--
http://mail.python.org/mailman/listinfo/python-list
You're just trying to get
some data out of it. Right now, you don't really care what
HTML is supposed to look like.
Neither does this parser.
--
Benji York
--
http://mail.python.org/mailman/listinfo/python-list
ting this up? Because I want to spend my
time programming my code, not fighting my development environment. :)
I wonder why you would want some of these things integrated into an IDE
(communication, LOC counter, etc.)
--
Benji York
--
http://mail.python.org/mailman/listinfo/python-list
tion VP of Engineering,
will discuss his .Net platform and give a brief .Net overview.
- Benji York, Zope Corp Senior Software Engineer, will discuss
current functional testing practices on Zope 3, including using
Selenium on Zope 3, using demo storage for functional testing, and
using his own comp
self.matrix = []
self.estimator = {}
self.wordInfo = {}
self.contextInfo = {}
--
Benji York
--
http://mail.python.org/mailman/listinfo/python-list
Jon Hewer wrote:
> But, if i use Vi, then whenever i want to test some code i have to
> open up python, import the necessary modules and run it - I like the
> idea of developing python in an IDE and just hitting a run button.
map :w:!python %
--
Benji York
--
http://mail.python.or
1 - 100 of 172 matches
Mail list logo