Re: learning emacs lisp

2005-10-31 Thread Jaime Wyant
I really appreciate the fact that while Xah is an inflammatory nut, he hasn't been `censored' by the folks that run the mailing list. Free speech is awesome, no? jw On 10/30/05, Steve Holden <[EMAIL PROTECTED]> wrote: > [To new readers: > > please ignore the rantings of this unbalanced person, w

Re: Raw string fu

2005-10-26 Thread Jaime Wyant
Doh. that example was supposed to be -> >>> r'I can\'t end strings with a \.' "I can\\'t end strings with a \\." On 10/26/05, Jaime Wyant <[EMAIL PROTECTED]> wrote: > This URL has a good section on raw strings. > > http://www.ferg.org/p

Re: Raw string fu

2005-10-26 Thread Jaime Wyant
This URL has a good section on raw strings. http://www.ferg.org/projects/python_gotchas.html r'\' is wrong because raw strings were originally added to make regular expressions easier to write. And you can't have a regexp that ends with \. Also, you can use the \ to escape your original quote c

Re: ANN: Beginning Python (Practical Python 2.0)

2005-10-21 Thread Jaime Wyant
Also, if any of you guys aren't listening to Ron's Python411 podcast, you're missing out on a quality podcast about Python. While not necessarily `hardcore python' material, Ron does touch on various things happening in the community along with discussion about nifty python packages / modules that

Re: Installing Python at Work

2005-10-17 Thread Jaime Wyant
The python interpreter doesn't do anything other than what you tell it. That is, the standard python installation does not install any `secret programs' that run in the background. Like most tools, Python is as benign as it's user. However, unlike most tools even benign users can be powerful. W

Re: Function to execute only once

2005-10-14 Thread Jaime Wyant
If I understand you correctly, you want `tmp' to be global... If so, declare it as so in execute -> def execute(): global tmp tmp = tmp+1 return tmp Otherwise, what happens is that you declare a variable local to execute, that is named tmp. When the assignment occurs it uses the glo

Re: How to call a script from another?

2005-10-13 Thread Jaime Wyant
I think this is the simplest way to do that: import sys sys.path.append('/path/to/directory/containg/script') import zopescript zopescript.main() The code above assumes: o that the path you use to append contains an __init__.py in it... o zopescript is the module you want to `run' o main is the

Re: Matching zero only once using RE

2005-10-07 Thread Jaime Wyant
On 7 Oct 2005 10:35:22 -0700, GregM <[EMAIL PROTECTED]> wrote: > Hi, > > I've looked at a lot of pages on the net and still can't seem to nail > this. Would someone more knowledgeable in regular expressions please > provide some help to point out what I'm doing wrong? > > I am trying to see if a we

Re: So far

2005-10-06 Thread Jaime Wyant
On 10/6/05, Bell, Kevin <[EMAIL PROTECTED]> wrote: > I like pythonWin other than the white background where you write your > scripts, because after awhile it's bad on the eyes. Does anyone know of a > free IDE that will allow control of this, as well as the coloring of > keywords, etc? > xemac

Re: So far

2005-10-06 Thread Jaime Wyant
On 10/6/05, CppNewB <[EMAIL PROTECTED]> wrote: > I am absolutely loving my experience with Python. Even vs. Ruby, the syntax > feels very clean with an emphasis on simplification. > Yes. We all love python, welcome aboard! > My only complaint is that there doesn't appear to be a great commercia

Re: How is wxWindows related to Python?

2005-10-01 Thread Jaime Wyant
That is a reference to wxPython. wxPython is a thin wrapper around the wxWidgets c++ library. But really, it has grown quite a bit lately and has a bunch of neato widgets that aren't included with wxWidgets c++. Visit www.wxpython.org. jw On 1 Oct 2005 18:36:06 -0700, Sathyaish <[EMAIL PROTECT

Re: Zope3 Examples?

2005-10-01 Thread Jaime Wyant
If you're experimenting with frameworks, try out django. I've only completed a few parts of the tutorial. However, what amazes me is how much I got for so little code. It's slick. http://www.djangoproject.com/ jw On 9/30/05, Markus Wankus <[EMAIL PROTECTED]> wrote: > Gerhard Häring wrote: > >

Re: [Info] PEP 308 accepted - new conditional expressions

2005-09-30 Thread Jaime Wyant
On 9/30/05, Sam <[EMAIL PROTECTED]> wrote: > Reinhold Birkenfeld writes: > > > Hi, > > > > after Guido's pronouncement yesterday, in one of the next versions of Python > > there will be a conditional expression with the following syntax: > > > > X if C else Y > > > > which is the same as today's >

Re: NTEventLogHandler not logging `info'?

2005-09-22 Thread Jaime Wyant
On 22 Sep 2005 12:23:50 -0700, Vinay Sajip <[EMAIL PROTECTED]> wrote: > Jaime Wyant wrote: > > I must be missing something. This is what I read from the documentation: > > > > When a logger is created, the level is set to NOTSET (which causes all > > messages to be

Re: NTEventLogHandler not logging `info'?

2005-09-22 Thread Jaime Wyant
BTW - you're suggestion worked. Thanks again! jw On 9/22/05, Jaime Wyant <[EMAIL PROTECTED]> wrote: > I must be missing something. This is what I read from the documentation: > > When a logger is created, the level is set to NOTSET (which causes all > messages to be proce

Re: NTEventLogHandler not logging `info'?

2005-09-22 Thread Jaime Wyant
Sajip <[EMAIL PROTECTED]> wrote: > Jaime Wyant wrote: > > This code doesn't seem to do what I think it should do: > > > > # python 2.3.2 > > # not sure of my win32 extensions version > > > > import logging > > from logging.handlers import NTEv

NTEventLogHandler not logging `info'?

2005-09-22 Thread Jaime Wyant
This code doesn't seem to do what I think it should do: # python 2.3.2 # not sure of my win32 extensions version import logging from logging.handlers import NTEventLogHandler logger = logging.getLogger("testlogger") handler = NTEventLogHandler("testlogger") logger.addHandler(handler) logger.info(

Re: MySQL & Python

2005-09-15 Thread Jaime Wyant
Connect to the database as root. create database databasename; Now grant priveleges accordingly: grant all on databasename to super_user; (I may have the grant syntax screwed up, but you get the idea.) jw On 9/15/05, Ed Hotchkiss <[EMAIL PROTECTED]> wrote: > Just migrating now from ASP/to My

Re: retrieve data using FTP in Python

2005-09-14 Thread Jaime Wyant
Try this from the interpreter: import ftplib help(ftplib) The module is pretty easy to use. If you'll be doing anything with `http', then visit urllib2: import urllib2 help(urllib2) I think urllib2 will take `ftp' urls: ftp://user:[EMAIL PROTECTED]/dir/file_to_get hth, jw On 9/13/05, swarna p

Re: Printing Docstrings Without Importing

2005-08-03 Thread Jaime Wyant
On 1 Aug 2005 06:50:23 -0700, Fuzzyman <[EMAIL PROTECTED]> wrote: > This seems to scratch several people's itches. Has anyone tried this doxygen filter: http://i31www.ira.uka.de/~baas/pydoxy/ I really like doxygen but am not sure if this is worth the trouble. jw -- http://mail.python.org/mailm

Re: Dabo in 30 seconds?

2005-08-01 Thread Jaime Wyant
It is usually referred to as STC. This is from my BUILD.txt instructions for "unix" builds: 2. To build and install wxWidgets you could just use the "make" command but there are other libraries besides the main wxWidgets libs that also need to be built so again I make a script to do it a

Re: Overriding a built-in exception handler

2005-07-21 Thread Jaime Wyant
You can't override an exception. You can only catch whatever exception is thrown. For your case, you would want to wrap that while loop up in a try/catch block like this: try: while 1: print "Yay for me!" except KeyboardInterrupt: print "CTRL-C caught" Someone had mentioned poss

Re: socket programming

2005-07-19 Thread Jaime Wyant
On 7/19/05, Helge Aksdal <[EMAIL PROTECTED]> wrote: > * Terry Reedy <[EMAIL PROTECTED]> [2005/07/19 22:57]: > > > Ask your server administrator if you are bumping up against a hidden > > connection limit. Or if a query can ask about multiple accounts. > > how can i use a connection limit to my a

Re: socket programming

2005-07-19 Thread Jaime Wyant
It sounds really strange to connect to a server "several hundred" times. If I had to guess, the server monitored all of the connects coming from your IP address and eventually stopped accepting ANY connections. jw On 7/19/05, Helge Aksdal <[EMAIL PROTECTED]> wrote: > i've recently made my very f

Re: I need help figuring out how to fix this code.

2005-06-28 Thread Jaime Wyant
On 6/28/05, Nathan Pinno <[EMAIL PROTECTED]> wrote: > Hi all, > [snip!] It looks like your indentation is off for the if statement. It should be aligned with the "name = raw_input" statement above it. Also, elif name == ["Madonna", "Cher"]: will never evaluate to true. Assume someone enters

Re: regulars expressions ?

2005-06-28 Thread Jaime Wyant
Doh - please note that csv.reader takes more than one argument - the FIRST one is an iterable object. jw On 6/28/05, Jaime Wyant <[EMAIL PROTECTED]> wrote: > Maybe, you need the csv module: > > import csv > mystring = "\"test1, test2\", test, 42" >

Re: regulars expressions ?

2005-06-28 Thread Jaime Wyant
Maybe, you need the csv module: import csv mystring = "\"test1, test2\", test, 42" # The one argument to csv.reader is an iterable object # You could use a file here... csv_reader = csv.reader([mystring]) for line in csv_reader: print line ['test1, test2', ' test', ' 42'] hth, jw On 6

Any decent IM protocol implementations (icq or aim)

2005-05-03 Thread Jaime Wyant
Can anyone recommend one? Google isn't giving me much. jw -- http://mail.python.org/mailman/listinfo/python-list

Re: dynamically generating temporary files through python/cgi

2005-04-28 Thread Jaime Wyant
On 27 Apr 2005 23:32:15 -0700, poisondart <[EMAIL PROTECTED]> wrote: > Is there a way to dynamically generate temporary files (such as an > html, xml or text file) in Python? > > I'm not sure if I'm explaining myself clearly as I've no clue how to > describe this mechanism. I've seen it on certain

Re: PyGTK vs. wxPython

2005-04-27 Thread Jaime Wyant
On 27 Apr 2005 11:31:00 -0700, dcrespo <[EMAIL PROTECTED]> wrote: > Correct me if I'm wrong: XRCed doesn't allow to do MDI Parent and Child > frames, but simple apps only. > For what you wouldn't use it? And instead, what would you use instead? > GUI Hand coding? > > Daniel > Looking at the docs

Re: Problem with sending a variable(python) while using html

2005-04-27 Thread Jaime Wyant
On 4/27/05, Hansan <[EMAIL PROTECTED]> wrote: > Hi. > > Sorry forgot to post a "non-working" example > > That could be > print "", "some text" type=hidden name="eventid" value='''+str(variable_name)+'''>'''" > > I know that it isnt very creative, but I am having a hard time getting html > to w

Re: Problem with sending a variable(python) while using html

2005-04-27 Thread Jaime Wyant
On 4/27/05, Hansan <[EMAIL PROTECTED]> wrote: > Hi all. > > I am working on a webpage where I use python and html. > > When I want to send one variable to a new script/page I use the following > code: > 0) print ''' value='''+str(variable_name)+'''>''' > > This works fine, the problem occurs whe

Re: Pythonic way to do static local variables?

2005-04-25 Thread Jaime Wyant
Well, if you're a c++ programmer, then you've probably ran into `functors' at one time or another. You can emulate it by making a python object that is `callable'. class functor: def __init__(self): self.ordered_sequence = [1, 2, 3, 4, 5] def __call__(self, arg1, a

Re: figuring out # of bytes

2005-04-25 Thread Jaime Wyant
On 4/22/05, Jaime Wyant <[EMAIL PROTECTED]> wrote: > On 22 Apr 2005 13:28:57 -0700, codecraig <[EMAIL PROTECTED]> wrote: > > i want to the number of bytes in a string... > > > > is, len(x) accurate? > > > > so, x = "hi" > > len(x) =

Re: figuring out # of bytes

2005-04-22 Thread Jaime Wyant
On 22 Apr 2005 13:28:57 -0700, codecraig <[EMAIL PROTECTED]> wrote: > i want to the number of bytes in a string... > > is, len(x) accurate? > > so, x = "hi" > len(x) == 2 so that means two bytes? > > thanks No, that means that the string is two bytes in length. The number of bytes is depen

Re: (Python newbie) Using XP-SP2/MSVC6: No Python24_d.lib, winzip barfs on Python-2.4.1.tar, cannot download bzip2

2005-04-21 Thread Jaime Wyant
me of the work of putting things in > the right place for Release and Debug builds. > > Rgds, > Bill. > > "Jaime Wyant" <[EMAIL PROTECTED]> wrote in message > news:<[EMAIL PROTECTED]>... > I fight the python24_d.lib problem with swig daily. T

Re: Python Debugger with source code tracking ability

2005-04-20 Thread Jaime Wyant
I haven't tried the customizations listed at the site below. If it works, let me know. http://page.sourceforge.net/tricks.html jw On 19 Apr 2005 19:45:05 -0700, Tran Tuan Anh <[EMAIL PROTECTED]> wrote: > Hi all, > > I am new to Python and desperated to look for a good Python debugger. > I mean

Re: (Python newbie) Using XP-SP2/MSVC6: No Python24_d.lib, winzip barfs on Python-2.4.1.tar, cannot download bzip2

2005-04-19 Thread Jaime Wyant
I fight the python24_d.lib problem with swig daily. The way I got around it was to modify swig's python configuration module. Mine was located at /lib/swig1.3/python/python.swg (I'm using cygwin) At the top, I changed #include "python.h" to #ifdef _DEBUG #undef _DEBUG #include "python.h

Re: Why does python class have not private methods? Will this never changed?

2005-04-19 Thread Jaime Wyant
Have I missed something? Doesn't this mangle class methods: class Foo: def __bar(self): print "bar" Granted, you could probably figure out how the names are being mangled. In the example above __bar is a defacto private method. Griping about it not having `private' in front of it is asin

Re: modules and namespaces

2005-04-19 Thread Jaime Wyant
Each module has its own "namespace", which is like a dictionary of objects that the module can "see". I use the term dicitionary because locals() and globals() both return dictionaries -- someone may correct me on this (or confirm what I say)... You have local and global variables. Locals are va

Re: packages

2005-04-18 Thread Jaime Wyant
A package is a collection of related modules. The modules are 'collected' in a directory that contains a special __init__.py script. Put this directory some where in your PYTHONPATH and you can do stuff like -> from mypackage.mymodule import MyObject The tutorial uses a sound package as its exam

Re:

2005-04-16 Thread Jaime Wyant
You need to look at the re module. >>> import re >>> dir(re) >>> re.split('A|a', 'A big Fat CAt') ['', ' big F', 't C', 't'] Then google around for a regular expression tutorial... jw On 4/16/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > All, > > I have been going through the manual

Re: Piping data into script under Win32

2005-04-15 Thread Jaime Wyant
I can't think of any reason that wouldn't work. You've entered the code in exactly like you have it below? Could you paste the traceback from your console? jw On 15 Apr 2005 19:11:44 -0700, runes <[EMAIL PROTECTED]> wrote: > I trying to figure out a way to make a python script accept data outpu

Re: Weird...

2005-04-11 Thread Jaime Wyant
Dictionary keys have no defined order. This is what the docs say about that: Keys and values are listed in random order. If items(), keys(), values(), iteritems(), iterkeys(), and itervalues() are called with no intervening modifications to the dictionary, the lists will directly correspond. jw

Re: Using something other than ';' to separate statements

2005-03-30 Thread Jaime Wyant
On Wed, 30 Mar 2005 14:26:20 -0500, Peter Hansen <[EMAIL PROTECTED]> wrote: > Jaime Wyant wrote: > > Well, I'm embedding python in an old C console app. This app uses a > > lot of ; delimited records. > > > > I want to allow the execution of arbitrary pyth

Re: Using something other than ';' to separate statements

2005-03-30 Thread Jaime Wyant
nator and do some string substitution to turn my new terminator into python's ';'. Thanks ya'll, jw On Wed, 30 Mar 2005 11:58:42 -0500, Peter Hansen <[EMAIL PROTECTED]> wrote: > Jaime Wyant wrote: > > I know I've seen this somewhere, but can't seem to

Using something other than ';' to separate statements

2005-03-30 Thread Jaime Wyant
I know I've seen this somewhere, but can't seem to google it. Is there a way to use an alternate statement separator, other than the default ';'? jw -- http://mail.python.org/mailman/listinfo/python-list

Re: Beginner Question - Very Easy I'm Sure...

2005-03-24 Thread Jaime Wyant
str() returns a string, it doesn't change rannum which is still a number... try -> rannum = str(rannum) jw On Thu, 24 Mar 2005 13:13:25 -0800, Todd_Calhoun <[EMAIL PROTECTED]> wrote: > I'm trying to generate a random number, and then concetate it to a word to > create a password. > > I get the

Re: Windows, Python and low level networking

2005-03-23 Thread Jaime Wyant
Maybe this will help. >From the interpreter -> >>> import socket >>> help(socket) Which gives you all sorts of neat information on the socket module. jw On 23 Mar 2005 08:08:04 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Is it possible to have low level netwoking with python under Wi

Re: How do I pass structures using a C extension?

2005-03-15 Thread Jaime Wyant
I've never built a swig extension module using distutils. Heck, i've only rolled up pure python code using it... that's pretty slick.. Oh, anyway, make sure that libcmdline.h is in swigs search path. Either copy libcmdline.h to $CWD or figure out how to pass -I to swig from distutils: -I

Re: How do I pass structures using a C extension?

2005-03-14 Thread Jaime Wyant
You need to check out swig. It is the *only* way to setup a `c' library for use with python. http://www.swig.org/ jw On 14 Mar 2005 05:25:03 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi. > > I trying to write an extension module to call some C libraries so I can > use them in Pyth

Re: multiple buffers management

2005-03-10 Thread Jaime Wyant
Again, your being vague. You need to be more specific about what you're trying to accomplish. I have no idea what "buffer management" is. If you explain exactly what you're doing then maybe I or someone else could provide you with more meaningful answers. jw On 10 Mar 2005 15:18:08 -0800, [EMA

Re: char buffer

2005-03-10 Thread Jaime Wyant
You'll probably want to be more specific. First thing that comes to mind is how do you plan on passing the `buffer' to your `test app'. I can think of a couple of ways off hand -- socket, stdin or maybe as a command line argument. If you're doing one of those, then I don't think you'll need a bu

Re: Distributing applications

2005-03-02 Thread Jaime Wyant
Sneaky! I like it. Now if there was only a subversion python module... jw On Wed, 02 Mar 2005 22:08:45 +0100, Thomas Heller <[EMAIL PROTECTED]> wrote: > "Serge Orlov" <[EMAIL PROTECTED]> writes: > > > Jaime Wyant wrote: > > > >> This becomes e

Re: Distributing applications

2005-03-02 Thread Jaime Wyant
On 2 Mar 2005 10:43:38 -0800, Serge Orlov <[EMAIL PROTECTED]> wrote: > Jaime Wyant wrote: > > I chose not to use py2exe because it made updating my app a bit > > messier. For instance, suppose I don't use the smtplib module in > > version 1 of my software.

Re: Distributing applications

2005-03-02 Thread Jaime Wyant
I wanted a nice tightly-wrapped distribution of my own and really didn't want to go the py2exe route. I may have used a sledgehammer to kill a fly, but here is what I did... 1) Downloaded python source (2.3.4) 2) Modified source, so that sys.path would pull from a registry key setup by my install

Re: Best IDe

2005-02-24 Thread Jaime Wyant
I demo'd wing ide and have to say it's the best commercial offering. The only other one I'm aware of is Komodo and it really can't touch Wing. But for me, wingide was slugish. I have a 1/2 gig of memory and a pretty hefty CPU - i think its a 1.6 Pentium M [it's a company issued laptop -- so im n

Re: Reportlab and Barcodes

2005-02-10 Thread Jaime Wyant
That looks cleaner than mine. I had to do this -> # Register the barcode true-type-font # Don't want to push the font out to everyone in the office... from reportlab.pdfbase import pdfmetrics from reportlab.pdfbase.ttfonts import TTFont pdfmetrics.registerFont( TTFont( 'barcode', r'c:\inetpub\www

Re: Should I always call PyErr_Clear() when an exception occurs?

2004-12-21 Thread Jaime Wyant
On Tue, 21 Dec 2004 01:17:52 -0500, Tim Peters <[EMAIL PROTECTED]> wrote: > [Jaime Wyant] > > I've found that the code below will crash if I don't have the > > PyErr_Clear() function call. Should I always call PyErr_Clear()? > > That's not the right ap

Should I always call PyErr_Clear() when an exception occurs?

2004-12-20 Thread Jaime Wyant
I've found that the code below will crash if I don't have the PyErr_Clear() function call. Should I always call PyErr_Clear()? The error message I get has to do with garbage collection --> Exception exceptions.ImportError: 'No module named badmodule' in 'garbage collec tion' ignored Fatal Python

Re: Python xmlrpc servers?

2004-12-01 Thread Jaime Wyant
Check these out -> http://server3.sleekcom.com/~jaime/webservice.html (syntax highlighted version) http://server3.sleekcom.com/~jaime/webservice.txt (savable text version) HTH, jw On Wed, 01 Dec 2004 20:04:46 GMT, ted holden <[EMAIL PROTECTED]> wrote: > Jaime Wyant wrote: > &

Re: Python xmlrpc servers?

2004-12-01 Thread Jaime Wyant
Mark Pilgrim wrote a really neat piece of python code that did XML-RPC over CGI. It seems to have disappeared from his website, though (http://diveintomark.org/public/webservices.txt). If you can't dig it up, I have a working copy that I use. I'll post it / email it if you want. jw On Wed, 1