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
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
odified: the effects on the
corresponding symbol table are undefined.
--
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
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
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
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
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
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
; 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
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
eresting to extend it in the
direction you're talking about.
--
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
python.org/lib/itertools-functions.html
--
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
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
rsion in
the next few days.
--
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
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
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
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
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
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
[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
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
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/
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
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
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
ests that help developers
understand the various parts of the system.
--
Benji York
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
#x27;ll be merged into the main ODBTP project sometime after the new year.
--
Benji York
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
--
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
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
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
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
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
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), ''): .
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
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
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
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
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:
>>
_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
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
certainly give you those and *so* much more.
--
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
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
diagnose. Good luck! Let us know how it turns
out, I'm curious. :)
--
Benji York
--
http://mail.python.org/mailman/listinfo/python-list
PostMessage(GetForegroundWindow(), WM_RBUTTONDOWN, MK_RBUTTON, 0);
PostMessage(GetForegroundWindow(), WM_RBUTTONUP, 0, 0);
}
--
Benji York
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
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
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
:
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
' + x
> exec(code)
Getting the value would be like this, respectively:
>>> print globals()[x]
7
>>> getattr(c, x)
8
HTH
--
Benji York
--
http://mail.python.org/mailman/listinfo/python-list
/zodb-dev).
--
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
the
OP: http://www.benjiyork.com/quick_start
--
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
/home/whoever
...and then use str.split() in my program.
--
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
e
# credentials were not valid.
return False
--
Benji York
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
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
examples or well documented
not-meant-for-documentation unit/functional/integration tests is terrific.
--
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
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
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
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
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
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
thoughts on how to make EasyDialogs work the way it
used to in OS 10.3?
Ian
--
Ian York ([EMAIL PROTECTED]) <http://www.panix.com/~iayork/>
"-but as he was a York, I am rather inclined to suppose him a
very respectable Man." -Jane Austen, The History of England
s I have no clue about.
Does anyone know what this is, and/or how to fix it?
Ian
--
Ian York ([EMAIL PROTECTED]) <http://www.panix.com/~iayork/>
"-but as he was a York, I am rather inclined to suppose him a
very respectable Man." -Jane Austen, The History of England
--
http://mail.python.org/mailman/listinfo/python-list
u need to install readline, which
isn't included in the OSX Python.
Ian
--
Ian York ([EMAIL PROTECTED]) <http://www.panix.com/~iayork/>
"-but as he was a York, I am rather inclined to suppose him a
very respectable Man." -Jane Austen, The History of England
--
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
--
Subject: LOCAL NYC - UNIGROUP 17-FEB-2005 (Thurs): ZOPE - Open Source Web
Development
Unigroup's February 2005 meeting is THIS Thursday...
=
UNIGROUP OF NEW YORK - UNIX USERS GROUP - FEBRUARY 2005 ANNOUNCE
101 - 189 of 189 matches
Mail list logo