Re: some trouble with MySQLdb

2005-06-29 Thread dimitri pater
try: db = MySQLdb.connect(host="localhost", user="user", passwd="pass", db="myDB") localhost can be a URL also (if MySQL is set up properly in the first place) regards, DimtiriOn 6/30/05, nephish <[EMAIL PROTECTED]> wrote: Hey there all,i have a question about how to point my python install to my s

Re: Favorite non-python language trick?

2005-06-29 Thread Paddy
Sadly, its not a solution that I'm after, but a particular toolkit that can be used for solving that type of problem. - Pad. -- http://mail.python.org/mailman/listinfo/python-list

Re: need help with MySQLdb

2005-06-29 Thread Wolfram Kraus
[EMAIL PROTECTED] wrote: > Hey there all, > i have a question about how to point my python install to my sql > database. > > when i enter this: db = MySQLdb.connect(user="user", passwd="pass", > db="myDB") > > i get this: > Traceback (most recent call last): > File "", line 1, in -toplevel- >

multi regexp analyzer ? or how to do...

2005-06-29 Thread joh12005
Hello, here is a trouble that i had, i would like to resolve it with python, even if i still have no clue on how to do it. i had many small "text" files, so to speed up processes on them, i used to copy them inside a huge one adding some king of xml separator : [content] content is tab separa

ANN: PyGaim released - Gaim Python plugin

2005-06-29 Thread Gerrit van Dyk
PyGaim has been released. Summary: Gaim Python plug-in. The product provides developers with the capability to develop python plugins for Gaim This release is just a get it out there release and a lot of polishing still needs to be done. However, it does enable a python developer to develop ga

Re: Inheriting from object

2005-06-29 Thread Dave Benjamin
Steven Bethard wrote: > Guido also suggests that the explicit: > > class C(object): > pass > > is "much preferred"[2] over: > > __metaclass__ = type > > class C: > pass Really? I have been toying with the idea of using the __metaclass__ trick, since it results in c

need help with MySQLdb

