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
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
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
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
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
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
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
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
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
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
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
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:
> >
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
>
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
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
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
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(
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
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
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
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
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
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
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
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
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"
>
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
Can anyone recommend one? Google isn't giving me much.
jw
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
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) =
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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.
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
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
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
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
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
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:
>
&
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
62 matches
Mail list logo