Re: SQL Query via python

2005-05-21 Thread Jeff Elkins
folks on this list who took the trouble to reply. I hope I can pay it forward in the future. Jeff Elkins -- http://mail.python.org/mailman/listinfo/python-list

Re: Shift-JIS to UTF-8 conversion

2005-05-23 Thread Jeff Epler
On Fri, May 20, 2005 at 12:16:15AM -0700, [EMAIL PROTECTED] wrote: > Hello, I think the answer is basically correct but shift-jis is not a > standard part of Python 2.3. Ah, I was fooled --- I tested on Python 2.3, but my packager must have included the codecs you went on to mention.

Re: Strange behaviour of floating point constants in imported modules

2005-05-23 Thread Jeff Epler
ones you describe---Python itself should never do this, but third parties code may. A web search for python LC_NUMERIC should turn up more about this topic, probably even some past threads on this mailing list/newsgroup. Jeff pgpBXVBWgbrnm.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: exit after process exit

2005-05-31 Thread Jeff Epler
You might want os.spawnv(os.P_WAIT, "a.exe", ["a.exe"]) os.system("a.exe") Jeff pgpp3Fxdo0nYA.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

xml processing

2005-06-01 Thread Jeff Elkins
ts data into an array. 2. Perform any edit operations within the array. 3. Write out a finished xml file from the array when I'm done. Is this reasonable? Better, smarter ways to accomplish this? Thanks for any advice. Jeff Elkins -- http://mail.python.org/mailman/listinfo/python-list

Re: scripting browsers from Python

2005-06-01 Thread Jeff Epler
bmitting form... * Point the webbrowser at it. In my case, the webbrowser module didn't work immediately so I just used os.system() with a hardcoded browser name for it Jeff pgpRarqrD1itP.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: xml processing

2005-06-01 Thread Jeff Elkins
On Wednesday 01 June 2005 09:51 am, Magnus Lycka wrote: > Jeff Elkins wrote: > > I've like to use python to maintain a small addressbook which lives on a > > Sharp Zaurus. This list will never grow beyond 200 or so entries. I've > > installed pyxml. > > > &g

Re: xml processing

2005-06-02 Thread Jeff Elkins
On Wednesday 01 June 2005 11:01 am, Steven Bethard wrote: > If you're not committed to pyxml, you might consider using ElementTree: > > http://effbot.org/zone/element-index.htm > > I find it *way* easier to work with. Thanks. I've installed it and am experimenting. -- http://mail.python.org/mai

Re: Unicode string in exec