2005-06-29 Thread nephish
Hey there all, i have a question about how to point my python install to my sql database. when i enter this: db = MySQLdb.connect(user="user", passwd="pass", db="myDB") i get this: Traceback (most recent call last): File "", line 1, in -toplevel- db = MySQLdb.connect(user="user", passwd="pa

some trouble with MySQLdb

2005-06-29 Thread nephish
Hey there all, i have a question about how to point my python install to my sql database. when i enter this: db = MySQLdb.connect(user="user", passwd="pass", db="myDB") i get this: Traceback (most recent call last): File "", line 1, in -toplevel- db = MySQLdb.connect(user="user", passwd="p

how to shrink a numarray array?

2005-06-29 Thread Qiangning Hong
To draw a large array of data on a small panel, I need to shrink it to a given size. e.g: To draw numarray.arange(1) on a panel of width of 100, I only need to draw the points of (0, 100, 200, 300, ...) instead of (0, 1, 2, ...). So I need a method to shrink it to an 100-item array. x[::len

Re: Favorite non-python language trick?

2005-06-29 Thread Terry Reedy
"Paddy" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > The OZ homepage has an example for solving the eight queens problem: Buried in the generator test module (something like lib/test/test_generators.py) are solutions for both 8Queens and Knight's Tour. You might find these of

Weekly Python Patch/Bug Summary

2005-06-29 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 344 open ( +6) / 2875 closed ( +9) / 3219 total (+15) Bugs: 897 open (-17) / 5094 closed (+34) / 5991 total (+17) RFE : 191 open ( +3) / 170 closed ( +0) / 361 total ( +3) New / Reopened Patches __ fileinput

Re: Help please: How to assign an object name at runtime

2005-06-29 Thread Steven D'Aprano
John Machin wrote: > BTW, don't use "l". Excellent advice. But since the original poster appears to be rather a newbie, perhaps a little bit of explanation would be useful. Variables like l and I should be avoided like the plague, because in many fonts and typefaces they are indistinguishab

Re: aligning text with space-normalized text

2005-06-29 Thread Steven Bethard
John Machin wrote: > If "work" is meant to detect *all* possibilities of 'chunks' not having > been derived from 'text' in the described manner, then it doesn't work > -- all information about the positions of the whitespace is thrown away > by your code. > > For example, text = 'foo bar', chun

__new__, __init__ and pickle

2005-06-29 Thread Edward C. Jones
Suppose I want to define the class MyClass so I can create an instance by MyClass(arg0, arg1, kwarg0=None, kwarg1=0, reuse=None, save=None) If reuse is not None, it is the name of a pickle file. Unpickle the file to get the instance. If save is not None, it is a file name. Pickle the instanc

Re: Favorite non-python language trick?

2005-06-29 Thread Paddy
Joseph Garvin wrote: 'm curious -- what is everyone's favorite trick from a non-python language? And -- why isn't it in Python? I use constraints programming at work, Check out "System Verilog" or OZ/Mozart. It would be great if this style of programming could be added to Python. It is a de

Re: When someone from Britain speaks, Americans hear a "British accent"...

2005-06-29 Thread Gafoor
Steven D'Aprano wrote: > But don't worry, there is one thing we all agree on throughout the > English-speaking world: you Americans don't speak English. > > There are a few things that you can do to help: > > Herb starts with H, not E. It isn't "ouse" or "ospital" or "istory". > It isn't "erb" eith

Re: Help please: How to assign an object name at runtime

2005-06-29 Thread John Machin
[EMAIL PROTECTED] wrote: > Good day: > Probably the answer to my question is staring me in the face, but the > solution escapes me. > > The following is the input line of the file: SoftDict-.csv: > ca1017,GRPHScriptSet,ADD/REM,Adobe Acrobat 4.0=2005/06/14 > > I expected an instance of Machine()

Re: Modules for inclusion in standard library?

2005-06-29 Thread Terry Hancock
On Wednesday 29 June 2005 04:55 am, Simon Brunning wrote: > On 6/28/05, John Roth <[EMAIL PROTECTED]> wrote: > > I'd definitely like to see ctypes. I can agree with the segfault > > issue, but I think that some design work would eliminate that. > > I'm not sure that it would. Ctypes allows you, as

Re: aligning text with space-normalized text

2005-06-29 Thread John Machin
Steven Bethard wrote: [snip] > And it appears to work: [snip] > But it seems somewhat inelegant. Can anyone see an easier/cleaner/more > Pythonic way[1] of writing this code? > > Thanks in advance, > > STeVe > > [1] Yes, I'm aware that these are subjective terms. I'm looking for > subjective

Re: Modules for inclusion in standard library?

2005-06-29 Thread Mike Meyer
Rocco Moretti <[EMAIL PROTECTED]> writes: > Except that (please correct me if I'm wrong) there is somewhat of a > policy for not including interface code for third party programs which > are not part of the operating system. (I.e. the modules in the > standard libary should all be usable for anyon

Re: Boss wants me to program

2005-06-29 Thread Mike Meyer
"Adriaan Renting" <[EMAIL PROTECTED]> writes: > I realy prefer a WYSIWYG UI design tool > to having to code BUTTON(120, 123, 123, 335, -1, NULL, doButton, "Push", > "push this button") With a modern GUI library, it's more like: buttonBox.addWidget(Button("&New", my, "new")) and your button

Re: Help please: How to assign an object name at runtime

2005-06-29 Thread Dan Sommers
On 29 Jun 2005 17:55:44 -0700, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > The following is the input line of the file: SoftDict-.csv: > ca1017,GRPHScriptSet,ADD/REM,Adobe Acrobat 4.0=2005/06/14 > I expected an instance of Machine() to be created with a name ca1017. > Instead, an object i

Re: Programmers Contest: Fit pictures on a page

2005-06-29 Thread Dan Sommers
On Wed, 29 Jun 2005 19:43:33 -0400, Roy Smith <[EMAIL PROTECTED]> wrote: > Not just plywood panels, but sheets of paper, bolts of cloth, sheet > metal, plate glass, etc. A slight complication is that some materials > have a preferred orientation (i.e. plywood has a grain, textiles have > warp vs.

Help please: How to assign an object name at runtime

2005-06-29 Thread [EMAIL PROTECTED]
Good day: Probably the answer to my question is staring me in the face, but the solution escapes me. The following is the input line of the file: SoftDict-.csv: ca1017,GRPHScriptSet,ADD/REM,Adobe Acrobat 4.0=2005/06/14 I expected an instance of Machine() to be created with a name ca1017. Inste

aligning text with space-normalized text

2005-06-29 Thread Steven Bethard
I have a string with a bunch of whitespace in it, and a series of chunks of that string whose indices I need to find. However, the chunks have been whitespace-normalized, so that multiple spaces and newlines have been converted to single spaces as if by ' '.join(chunk.split()). Some example d

Re: Thoughts on Guido's ITC audio interview

2005-06-29 Thread Markus Wankus
Stephen Kellett wrote: > In message <[EMAIL PROTECTED]>, Markus Wankus > <[EMAIL PROTECTED]> writes > >> Have you ever tried anything that provides real, usable refactoring >> like Eclipse does with Java? I guarantee if you used it more than a >> few times your view would most likely change. >

Re: python broadcast socket

2005-06-29 Thread Grant Edwards
On 2005-06-29, Jp Calderone <[EMAIL PROTECTED]> wrote: > On Thu, 30 Jun 2005 00:13:45 +0200, Irmen de Jong <[EMAIL PROTECTED]> wrote: >>Grant Edwards wrote: >> >>> Under Linux, you need to be root to send a broadcase packet. >> >>I don't think this is true. >> > > I think you're right. I believe y

Re: When someone from Britain speaks, Americans hear a "British accent"...

2005-06-29 Thread Grant Edwards
On 2005-06-29, Luis M. Gonzalez <[EMAIL PROTECTED]> wrote: > Grant Edwards wrote: >> That depends on the accent. I believe that's probably true for >> the educated south of England, BBC, received pronunciation. I >> don't think that's true for some of the other dialects from >> northern areas (e.

Re: Inheriting from object

2005-06-29 Thread Steven Bethard
Fuzzyman wrote: > Surely when they are removed : > > class foo: > pass > > won't become invalid syntax, it will just automatically inherit from > object ? Well, Guido views this particular syntax as an "oopsie"[1]. It should actually look like: class C(): pass Guido also su

Re: Programmers Contest: Fit pictures on a page

2005-06-29 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Don <[EMAIL PROTECTED]> wrote: > Chung Leong wrote: > > > Isn't that an NP-complete problem or am I crazy? > > It is NP complete. Its known as the "cutting stock problem" (aka "Knapsack > problem"). Here's a Wikipedia page that describes it: > > http://en.wikipe

Re: Debugger Confusion

2005-06-29 Thread Christopher Arndt
Rex Eastbourne schrieb: > Also, when I try running pdb in my Emacs shell, I get very weird > behavior: for instance, I'll hit 'h' and enter twenty times with no > output. Then, all of a sudden, twenty output messages will pop up. That may be due to output buffering. Try running your script with "p

Re: How to find Windows "Application data" directory??

2005-06-29 Thread Renato Ramonda
Trent Mick ha scritto: > Note that the APPDATA environment variable is only there on *some* of > the Windows flavours. It is there on Win2k and WinXP. It is not there on > WinME. Dunno about Win95, Win98, WinNT... but you may not care about > those old guys. That's (I guess) because the DOS spawn

Re: Programmers Contest: Fit pictures on a page

2005-06-29 Thread [EMAIL PROTECTED]
Don wrote: > Chung Leong wrote: > > > Isn't that an NP-complete problem or am I crazy? > > It is NP complete. Its known as the "cutting stock problem" (aka "Knapsack > problem"). Here's a Wikipedia page that describes it: > > http://en.wikipedia.org/wiki/Cutting_stock_problem > > There are commer

Re: Programmers Contest: Fit pictures on a page

2005-06-29 Thread Don
Chung Leong wrote: > Isn't that an NP-complete problem or am I crazy? It is NP complete. Its known as the "cutting stock problem" (aka "Knapsack problem"). Here's a Wikipedia page that describes it: http://en.wikipedia.org/wiki/Cutting_stock_problem There are commerical applications available t

Re: Boss wants me to program

2005-06-29 Thread Paul Rubin
phil <[EMAIL PROTECTED]> writes: > > Wow! How about a sextant? > > Simple device really. And a great practical demonstration of trigonometry. > > > > Excellent idea, even found a few how to sites. We'll do it. > Any others? Sextants are difficult to build precisely (compared with quadrants) and t

Re: Boss wants me to program

2005-06-29 Thread John Machin
Thomas Bartkus wrote: > "phil" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >>>About teaching in the exact sciences: I think we need a more hands-on >>>applied approach, to some extent this holds for the entire school >>>system. >> >>YES! As a geometry(& trig) teacher, I am goin

Re: Graphs/statistics using wxPython

2005-06-29 Thread Will McGugan
Jan Danielsson wrote: Hello all, I wanted to plot some statistics, so I wrote a simple wxPython class to do it. Then I realized that I would like to draw bar graphs, so I added that too. Since I'm a complete Python newbie, I haven't done much of it the "Python way", I suspect. So, I'm won

Re: Boss wants me to program

2005-06-29 Thread phil
> Wow! How about a sextant? > Simple device really. And a great practical demonstration of trigonometry. > Excellent idea, even found a few how to sites. We'll do it. Any others? I think I am going to have them build a shed because they need to get their hands on SOMETHING. But the geometry/tim

Re: When someone from Britain speaks, Americans hear a "British accent"...

2005-06-29 Thread Brian
Steven, Very well written... I enjoyed reading your post! Brian --- Steven D'Aprano wrote: > On Tue, 28 Jun 2005 11:27:40 -0700, muldoon wrote: > > >>Americans consider having a "British accent" a sign of sophistication >>and high intelligence. Many companies hire salespersons from Britain t

Re: Modules for inclusion in standard library?

2005-06-29 Thread Christopher Arndt
Reinhold Birkenfeld schrieb: > Do you have any other good and valued Python modules that you would think are > bug-free, mature (that includes a long release distance) and useful enough to > be granted a place in the stdlib? Hmmm, let's look into /site-packackes, That's what I always have install

Re: When someone from Britain speaks, Americans hear a "British accent"...

2005-06-29 Thread Luis M. Gonzalez
Grant Edwards wrote: > That depends on the accent. I believe that's probably true for > the educated south of England, BBC, received pronunciation. I > don't think that's true for some of the other dialects from > northern areas (e.g. Liverpool) or the "cockney" accent. What's exactly the "cockn

Re: Programmers Contest: Fit pictures on a page

2005-06-29 Thread [EMAIL PROTECTED]
Chung Leong wrote: > Isn't that an NP-complete problem or am I crazy? That makes it a more realistic challange, doesn't it? Suppose it was something simple, like calculating a minimal spanning tree. Every program would produce the same output. What kind of contest would that be? -- http://mai

Re: Graphs/statistics using wxPython

2005-06-29 Thread Robert Kern
Jan Danielsson wrote: >So, for future reference: I should *never* mix x and y versions in > verion: x.y.z. I've wondered why there are versions of libraries for > different versions of Python.. For packages with extension modules at least. Python maintains binary compatibility between micro-

Re: python broadcast socket

2005-06-29 Thread Jp Calderone
On Thu, 30 Jun 2005 00:13:45 +0200, Irmen de Jong <[EMAIL PROTECTED]> wrote: >Grant Edwards wrote: > >> Under Linux, you need to be root to send a broadcase packet. > >I don't think this is true. > I think you're right. I believe you just need to set the broadcast SOL_SOCKET option. >>> import

Re: python broadcast socket

2005-06-29 Thread Irmen de Jong
Grant Edwards wrote: > Under Linux, you need to be root to send a broadcase packet. I don't think this is true. --Irmen -- http://mail.python.org/mailman/listinfo/python-list

Re: When someone from Britain speaks, Americans hear a "British accent"...

2005-06-29 Thread Tim Churches
muldoon wrote: > Americans consider having a "British accent" a sign of sophistication > and high intelligence. Many companies hire salespersons from Britain to > represent their products,etc. Question: When the British hear an > "American accent," does it sound unsophisticated and dumb? > > Be bl

Re: When someone from Britain speaks, Americans hear a "British accent"...

2005-06-29 Thread Michael Hoffman
Steven D'Aprano wrote: > Herb starts with H, not E. It isn't "ouse" or "ospital" or "istory". It > isn't "erb" either. You just sound like tossers when you try to pronounce > herb in the original French. And the same with homage. Strangely enough there are Brits who pronounce "hotel" without an H

Re: Inheriting from object

2005-06-29 Thread Fuzzyman
So theres no actual advantage that you know of ;-) Surely when they are removed : class foo: pass won't become invalid syntax, it will just automatically inherit from object ? That's what I assumed, anyway Regards, Fuzz http://www.voidspace.org.uk/python -- http://mail.python.org/ma

Re: Programmers Contest: Fit pictures on a page

2005-06-29 Thread Chung Leong
Isn't that an NP-complete problem or am I crazy? -- http://mail.python.org/mailman/listinfo/python-list

Re: Inheriting from object

2005-06-29 Thread Benji York
Fuzzyman wrote: > Also, can anyone explain any tangible benefit of inheriting from > object, when not explicitly using any features of new style classes ? One reason is that properties won't work correctly. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: strange __call__

2005-06-29 Thread Rahul
Hi. I understood your point. thanks... rahul Steven Bethard wrote: > Steven Bethard wrote: > > > > def wrap(obj): > > def f(*args, **kwargs): > > for arg in args: > > print arg > > return obj(*args, **kwargs) > > return f > > > > @wrap > > def func(a, b, c):

Re: strange __call__

2005-06-29 Thread Steven Bethard
Steven Bethard wrote: > > def wrap(obj): > def f(*args, **kwargs): > for arg in args: > print arg > return obj(*args, **kwargs) > return f > > @wrap > def func(a, b, c): > ... > > class C(object): > ... > C = wrap(C) Rahul top-posted: > If you

Re: Inheriting from object

2005-06-29 Thread Bruno Desthuilliers
Fuzzyman a écrit : > Hello, > > To create a classic (old style) class, I write : > > class foo: > pass > > To do the equivalent as a new style class, I write : > > class foo(object): > pass > > *Should* I in fact write : > > class foo(object): > def __init__(self, *args, **kwargs)

Re: strange __call__

2005-06-29 Thread Reinhold Birkenfeld
Rahul wrote: > If you do C = wrap(C) C no longer remains a class..it becomes a > function. Does that matter? Reinhold -- http://mail.python.org/mailman/listinfo/python-list

Re: Boss wants me to program

2005-06-29 Thread Thomas Bartkus
"phil" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > > About teaching in the exact sciences: I think we need a more hands-on > > applied approach, to some extent this holds for the entire school > > system. > > YES! As a geometry(& trig) teacher, I am going to have them build a >

Re: Boss wants me to program

2005-06-29 Thread Peter Hansen
Harry George wrote: > "Adriaan Renting" <[EMAIL PROTECTED]> writes: >>Both VB and Python are easier to learn as the more powerful >>languages, the price is that they lack features that make it easier to >>manage large and complex projects. > > What is a large project, and what is Python missing th

Re: Graphs/statistics using wxPython

2005-06-29 Thread Jan Danielsson
Robert Kern wrote: >> [---] >> >>> It's okay. Just about every Pythonista in the sciences has, at one time >>> or another, started a plotting library. It's a rite of passage. Welcome >>> to the club. :-) >> >> >>Question: I need to install SciPy in order to use matplotlib, > > No you don't.

Re: strange __call__

2005-06-29 Thread Rahul
If you do C = wrap(C) C no longer remains a class..it becomes a function. Steven Bethard wrote: > Rahul wrote: > > def wrapper(obj): > >g = obj.__call__ > >def f(*args,**kwargs): > > for arg in args:print arg > > return g(*args,**kwargs) > >obj.__call__=f > > but it seems thi

Re: Modules for inclusion in standard library?

2005-06-29 Thread Steven Bethard
Noah wrote: > def unzip(list): > if len(list) == 0: return () > l = [] > for t in range(len(list[0])): > l.append(map( lambda x,t=t: x[t], list )) > return tuple(l) The simplest solution to this problem that I know of: def unzip(iterable): return zip(*iterabl

Re: strange __call__

2005-06-29 Thread Steven Bethard
Rahul wrote: > def wrapper(obj): >g = obj.__call__ >def f(*args,**kwargs): > for arg in args:print arg > return g(*args,**kwargs) >obj.__call__=f > but it seems this will not work for functions :( def wrap(obj): def f(*args, **kwargs): for arg in args:

[no subject]

2005-06-29 Thread python-list-bounces+archive=mail-archive . com
#! rnews 1192 Newsgroups: comp.lang.python Path: news.xs4all.nl!newsspool.news.xs4all.nl!transit.news.xs4all.nl!195.241.76.212.MISMATCH!transit1.news.tiscali.nl!tiscali!transit0.news.tiscali.nl!tudelft.nl!txtfeed1.tudelft.nl!feeder2.cambrium.nl!feed.tweaknews.nl!feeder.enertel.nl!nntpfeed-01.ops.a

Re: map vs. list-comprehension

2005-06-29 Thread Terry Reedy
"F. Petitjean" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >res = [ bb+ii*dd for bb,ii,dd in zip(b,i,d) ] > Hoping that zip will not be deprecated. Cease worrying. Zip was added to replace the zipping behavior of map and the idiom map(None, a, b, ...). It simultaneously alter

Re: Graphs/statistics using wxPython

2005-06-29 Thread Robert Kern
Jan Danielsson wrote: > Robert Kern wrote: > [---] > >>It's okay. Just about every Pythonista in the sciences has, at one time >>or another, started a plotting library. It's a rite of passage. Welcome >>to the club. :-) > >Question: I need to install SciPy in order to use matplotlib, No you

Re: Graphs/statistics using wxPython

2005-06-29 Thread Jan Danielsson
Robert Kern wrote: [---] > It's okay. Just about every Pythonista in the sciences has, at one time > or another, started a plotting library. It's a rite of passage. Welcome > to the club. :-) Question: I need to install SciPy in order to use matplotlib, but on the download page I see that ther

Re: Modules for inclusion in standard library?

2005-06-29 Thread Paul Rubin
Rocco Moretti <[EMAIL PROTECTED]> writes: > Except that (please correct me if I'm wrong) there is somewhat of a > policy for not including interface code for third party programs which > are not part of the operating system. (I.e. the modules in the > standard libary should all be usable for anyone

Re: Modules for inclusion in standard library?

2005-06-29 Thread Noah
unzip() -- Not really a module, but a standard library function. Why isn't it in the standard library? It seems like I'm always adding it to my code. I think I once heard an argument against it, but I forget what it was. And yet I still find myself wanting unzip. def unzip(list): if len(list)

Re: COM problem .py versus .exe

2005-06-29 Thread Tim G
Greg Miller wrote: > I tried the code snippet using win32api.GetFileVersionInfo(), what I > get now is the following when running on the executable machine: > > . . . FileFlagsMask => 63 > FileType => 2 > FileVersionMS => 65536 > FileVersionLS => 1 > Signature => -17890115 > FileSubtype => 0 > File

Dr. Dobb's Python-URL! - weekly Python news and links (Jun 29)

2005-06-29 Thread Simon Brunning
QOTW: "And what defines a 'python activist' anyway? Blowing up Perl installations worldwide?" - Ivan Van Laningham "Floating point is about nothing if not being usefully wrong." - Robert Kern Sibylle Koczian needs to sort part of a list. His first attempt made the natural mistake - sort

Re: Inheriting from object

2005-06-29 Thread Robert Kern
Fuzzyman wrote: > Hello, > > To create a classic (old style) class, I write : > > class foo: > pass > > To do the equivalent as a new style class, I write : > > class foo(object): > pass > > *Should* I in fact write : > > class foo(object): > def __init__(self, *args, **kwargs): >

Re: Modules for inclusion in standard library?

2005-06-29 Thread Gregory Piñero
And 1 more argument for adding DB support, a large part of PHP's success as a web langauge is being easily interoperable with MySQL (out of the box I think? I haven't used it.) But I think it's tight integration with MySQL really helped it find its niche. I think "batteries included" means Pyth

Re: Modules for inclusion in standard library?

2005-06-29 Thread Gregory Piñero
While that policy does make sense, I think a database program falls somewhere in between an OS and an everyday third party program. For web developers, the database might as well be the OS. I use the database to store everything in my web app. That way I can just worry about 1 place to access in

Inheriting from object

2005-06-29 Thread Fuzzyman
Hello, To create a classic (old style) class, I write : class foo: pass To do the equivalent as a new style class, I write : class foo(object): pass *Should* I in fact write : class foo(object): def __init__(self, *args, **kwargs): object.__init__(self) ? Also, can anyon

urllib2, https, and proxies

2005-06-29 Thread Fuzzyman
Hello all (well, some of you I guess), Is it true that you can't configure a proxy handler for urllib2 to fetch https URLs through a proxy ? I know that you pass a dictionary, keyed by protocol, to the proxy handler - but when we get an exception when we fetch an https URL. Fetching the same URL

Re: Which kid's beginners programming - Python or Forth?

2005-06-29 Thread Ian Osgood
Forth clarifications below... Rocco Moretti wrote: > > So for Math you'd do something like: > > y = b + mx + cx^2 > > IIRC, for Forth it would be something like (please excuse the mistakes > in operator notation): > > x 2 ^ c * m x * + b + 'y' setvar Assuming these are all VALUEs: x DUP * c *

Re: Graphs/statistics using wxPython

2005-06-29 Thread Robert Kern
Jan Danielsson wrote: > Robert Kern wrote: >>Trick #1: >> >>import matplotlib > > Oh. :-) > > That's a pretty neat trick -- now can you make my embarrassment go away? > >I did do a quick search to see if anyone had done anything similar; > but I guess I wasn't using the right keywords. > >

Re: PIL question: keeping metadata

2005-06-29 Thread Will McCutchen
> Is there any way of keeping this info in PIL? I don't think so... when I investigated in the past, I think I discovered that the PIL can't write EXIF data (I might be wrong, though, or my information might be outdated). > Alternatively, is there a simple image > processing package that does it?

Re: Graphs/statistics using wxPython

2005-06-29 Thread Jan Danielsson
Robert Kern wrote: >>I wanted to plot some statistics, so I wrote a simple wxPython class >> to do it. Then I realized that I would like to draw bar graphs, so I >> added that too. >> >>Since I'm a complete Python newbie, I haven't done much of it the >> "Python way", I suspect. So, I'm won

Re: Modules for inclusion in standard library?

2005-06-29 Thread Rocco Moretti
Paul Rubin wrote: > Gregory Piñero <[EMAIL PROTECTED]> writes: > >>I'd like to see some database API's to the most common databases >>included. > > Yes, certainly, this is a serious deficiency with Python. Except that (please correct me if I'm wrong) there is somewhat of a policy for not inclu

Re: importing packages from a zip file

2005-06-29 Thread Jp Calderone
On Wed, 29 Jun 2005 18:49:10 +, Peter Tillotson <[EMAIL PROTECTED]> wrote: >cheers Scott > >should have been >from myZip.zip import base.branch1.myModule.py > >and no it didn't work, anyone know a reason why this syntax is not >preferred ?? > >sorry posted the soln again, it works but feels nas

Re: Graphs/statistics using wxPython

2005-06-29 Thread Robert Kern
Jan Danielsson wrote: > Hello all, > >I wanted to plot some statistics, so I wrote a simple wxPython class > to do it. Then I realized that I would like to draw bar graphs, so I > added that too. > >Since I'm a complete Python newbie, I haven't done much of it the > "Python way", I suspec

Re: importing packages from a zip file

2005-06-29 Thread Peter Tillotson
cheers Scott should have been from myZip.zip import base.branch1.myModule.py and no it didn't work, anyone know a reason why this syntax is not preferred ?? sorry posted the soln again, it works but feels nasty Scott David Daniels wrote: > Peter Tillotson wrote: > >> ... With the file system >

Graphs/statistics using wxPython

2005-06-29 Thread Jan Danielsson
Hello all, I wanted to plot some statistics, so I wrote a simple wxPython class to do it. Then I realized that I would like to draw bar graphs, so I added that too. Since I'm a complete Python newbie, I haven't done much of it the "Python way", I suspect. So, I'm wondering if someone would

Re: importing packages from a zip file

2005-06-29 Thread Peter Tillotson
solution: have to add the zip archives to the PYTHONPATH, can be done in the env but also as below import sys, os.path zipPackages=['base.zip'] for package in zipPackages: sys.path.insert(0,os.path.join(sys.path[0],package)) import base.branch1.myModule Peter Tillotson wrote: > Hi all, > >

Re: importing packages from a zip file

2005-06-29 Thread Scott David Daniels
Peter Tillotson wrote: > ... With the file system > > base/ > __init__.py > branch1/ > __init__.py > myModule.py > > At the same time its possible to store modules in a flat zip-file and > import modules with the following. > > from myZip.zip import myModule.py Does this work for yo

Re: Modules for inclusion in standard library?

2005-06-29 Thread Paul Rubin
Gregory Piñero <[EMAIL PROTECTED]> writes: > I'd like to see some database API's to the most common databases > included. Yes, certainly, this is a serious deficiency with Python. -- http://mail.python.org/mailman/listinfo/python-list

Re: When someone from Britain speaks, Americans hear a "British accent"...

2005-06-29 Thread Alan Kennedy
[Mike Holmans] > Some of those sonorous slow talkers from the South, and majestic bass > African-Americans like James Earl Jones or Morgan Freeman, have far > more gravitas than any English accent can: to us, such people sound > monumental. On a related note, have you ever seen any of the original

importing packages from a zip file

2005-06-29 Thread Peter Tillotson
Hi all, I was wondering if this is possible. In python v2.3 the import systems was extended via PEP302 to cope with packages. *.py files in a directory hierarchy can be imported as modules each level in the directory hierarchy needs to contain at least an empty __init__.py file. eg. With the file

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

2005-06-29 Thread Brian
Hi Nathan, Please see my comments listed below. Nathan Pinno wrote: > print "Program Author: Nathan Pinno" > print "ID# 2413448" > print > print "Program 3 - Loops and IF Conditions" > print > password = raw_input("Type in the password, please: ") > while password != "hello": >

Re: Beginner question: Converting Single-Element tuples to list

2005-06-29 Thread Paul McGuire
Steve - Good catch - in v1.3, I added some Unicode support for pyparsing, although I have not gotten much feedback that anyone is using it, or how well it works. So it is preferable to test against basestring instead of str. -- Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: COM problem .py versus .exe

2005-06-29 Thread Greg Miller
I tried the code snippet using win32api.GetFileVersionInfo(), what I get now is the following when running on the executable machine: . . . FileFlagsMask => 63 FileType => 2 FileVersionMS => 65536 FileVersionLS => 1 Signature => -17890115 FileSubtype => 0 FileFlags => 0 ProductVersionLS => 1 FileD

Re: ANN: PyDev 0.9.5 released

2005-06-29 Thread Fabio Zadrozny
Most things do work, but some still seem to have problems with version 3.1 (and thus it is still not officially supported - but should be, not long from now). Cheers, Fabio Dave Cook wrote: >On 2005-06-28, Fabio Zadrozny <[EMAIL PROTECTED]> wrote: > > > >>PyDev - Python IDE (Python Developm

Re: strange __call__

2005-06-29 Thread Rahul
Hi. well if you do dir(a) just after defining 'a' then it does show '__call__'. the reason i wanted to do it is that i wanted to see if theres a uniform way to wrap a function and callable objects so that for example i can get some message printed whenever a function or a function-like-object is c

Re: Python/IDLE - text in different colours

2005-06-29 Thread Bill Davy
OK, I (sort of) tried that. Used chr() to avoid issues of which editor and rant the following: import sys ESC = chr(27) DarkRed = ESC + "[31;2m" ResetColour = ESC + "[0m" print "Initial colour" sys.stdout.write(DarkRed) ; sys.stdout.flush() print "Is this dark red?" sys.stdout.write(ResetCo

Re: How to find Windows "Application data" directory??

2005-06-29 Thread Trent Mick
[Paul Rubin wrote] > "Rune Strand" <[EMAIL PROTECTED]> writes: > > You have the environment variable APPDATA. You can access it with > > os.environ(). > > Thanks!! Wow, I'd been hacking away at much messier approaches > than that. It's actually os.environ['APPDATA'] ;-) Note that the APPDAT

PIL question: keeping metadata

2005-06-29 Thread Ivan Herman
A question on using the PIL library. If I take a jpg file then, say, resize it and save it somewhere else, all metadata that is part of the jpg file is lost. This is a pity: digital cameras routinely add metainformation, so does, for example, Photoshop. Is there any way of keeping this info in P

Re: Boss wants me to program

2005-06-29 Thread phil
> About teaching in the exact sciences: I think we need a more hands-on > applied approach, to some extent this holds for the entire school > system. YES! As a geometry(& trig) teacher, I am going to have them build a shed, a kite, a sundial. I would love some doable ideas for hands on which woul

Re: Debugger Confusion

2005-06-29 Thread Rex Eastbourne
Also, when I try running pdb in my Emacs shell, I get very weird behavior: for instance, I'll hit 'h' and enter twenty times with no output. Then, all of a sudden, twenty output messages will pop up. -- http://mail.python.org/mailman/listinfo/python-list

Re: Debugger Confusion

2005-06-29 Thread Rex Eastbourne
One thing: is it possible to go through the code within emacs? Doing it on the command line is useful, but it would be very helpful if I could have a little marker within the emacs buffer that showed me where I am. Rex -- http://mail.python.org/mailman/listinfo/python-list

Re: Boss wants me to program

2005-06-29 Thread Adriaan Renting
The question was about someone with limited programming experience building simple easy to use programs on Windows. This is the niche where VB and Delphi realy shine. Python with TkInter is kind of o.k., I realy like Python+PyQt+Eric3+QtDesigner, but currently that only works with a commercial lice

Re: Which kid's beginners programming - Python or Forth?

2005-06-29 Thread Aahz
In article <[EMAIL PROTECTED]>, BORT <[EMAIL PROTECTED]> wrote: > >Gentle folk of comp.lang.python, I heartily thank you all for your >input. I think I'm taking the boys through the door marked "Logo." We >may be back this way, though. We will likely need MORE in the nebulous >future. I am impr

  1   2   >