2005-06-02 Thread Jeff Epler
aves "surprisingly": >>> eval(u"'\u0190'") '\xc6\x90' ... you seem to get the UTF-8 encoding of the unicode. This is related to PEP 263 (http://www.python.org/peps/pep-0263.html) but the behavior of compile(), eval() and exec don't seem to be spelled out. Jeff pgp7R8SrUm3oO.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: TkInter Listbox Widget Formatting

2005-06-02 Thread Jeff Epler
Table with Python/Tkinter, however. Jeff pgpJEp4ubX0Ge.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Easy way to detect hard drives and partitions in Linux

2005-06-02 Thread Jeff Epler
proc/partitions. Finally, if you only want to recognize FDISK.EXE-type partitions (used by many types of Linux, though that seems to be changing in Fedora Core 4), it shouldn't be hard to write a Python program to read the partition table directly from the disk. The details will be readily ava

Re: thread vs GC

2005-06-02 Thread Jeff Epler
e you only make one 'primegen' instance, using one of the various singleton patterns? There may still be something "uncollectable", but at least there will only be one. Jeff pgpguzGVLqvop.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Walking through a mysql db

2005-06-04 Thread Jeff Elkins
e? My form has 'next' and 'back' buttons, and I'd like them to step forward or back, fetching the appropriate row in the table. I've tried setting cursor.rownumber by incrementing it prior to the fetchone() w/o effect. Thanks for any pointers. Jeff Elkins

Re: Walking through a mysql db

2005-06-04 Thread Jeff Elkins
On Saturday 04 June 2005 09:24 am, Jeff Elkins wrote: > I'm writing a small wxpython app to display and update a dataset. So far, I > get the first record for display: > > try: > cursor = conn.cursor () > cursor.execute ("SELECT * FROM dataset"

Re: Walking through a mysql db

2005-06-04 Thread Jeff Elkins
Thanks for the replies! I went ahead and used the fetchall() approach and work with the array, writing changes back to the database. It's working fine. Jeff -- http://mail.python.org/mailman/listinfo/python-list

Re: method = Klass.othermethod considered PITA

2005-06-04 Thread Jeff Epler
ickle classes that do >this. In all the versions of Python I've used, classes are pickled by name. This example you wrote doesn't pose any special problem when pickling. >>> pickle.dumps(A) 'c__main__\nA\np0\n.' >>> pickle.dumps(B) 'c__ma

Re: Socket Speed

2005-06-05 Thread Jeff Epler
8MB RAM runnng at 1.5GHz. The OS is Fedora Core 2, kernel 2.6.12-rc5, Python 2.3. Jeff pgpqnaSsnl0tn.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: GUI builders considered harmful (Was: anygui, anydb, any opinions?)

2005-06-05 Thread Jeff Epler
the guarantee that you can use the powerful features of the GUI toolkit. I didn't do a survey of existing software before writing mine, but I don't know of another builder that takes this kind of approach. I wonder why not. Jeff pgpMiqACxrAvI.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: PyArg_ParseTuple and dict

2005-06-05 Thread Jeff Epler
n 2.3: $ gcc sjh.c -I/usr/include/python2.3 -L/usr/lib/python2.3/config -lpython2.3 -shared -o sjh.so and I tested it: $ python -c 'import sjh; print sjh.f(1)' None $ python -c 'import sjh; print sjh.f({})' None $ python -c 'import sjh; print sjh.f({None: None})'

Re: Socket Speed

2005-06-06 Thread Jeff Epler
The machines with the 100mbps ethernet link are slightly different---Pentium 4, 2.8GHz, Python 2.2, RedHat 9. File size: 87490278 Best of 4 runs: 7.50 MB/s reported by "wget". There was other network activity and system load at the time. Jeff pgpNVPeW3ghJL.pgp Description: PGP

Re: Hiding X windows

2005-06-11 Thread Jeff Epler
ow the directions in the ICCCM on how to iconify or withdraw a window (http://tronche.com/gui/x/icccm/sec-4.html#s-4.1.4), or you might follow the EWMH document (http://standards.freedesktop.org/wm-spec/wm-spec-1.4.html#id2507242) Jeff pgp14degfeFns.pgp Description: PGP signature -- http://ma

Re: TKinter -- '' event executing more than once?

2005-06-12 Thread Jeff Epler
sitive if you have multiple Tk() instances---each Tk() instance is called ".". Jeff pgpXtThASJKeK.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: count string replace occurances

2005-06-12 Thread Jeff Epler
On Sun, Jun 12, 2005 at 04:55:38PM -0700, Xah Lee wrote: > if i have > mytext.replace(a,b) > how to find out many many occurances has been replaced? The count isn't returned by the replace method. You'll have to count and then replace. def count_replace(a, b, c): count = a.count(b) retur

Re: Get drives and partitions list (Linux)

2005-06-12 Thread Jeff Epler
Using /proc/partitions is probably preferable because any user can read it, not just people who can be trusted with read access to drives, and because the format of /proc/partitions is probably simpler and more stable over time. That said, what you do is import commands fdisk_output = comm

Re: [Python-Dev] A bug in pyconfig.h under Linux?

2005-06-14 Thread Jeff Epler
is it should make the warnings go away. Jeff pgpClgUkWxGW5.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Strange socket problem

2005-06-15 Thread Jeff Epler
dule may work better in this respect than os.system. It seems to include support for requesting that fds be closed in the child (the close_fds parameter to subprocess.Popen) Jeff pgpnWdtB0ClNj.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Programmatic links in a TKinter TextBox

2005-06-15 Thread Jeff Epler
Based on the location where the user clicked, you can find the associated tags. Then you must loop through them to find the one that gives the "href" value. Jeff :r /tmp/link.py import Tkinter app = Tkinter.Tk() text = Tkinter.Text(app) text.pack() def click(event): #this do

Re: log in to a website

2005-06-16 Thread Jeff Epler
"), filename=remote, name="file") u = f.click("attach") urllib2.urlopen(u) A web search should turn up the homepage for these modules. Jeff pgpfIIHBz5aNO.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Calling Usergroup Organizers (and Wannabees)

2007-06-07 Thread Jeff Rush
p bring together these regions. In closing, please, for existing usergroups as well as new ones coming online, update the entry for your group on the roster of Python usergroups. http://wiki.python.org/moin/LocalUserGroups Jeff Rush Advocacy Coordinator -- http://mail.python.org/mailman/listinfo/python-list

Calling for Python Writers/Authors

2007-06-12 Thread Jeff Rush
ation of what you prefer to work on, your portfolio of work and your experience level: http://wiki.python.org/moin/PythonWriters I'm open to creative ideas on how to format the information. A link to the page has been added to the sidebar menu under "Community". Jeff Rush

Accessing attributes

2007-06-12 Thread Jeff Rollin
var.py", line 49, in Person.how_many() AttributeError: class Person has no attribute 'how_many' Where am I going wrong? Many TIA for any help. Jeff objvar.py Description: application/python -- http://mail.python.org/mailman/listinfo/python-list

Accessing attributes?

2007-06-12 Thread Jeff Rollin
.""" print 'Hi, my name is %s.' % self.name def how_many(cls): """Prints the current population.""" if Person.population == 0: print 'Nobody is alive as of now.' elif Person.po

Newsgroup query

2007-06-12 Thread Jeff Rollin
es in the newsgroup, and is there any way to configure this? TIA. Jeff -- http://mail.python.org/mailman/listinfo/python-list

Re: Accessing attributes

2007-06-12 Thread Jeff Rollin
In the last episode, on Tuesday 26 Sivan 5767 11:09, Marc Christiansen wrote: > > The indentation of __del__, say_hi and how_many is wrong. You define > them inside __init__. Move them to the same indentation level as > __init__ and all should work. Thanks very much. J

Re: Newsgroup query

2007-06-12 Thread Jeff Rollin
In the last episode, on Tuesday 26 Sivan 5767 11:21, Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, Jeff Rollin wrote: > >> Why do I not see my messages with attached files in the newsgroup, and is >> there any way to configure this? > > No,

Re: excel column autofit

2007-06-12 Thread Jeff Peck
ct() > sh.Range(sh.Cells(2,1),sh.Cells(20,1)).Select() > sh.Paste() > sh.Columns("A:A").EntireColumn.AutoFit > Looks like you just forgot to add the parenthesis after AutoFit sh.Columns("A:A").EntireColumn.AutoFit() Jeff -- http://mail.python.org/mailman/listinfo/python-list

Re: avoid script running twice

2007-06-18 Thread Jeff McNeil
but that's not so much a concern in our environment. While I have no idea how portable this is, it works great for what I'm doing on RHES 5. -Jeff On 6/18/07, Tim Williams <[EMAIL PROTECTED]> wrote: > On 18/06/07, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > > Ti

Re: avoid script running twice

2007-06-18 Thread Jeff McNeil
Note that in real life, the script exits cleanly if another copy is running... On 6/18/07, Jeff McNeil <[EMAIL PROTECTED]> wrote: > I've got a rather large log processing job here that has the same > requirement. I process and sort Apache logs from an 8-way cluster. I >

DFW Pythoneers Meeting THIS Saturday

2007-06-19 Thread Jeff Rush
For more info, check out: http://www.parrotcode.org Patrick will present to us on the 2nd Saturday of July, the 14th. Patrick is the author of PGE, the parrot/Perl6 Grammar engine and is also the Perl 6 compiler pumpking. See you there! Jeff Rush DFW Pythoneers Organizer -- http://mail.pyt

Organizing Python Representation at OSCON 2007

2007-06-27 Thread Jeff Rush
year. http://mail.python.org/mailman/listinfo/advocacy Jeff Rush Python Advocacy Coordinator -- http://mail.python.org/mailman/listinfo/python-list

Re: SMTP server w/o using Twisted framework

2007-07-05 Thread Jeff McNeil
#x27;re using a method like that... -Jeff On 7/5/07, _spitFIRE <[EMAIL PROTECTED]> wrote: > Is it possible to run a SMTP server that sends mail to recipients > using standard libraries, without using twisted framework, and also > without using any relay server? > > -- > http://

Re: SMTP server w/o using Twisted framework

2007-07-05 Thread Jeff McNeil
Inline... On 7/5/07, _spitFIRE <[EMAIL PROTECTED]> wrote: > On Jul 5, 1:34 pm, "Jeff McNeil" <[EMAIL PROTECTED]> wrote: > > If you just want to send mail, you should be able to use the standard > > smtplib module (http://docs.python.org/lib/module-smtplib.htm

Re: A Python newbie ask a simple question

2007-07-13 Thread Jeff McNeil
ense" for more information. >>> mystr = "asdf" >>> mystr[0] 'a' >>> >>> raw_input("Another one, please: ")[0] Another one, please: ASDF 'A' >>> -Jeff On 7/13/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wr

Re: subprocess (spawned by os.system) inherits open TCP/UDP/IP port

2007-07-19 Thread Jeff McNeil
me s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, 0) s.bind(('', )) pid = os.fork() if pid > 0: time.sleep(100) elif pid == 0: time.sleep(100) $ lsof | grep python | grep jeff | grep python 13048 jeff3u IPv4 212689 UDP *:88

Re: subprocess (spawned by os.system) inherits open TCP/UDP/IP port

2007-07-20 Thread Jeff McNeil
t time time.sleep(2036) Corresponding lsof output when the above code runs shows the following before killing the parent. [EMAIL PROTECTED] ~]$ /usr/sbin/lsof | grep jeff | grep UDP python18713 jeff3u IPv4 34004 UDP *:italk python18714 jeff3u IPv4

Would You Write Python Articles or Screencasts for Money?

2007-04-24 Thread Jeff Rush
e advocacy mailing list and also drop an email to Steve Holden <[EMAIL PROTECTED]>, current champion of this idea and looking for encouragement. Ideas on how to evaluate contributions, how frequently to do this and critical thresholds of cash amounts necessary to induce YOUR participation are wa

Need Help in Preparing for Study of Python by Forrester Research

2007-05-02 Thread Jeff Rush
s on analysis of the evaluation criteria at the above URL. Time is short as they'd like that feedback by May 3, so please get any responses to me as soon as possible. And be thinking who would best represent the executive view of Python in an interview. Thanks for your help, Jeff Rush Advo

A Call for Professional Trainers of Python

2007-05-14 Thread Jeff Rush
organizations. If your information is already there *and current*, no response is necessary. But if you are not mentioned, please update that wiki page so we can get an accurate accounting and perhaps send business your way. Thanks, Jeff Rush Python Advocacy Coordinator -- http://mail.python.org/mailman

Seeking Four Code Samples for Forrester Research Survey

2007-05-14 Thread Jeff Rush
d I'll get it included in the survey response. Forrester's deadline to us is by the end of this week, May 18th. Thanks, Jeff Rush Python Advocacy Coordinator -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Newbie Suggestions

2007-05-16 Thread Jeff Pang
I'm interested in konwing that for python and perl,which is easier for start? Please note: message attached As a newbie, Python has my vote for beginners. It is easy to get started with some quick and satisfying scripts but tricky to learn good OOP form. That's why I highly recommend the Progr

A Few More Forrester Survey Questions

2007-05-18 Thread Jeff Rush
I'll synthesize something out of everyone's answers. Thanks for any one-line answers you can dash off to me today. Jeff Rush Python Advocacy Coordinator -- http://mail.python.org/mailman/listinfo/python-list

Re: interesting dict bug

2007-05-19 Thread Jeff McNeil
ou will see it in the 'print params2' output, though, as I believe it relies on the string object's __repr__ function, which will include the unicode specifier. -Jeff On 5/19/07, Sick Monkey <[EMAIL PROTECTED]> wrote: > Here is a segment of some code that I have. > CODE

Tix and OS X

2007-05-26 Thread Jeff Reavis
Does python not ship with Tix for OS X? I know there was an issue with 2.5.0 and Tix on Windows, and upgrading to 2.5.1 fixed it. Unfortunately, I seem to have the same issue with OS X and 2.5.1. The error I get is: self.tk.eval('package require Tix') _tkinter.TclError: can't find package Ti

Re: Tix and OS X

2007-05-28 Thread Jeff Reavis
On May 26, 8:51 pm, Kevin Walzer <[EMAIL PROTECTED]> wrote: > Jeff Reavis wrote: > > Does python not ship with Tix for OS X? I know there was an issue with > > 2.5.0 and Tix on Windows, and upgrading to 2.5.1 fixed it. > > Unfortunately, I seem to have the same iss

Usergroups Forming: Arizona and Carolina US Regions

2007-07-23 Thread Jeff Rush
ities and a great way to enhance your programming and teaching skills. The Python Software Foundation and the experienced group organizers are ready to support you in your efforts. Jeff Rush Python Advocacy Coordinator -- http://mail.python.org/mailman/listinfo/python-list

Python Trainers, Promote Thyself!

2007-07-23 Thread Jeff Rush
like cloning yourself and having more time for promotion. It's all about leverage. Jeff Rush Python Advocacy Coordinator -- http://mail.python.org/mailman/listinfo/python-list

Re: first, second, etc line of text file

2007-07-25 Thread Jeff McNeil
I just meant it as a generalization for "really large file." =) -Jeff On 7/25/07, Jay Loden <[EMAIL PROTECTED]> wrote: Grant Edwards wrote: > On 2007-07-25, Jeff <[EMAIL PROTECTED]> wrote: > >> That might be a memory problem if you are running multiple processes >> re

Re: first, second, etc line of text file

2007-07-25 Thread Jeff McNeil
> lines[5] '# lookupd DirectoryServices \n' >>> You can also check out the fileinput module. That ought to be sightly more efficient and provides some additional functionality. I think there are some restrictions on accessing lines out of order, though. -Jeff On 7/25/

Re: is_iterable function.

2007-07-25 Thread Jeff McNeil
That's not going to hold true for generator functions or iterators that are implemented on sequences without '__iter__.' You might also want to check for __getitem__. I'm not sure if there's a way to tell if a function is a generator without actually calling it.

Re: Why PHP is so much more popular for web-development

2007-07-25 Thread Jeff McNeil
On 7/25/07, Steve Holden <[EMAIL PROTECTED]> wrote: > Jeff McNeil wrote: > > Unfortunately, I also find that PHP programmers are usually more > > plentiful than their Python counterparts. When thinking of staffing > > an organization, it's common to target a skill

Re: Why PHP is so much more popular for web-development

2007-07-25 Thread Jeff McNeil
he fact that so many of the popular, free, web applications are PHP based. It's easy for the average Web Administrator to get started with your standard PHP package. From there, picking up the language is the next logical step. -Jeff On 7/25/07, walterbyrd <[EMAIL PROTECTED]> wrote: >

Re: check if var is dict

2007-08-13 Thread Jeff McNeil
You could use 'isinstance' to determine whether or not your object is an instance of a particular class. >>> isinstance({}, dict) True >>> isinstance("", basestring) True >>> Note the use of 'basestring', which will catch unicode as well.

Re: PyCon 2008 - Call for Tutorial Ideas

2007-08-15 Thread Jeff McNeil
difficult, I'm sure others have as well. Just an idea! Jeff On 8/15/07, Greg Lindstrom <[EMAIL PROTECTED]> wrote: > It's hard to believe, but the planning for PyCon 2008 is underway. PyCon, > an annual gathering of Python enthusiasts -- nearly 600 in Dallas last year >

Re: [ANN] Python courses this Fall

2007-08-23 Thread Jeff Pang
Sounds good.How about the costs for those lessons?thanks. -- "wesley chun" <[EMAIL PROTECTED]> wrote: Folks, I'd like to announce my final Python courses for 2007: Need to get up-to-speed with Python as quickly as possible? Come join me, Wesley Chun, author of Prentice-Hall's well-received "Core

ShowMeDo.com Announces Winner of Most-Video-Plays of the Month

2007-09-03 Thread Jeff Rush
t showcasing a different web framework like TurboGears or Twisted Web? Or something about databases, either relational or object. Jeff Rush Python Advocacy Coordinator -- http://mail.python.org/mailman/listinfo/python-list

The Texas Python Unconference is Almost Here!

2007-09-03 Thread Jeff Rush
uston for hosting us. Let's roll up our sleeves and help them out! Involvement is key to making an unconference successful. For those not familiar with unconferences, check out this description: http://en.wikipedia.org/wiki/Unconference See you all there... Jeff Rush Python Advocacy Co

Re: help - error when trying to call super class method

2007-09-08 Thread Jeff McNeil
thon.org/lib/built-in-funcs.html. Lastly, super will only work with new-style classes (which yours is, due to the subclass of list). -Jeff On 9/8/07, dontknowwhy88 <[EMAIL PROTECTED]> wrote: > > > I am trying to extend list class to build a stack class -- see code > below-

Re: IOError - list of all Errno numbers and their meanings?

2007-09-11 Thread Jeff McNeil
The 'errno' number (at least on the *nix platforms I use) corresponds to the 'errno' number set on system call failure. POSIX.1 specifies a set of standard errors. AFAIK, the 'errno' module should contain the mappings for your system. On 9/11/07, Tim Couper <[EMAIL PROTECTED]> wrote: > As you k

Re: xmlrpclib and SimpleXMLRPCServer questions

2007-09-12 Thread Jeff McNeil
s.php. I'm not sure you can do that without inheriting from the dispatcher code and "rolling your own." I find it much easier to 'return True' and ignore the value. -Jeff On 9/12/07, xkenneth <[EMAIL PROTECTED]> wrote: > So i've been trying to set up a

Re: xmlrpclib and SimpleXMLRPCServer questions

2007-09-12 Thread Jeff McNeil
Duh... you can pass allow_none=True to SimpleXMLRPCServer() On 9/12/07, Jeff McNeil <[EMAIL PROTECTED]> wrote: > Have a look at the XMLRPC specification @ http://www.xmlrpc.com/spec. > There is no representation of NULL/None, thus server refuses to > Marshall the 'None&

"unknown encoding: string-escape" in frozen Python

2007-03-02 Thread Jeff Groves
27;m still getting the string-escape error. How can I include the encoding in the freeze? I'm using Python2.3 and the downloadable version of subprocess.py for Python2.3 on Redhat. -Jeff Groves -- http://mail.python.org/mailman/listinfo/python-list

Re: RSS feed creator

2007-03-04 Thread Jeff McNeil
What about this? http://www.dalkescientific.com/Python/PyRSS2Gen.html On 3/4/07, Florian Lindner <[EMAIL PROTECTED]> wrote: > Hello, > I'm looking for a python library that creates a RSS and/or Atom feed. E.g. I > give a list like that: > [ > [title1, short desc1, author1], > [title2, short

Re: Webserver balance load

2007-03-05 Thread Jeff McNeil
se systems will provide better load distribution, they will not provide H/A unless they're configured in a cluster config as a standalone load balancer is still a single point of failure. -Jeff On 3/5/07, Michael <[EMAIL PROTECTED]> wrote: Johny wrote: > Can anyone suggest a way

Re: Any module to parse httpd.conf?

2007-03-06 Thread Jeff McNeil
do? There are a lot of ways to do a lot of things with Apache. If you're looking to create virtual hosts, take a look at mod_vhost_alias or some RewriteRule magic. You're configuration could be pretty simplified and reduced to updating a gdbm file or creating a directory? Jeff On 6 M

A Pythonic Way to Measure and Improve Your Programming Skills?

2007-03-09 Thread Jeff Rush
rove him or herself, the conceptual map could have links/recommendations to training materials on specific topics. Join me on the advocacy list and let's discuss this further. You can join at: http://mail.python.org/mailman/listinfo/advocacy Jeff Rush Python Advocacy Coordinator -- http://mail.python.org/mailman/listinfo/python-list

Re: about application deployment

2007-03-09 Thread Jeff McNeil
If a .egg file is in your sys.path, it would be nice to simply use 'python -m' in my opinion. As far as I know, you can't '-m' a module that's been imported from a zip file? On 3/9/07, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: Alessandro de Manzano wrote: > Hello, > > I'ld ask you all abou

Re: How to test if a key in a dictionary exists?

2007-03-10 Thread Jeff McNeil
xampledict = {"a" : 1, "b" : 2} >>> "a" in exampledict True >>> "q" in exampledict False >>> Alternatively, "exampledict.has_key("a")" is also valid. See: http://docs.python.org/tut/node7.html#SECTION007500

Re: Server-side script takes way too long to launch

2007-03-13 Thread Jeff McNeil
t? What do log timestamps say from initial hit until last-byte from your Python script? Might want to validate your Apache configuration and have a look at httpd.apache.org. Sounds to me like DNS lookups are enabled or something of the sort. Thanks, Jeff On 3/13/07, Josh Bloom <[EMAIL

Re: Eureka moments in Python

2007-03-13 Thread Jeff McNeil
of Perl 5 and whatnot. It wasn't until I took a stab at the WS-* specifications that I realized how much easier it was in Python. Though, we've still got a few hundred thousand lines of Java laying around, I won't be happy until that's history! Thanks, Jeff On 3/13/07, St

Re: How can I catch all exception in python?

2007-03-27 Thread Jeff McNeil
You could also use sys.excepthook if you're trying to handle uncaught exceptions. On 27 Mar 2007 11:45:54 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: On Mar 27, 9:15 pm, [EMAIL PROTECTED] wrote: > Technically speaking, you can catch all errors as follows: > > try: ># do something

Re: newbi question on python rpc server, how it works?

2007-03-28 Thread Jeff McNeil
sts are sent to https://user:[EMAIL PROTECTED]/RPC2 and proxied internally back to the XMLRPC server. Twisted might be an easier option though as you'll not have to deal with all of the daemonization details. Also, check out http://www.xmlrpc.com for protocol details. Jeff On 3/28/07,

Re: SimpleXMLRPCServer and Threading

2007-03-28 Thread Jeff McNeil
class ThreadedXMLRPCServer(ThreadingMixIn, SimpleXMLRPCServer): """"My Threaded XMLRPC Server""" You'll then use "ThreadedXMLRPCServer" when you instance your server object. -Jeff On 3/28/07, Achim Domma <[EMAIL PROTECTED]> wrote: Hi, is SimpleXMLR

Re: SimpleXMLRPCServer and Threading

2007-03-28 Thread Jeff McNeil
e any multithreading. You need to use one of the *MixIn classes if you want to handle concurrent requests. -Jeff On 3/28/07, Erik Johnson <[EMAIL PROTECTED]> wrote: > > "Achim Domma" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Hi, &

Re: SimpleXMLRPCServer and Threading

2007-03-29 Thread Jeff McNeil
of your handler which is responsible for the RPC dispatching. -Jeff On 3/29/07, Laszlo Nagy <[EMAIL PROTECTED]> wrote: Jeff McNeil wrote: > This is off of memory so I apologize if I don't get all of the details right. > > The base SimpleXMLRPCServer uses TCPServer as it's serve

Re: output of top on a linux box

2007-04-09 Thread Jeff McNeil
command. Take a look at proc(5). Thanks, Jeff On 4/9/07, Pradnyesh Sawant <[EMAIL PROTECTED]> wrote: > Hello, > I need the cpu usage of a linux box, for which i capture the output of > "top" using "popen". However, i am facing problems during string > h

Re: output of top on a linux box

2007-04-09 Thread Jeff McNeil
\x1b(B\x1b[m\x1b[39;49m\x1b(B\x1b[m', '0.1%', '\x1b(B\x1b[m\x1b[39;49mni,\x1b(B\x1b[m\x1b[39;49m\x1b(B\x1b[m', ' 98.4%', '\x1b(B\x1b[m\x1b[39;49mid,\x1b(B\x1b[m\x1b[39;49m\x1b(B\x1b[m', '0.1%', '\x1b(B\x1b[m\x1b[39;49mwa,\x1b(B\x1b[m\x1b[39

Re: XML-RPC SSL and client side certs?

2007-04-10 Thread Jeff McNeil
I've settled on basic authentication, but I see no reason why you couldn't take advantage of mod_ssl. Thanks, hope that helps. Just another option, really. Jeff On 10 Apr 2007 14:43:40 -0700, Eli Criffield <[EMAIL PROTECTED]> wrote: > > Does anyone have an example set

Re: Python-list Digest, Vol 48, Issue 301

2007-09-20 Thread Jeff McNeil
;, 'b', 'c', 'd', 'e'] >>> for i,j in zip(l1, l2): ... print i,j ... 1 a 2 b 3 c 4 d 5 e >>> You can also do the same thing using itertools.izip, but it will return an iterator as opposed to building a new list. -Jeff On 9/20/07, Chr

Re: How to Catch Errors in SimpleXMLRPCServer

2007-09-27 Thread Jeff McNeil
: handle_logging() server = SimpleXMLRPCServer(("localhost", 8000)) server.register_instance(MyCalls()) server.serve_forever() There might be an easier way... but this works for me. -Jeff On 9/27/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I have a pretty simple XMLRPCServ

Re: How to Catch Errors in SimpleXMLRPCServer

2007-09-27 Thread Jeff McNeil
getattr, not self.getattr. On 9/27/07, Jeff McNeil <[EMAIL PROTECTED]> wrote: > Instead of register_function, use register_instance and provide a > _dispatch method in that instance that handles your exception logging. > > Pseudo: > > class MyCalls(object): > def _

Re: How to Catch Errors in SimpleXMLRPCServer

2007-09-27 Thread Jeff McNeil
erver = SimpleXMLRPCServer(("localhost", 8000)) server.register_instance(MyCalls()) server.serve_forever() -Jeff On 9/27 On 9/27/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On Sep 27, 3:55 pm, "Jeff McNeil" <[EMAIL PROTECTED]> wrote: > > Instead of register

Re: How to Catch Errors in SimpleXMLRPCServer

2007-09-27 Thread Jeff McNeil
Cool.. glad it works. Just be careful not to expose methods you may not want to; use decorators, attributes, or perhaps a custom method naming scheme to flag methods as exposed if you do it this way. On 9/27/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > On Sep 27, 5:08 pm,

Program inefficiency?

2007-09-29 Thread hall . jeff
I wrote the following simple program to loop through our help files and fix some errors (in case you can't see the subtle RE search that's happening, we're replacing spaces in bookmarks with _'s) the program works great except for one thing. It's significantly slower through the later files in the

Re: Program inefficiency?

2007-09-29 Thread hall . jeff
I did try moveing the re.compile's up and out of the replacecylce() but it didn't impact the time in any meaningful way (2 seconds maybe)... I'm not sure what an shell+sed script is... I'm fairly new to Python and my only other coding experience is with VBA... This was my first Python program In

Re: Program inefficiency?

2007-09-29 Thread hall . jeff
XP is the OS... the files are split across a ton of subdirectories already... I'm actually starting to think there's a problem with certain files, however... We create help files for clients using RoboHelp... RoboHelp has Source HTML and then "webhelp" html which is what actually goes to the clie

Re: Program inefficiency?

2007-09-29 Thread hall . jeff
no swaps... memory usage is about 14k (these are small Html files)... no hard drive cranking away or fan on my laptop going nutty... CPU usage isn't even pegged... that's what makes me think it's not some sort of bizarre memory leak... Unfortunately, it also means I'm out of ideas... -- http://ma

Re: Program inefficiency?

2007-09-29 Thread hall . jeff
For anyone that cares, I figured out the "problem"... the webhelp files that it hits the wall on are the compiled search files... They are the only files in the system that have line lengths that are RIDICULOUS in length... I'm looking at one right now that has 32767 characters all on one line...

Re: Program inefficiency?

2007-09-29 Thread hall . jeff
The search is trying to replace the spaces in our bookmarks (and the links that go to those bookmarks)... The bookmark tag looks like this: and the bookmark tag looks like this some pitfalls I've already run up against... SOMETIMES (but not often) the a and the href (or name) is split across

Re: Program inefficiency?

2007-09-29 Thread hall . jeff
It think he's saying it should look like this: # File: masseditor.py import re import os import time p1= re.compile('(href=|HREF=)+(.*)(#)+(.*)(\w\'\?-<:)+(.*)(">)+') p2= re.compile('(name=")+(.*)(\w\'\?-<:)+(.*)(">)+') p100= re.compile('(a name=)+(.*)(-)+(.*)(>)+') q1= r"\1\2\3\4_\6\7" q2= r"\1

Re: Python "implements " equivalent?

2007-10-04 Thread Jeff McNeil
of our XMLRPC servers and passes a method name that's not defined, I've got a default catch-all that logs that and handles the error accordingly. -Jeff On 10/4/07, Grant Edwards <[EMAIL PROTECTED]> wrote: > > On 2007-10-04, Bruno Desthuilliers < > [EMAIL PROTECTED]>

<    2   3   4   5   6   7   8   9   10   11   >