Re: Abstract Methods & Abstract Class

2005-10-19 Thread Andreas Kostyrka
On Thu, Oct 20, 2005 at 12:05:05PM +0530, Iyer, Prasad C wrote: > > Do we have something like abstract methods & Abstract class. > > So that my class would just define the method. And the implementation > would be defined by somebody else. class AbstractBase: def method(self): raise

Re: How to extract a part of html file

2005-10-19 Thread Ben Finney
Joe <[EMAIL PROTECTED]> wrote: > I'm trying to extract part of html code from a tag to a tag For tag soup, use BeautifulSoup: http://www.crummy.com/software/BeautifulSoup/> Available as a package in Debian, probably other decent OSen also. -- \ "I think it would be a good idea."

Abstract Methods & Abstract Class

2005-10-19 Thread Iyer, Prasad C
Do we have something like abstract methods & Abstract class. So that my class would just define the method. And the implementation would be defined by somebody else. This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is inten

Re: Microsoft Hatred FAQ

2005-10-19 Thread David Schwartz
"Peter T. Breuer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > In comp.os.linux.misc David Schwartz <[EMAIL PROTECTED]> wrote: >> I guess I wasn't explicit enough. Most people who want cars also want >> an >> engine. Some don't. Dealers could sell cars and engines separate

Set an environment variable

2005-10-19 Thread Christian
Another question from a not even newbie: In Unix you can set an environment variable with the command export PYTHONPATH but I would like to set the variable from at .py script. So my question is: How do I export an environment variable in a .py script? Thanks Chris -- http://mail.python.

Expat - how to UseForeignDTD

2005-10-19 Thread B Mahoney
I have a simple Kid template document: http://www.w3.org/1999/xhtml"; xmlns:py="http://purl.org/kid/ns#"; > ... (snip) This runs as expected but now I would like to load a DTD without tampering with this xml file In the expat parser __init__ after setting other handlers for parser, I h

How to extract a part of html file

2005-10-19 Thread Joe
I'm trying to extract part of html code from a tag to a tag code begins with and ends with TD> http://whatever/some.gif";> I was thinking of using a regular expression however I having hard time getting the desired string. I use htmlSource = urllib.urlopen("http://address/";) s = htmlSource.

Re: Python vs Ruby

2005-10-19 Thread Bryan
Dave Cook wrote: > On 2005-10-20, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > >>Languages are very similar but Python has more cale avaliable. Much >>more. > > > Cale? You mean Python has more ruffage? > > Dave Cook i think you mean "kale" not "cale". nothing like a hot bowl of tofu k

Re: sqlstring -- a library to build a SELECT statement

2005-10-19 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > Jason Stitt wrote: > >>Using // for 'in' looks really weird, too. It's too bad you can't >>overload Python's 'in' operator. (Can you? It seems to be hard-coded >>to iterate through an iterable and look for the value, rather than >>calling a private method like some other

Re: sqlstring -- a library to build a SELECT statement

2005-10-19 Thread [EMAIL PROTECTED]
Jason Stitt wrote: > > I think some operator overloading, especially the obvious cases like > ==, is cleaner than using only functions because it lets you order > things normally. But some of the operator choices are non-intuitive. > Personally, I would make something like 'alias' a function or cl

Re: Python vs Ruby

2005-10-19 Thread Dave Cook
On 2005-10-20, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Languages are very similar but Python has more cale avaliable. Much > more. Cale? You mean Python has more ruffage? Dave Cook -- http://mail.python.org/mailman/listinfo/python-list

Re: Extention Module/ list of chars-> string

2005-10-19 Thread Tuvas
Thanks for the help, I actually ended up writing my own simple charlist2string function, I realized it was only about 4 lines of code, but, appreciate the help! -- http://mail.python.org/mailman/listinfo/python-list

Re: Extention Woes

2005-10-19 Thread Tuvas
Well, the point of declaring it as a char was to have it as an 8 bit integer, as is requested later on in the program. Anyways, I tried making the changes, similar results. The len value was always right, the problem seems to be in this com value. BTW, it doesn't give me one single warning, so I do

Re: Python vs Ruby

2005-10-19 Thread elbertlev
Languages are very similar but Python has more cale avaliable. Much more. -- http://mail.python.org/mailman/listinfo/python-list

Re: Extention Woes

2005-10-19 Thread Neal Norwitz
Tuvas wrote: > Forgot, var declartions > > int can_han; > int com; > char len; > char dat[8]; That should probably be: int len; char *dat; IIRC, "z" returns the internal string pointer. "#" is definitely not going to return a char. I'm pretty sure it r

How can I call a subclass method from parent class ?

2005-10-19 Thread [EMAIL PROTECTED]
Hi, Suppose my class definition is like this : class A: name = "A" @classmethod def foo(cls): cls.__super.foo() cls.bar() @classmethod def bar(cls): print cls.name class B(A): name = "B" class C(B): name = "C" What I want is C.foo() prints

Re: Trouble with win32com and MS Project

2005-10-19 Thread Felix Collins
Felix Collins wrote: > Hi, > > I'm trying to assign a resource to a task in MS Project by using the > example from MSDN for VB... > > > "Use the Add method to add an Assignment object to the Assignments > collection. The following example adds a resource identified by the > number of 212 as a

Re: Some more odd behaviour from the Regexp library

2005-10-19 Thread Mike Meyer
"David Veerasingam" <[EMAIL PROTECTED]> writes: > Can anyone explain why it won't give me my captured group? > > In [1]: a = 'exit: gkdfjgfjdfsgdjglkghdfgkd' > In [2]: import re > In [3]: b = re.search(r'exit: (.*?)', a) > In [4]: b.group(0) > Out[4]: 'exit: ' > > In [5]: b.group(1) > Out[5]: '' >

Re: Trouble with win32com and MS Project

2005-10-19 Thread Do Re Mi chel La Si Do
Hi ! The parameter (ResourceID=2) is problematic Try : proj.Tasks(3).Assignments.Add(2) @-salutations Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: destroy your self????

2005-10-19 Thread Mike Meyer
"KraftDiner" <[EMAIL PROTECTED]> writes: > Well I guess what I'm trying to achive is the invalidate the instance > of the object. > I have been using None to denote an invalide or uninitialized instance > of an object. > > There is a degenerate case in my code where a polygon has less than 3 > poi

Re: Some more odd behaviour from the Regexp library

2005-10-19 Thread Doug Schwarz
In article <[EMAIL PROTECTED]>, "David Veerasingam" <[EMAIL PROTECTED]> wrote: > Can anyone explain why it won't give me my captured group? > > In [1]: a = 'exit: gkdfjgfjdfsgdjglkghdfgkd' > In [2]: import re > In [3]: b = re.search(r'exit: (.*?)', a) > In [4]: b.group(0) > Out[4]: 'exit: ' > >

Re: destroy your self????

2005-10-19 Thread Ron Adam
KraftDiner wrote: > if I create an object like... > > obj = None > ... > obj = anObject() > > can obj set itself to none in some method of the class? > Do you mean like this? >>> def foo(): ... global foo ... del foo ... >>> foo() >>> foo Traceback (most recent call last): File "",

Re: Having trouble deleting objects from a list...

2005-10-19 Thread Mike Meyer
Jason Stitt <[EMAIL PROTECTED]> writes: > On Oct 19, 2005, at 8:16 PM, KraftDiner wrote: > 'for obj in self.objList' will keep right on iterating through the > list even if you don't increment i. And if you modify self.objList while you're iterating over it, the results are undefined. > A direct

Writing python SOAP client

2005-10-19 Thread Alvin A. Delagon
Hello python programmers! I would like to add myself to the ever increasing number of python users. Here's my first question. I've written two SOAP clients using PERL and a PHP. I tried to wirte a new SOAP client using python but I'm having problems. First, I can't seem to find a good documenta

Re: Python vs Ruby

2005-10-19 Thread jean-marc
As you see, pythonistas are a nice humourous bunch... But to help a bit more in your balancing act you might take a look at: http://blog.ianbicking.org/ruby-python-power.html It's rather nice, and commented. -- http://mail.python.org/mailman/listinfo/python-list

Re: destroy your self????

2005-10-19 Thread Dave Brueck
KraftDiner wrote: > Well I guess what I'm trying to achive is the invalidate the instance > of the object. > I have been using None to denote an invalide or uninitialized instance > of an object. > > There is a degenerate case in my code where a polygon has less than 3 > points and > I want to cla

Re: Python vs Ruby

2005-10-19 Thread Bryan
Amol Vaidya wrote: > Hi. I am interested in learning a new programming language, and have been > debating whether to learn Ruby or Python. How do these compare and contrast > with one another, and what advantages does one language provide over the > other? I would like to consider as many opinio

Re: destroy your self????

2005-10-19 Thread KraftDiner
Well I guess what I'm trying to achive is the invalidate the instance of the object. I have been using None to denote an invalide or uninitialized instance of an object. There is a degenerate case in my code where a polygon has less than 3 points and I want to class to flag this instance of the ob

Re: Extention Woes

2005-10-19 Thread Tuvas
Forgot, var declartions int can_han; int com; char len; char dat[8]; -- http://mail.python.org/mailman/listinfo/python-list

Some more odd behaviour from the Regexp library

2005-10-19 Thread David Veerasingam
Can anyone explain why it won't give me my captured group? In [1]: a = 'exit: gkdfjgfjdfsgdjglkghdfgkd' In [2]: import re In [3]: b = re.search(r'exit: (.*?)', a) In [4]: b.group(0) Out[4]: 'exit: ' In [5]: b.group(1) Out[5]: '' In [6]: b.group(2) IndexError: no such group -- http://mail.pytho

Re: sqlstring -- a library to build a SELECT statement

2005-10-19 Thread Jason Stitt
On Oct 19, 2005, at 9:18 PM, [EMAIL PROTECTED] wrote: > My solution is sqlstring. A single-purpose library: to create SQL > statement objects. These objects (such as sqlstring.Select), represent > complex SQL Statements, but as Python objects. First of all, I like this idea. I've been thinkin

Re: Python vs Ruby

2005-10-19 Thread Jason Stitt
On Oct 19, 2005, at 10:01 PM, Roy Smith wrote: > In article <[EMAIL PROTECTED]>, > "jean-marc" <[EMAIL PROTECTED]> wrote: > >> I'd believe that would be Lua, but then again what is common to one >> might not be to another ;-) >> > > Dang, you're right! Lua's got Ruby beat two-fold! And lack of

Re: Extention Woes

2005-10-19 Thread Tuvas
I tried Ctypes, but it was giving me tons of problems in the install phase, and so I decided it'd just be better to use an extention module. It's the type of stuff that could be perfectly done with ctypes, but... Oh well. Also, I've done all but this last little piece with extentions, might as well

Re: How to organize Python files in a (relatively) big project

2005-10-19 Thread Micah Elliott
On Oct 19, Jarek Zgoda wrote: > Micah Elliott napisał(a): > > >>How to install this structure eg. on Linux? What layout do you > >>recommend? It's tempting to use /opt hierarchy for installation > >>target (as it gives relatively much freedom within application > >>directory), but many administrat

Minimizing Connection reset by peer exceptions

2005-10-19 Thread mirandacascade
This may be more of a socket question than a python question; not sure. Using this code to instantiate/connect/set options connectionHandle = socket.socket(socket.AF_INET, socket.SOCK_STREAM) errorStatus = connectionHandle.connect_ex((ipAddress, port)) connectionHandle.setsockopt(socket.SOL_SOCKET

Re: Python vs Ruby

2005-10-19 Thread Roy Smith
In article <[EMAIL PROTECTED]>, "jean-marc" <[EMAIL PROTECTED]> wrote: > I'd believe that would be Lua, but then again what is common to one > might not be to another ;-) Dang, you're right! Lua's got Ruby beat two-fold! -- http://mail.python.org/mailman/listinfo/python-list

Re: destroy your self????

2005-10-19 Thread Dave Brueck
KraftDiner wrote: > if I create an object like... > > obj = None > ... > obj = anObject() > > can obj set itself to none in some method of the class? No - Python doesn't work that way. What are you trying to accomplish? There's probably a way to do what you need to do, but this isn't it. -Da

Re: Python vs Ruby

2005-10-19 Thread jean-marc
I'd believe that would be Lua, but then again what is common to one might not be to another ;-) -- http://mail.python.org/mailman/listinfo/python-list

destroy your self????

2005-10-19 Thread KraftDiner
if I create an object like... obj = None ... obj = anObject() can obj set itself to none in some method of the class? -- http://mail.python.org/mailman/listinfo/python-list

Trouble with win32com and MS Project

2005-10-19 Thread Felix Collins
Hi, I'm trying to assign a resource to a task in MS Project by using the example from MSDN for VB... "Use the Add method to add an Assignment object to the Assignments collection. The following example adds a resource identified by the number of 212 as a new assignment for the specified task.

Re: Python vs Ruby

2005-10-19 Thread Roy Smith
In article <[EMAIL PROTECTED]>, "Amol Vaidya" <[EMAIL PROTECTED]> wrote: > Hi. I am interested in learning a new programming language, and have been > debating whether to learn Ruby or Python. How do these compare and contrast > with one another, and what advantages does one language provide ov

Python vs Ruby

2005-10-19 Thread Amol Vaidya
Hi. I am interested in learning a new programming language, and have been debating whether to learn Ruby or Python. How do these compare and contrast with one another, and what advantages does one language provide over the other? I would like to consider as many opinions as I can on this matter

sqlstring -- a library to build a SELECT statement

2005-10-19 Thread [EMAIL PROTECTED]
After some thought on what I need in a Python ORM (multiple primary keys, complex joins, case statements etc.), and after having built these libraries for other un-named languages, I decided to start at the bottom. What seems to plague many ORM systems is the syntactic confusion and string-manipula

Message ("Your message dated Thu, 20 Oct 2005 11:18:37...")

2005-10-19 Thread University of Arkansas LISTSERV Server (14.4)
Your message dated Thu, 20 Oct 2005 11:18:37 +0900 with subject "Returned mail: see transcript for details" has been submitted to the moderator of the ICTLIST list: Cynthia Smith <[EMAIL PROTECTED]>. -- http://mail.python.org/mailman/listinfo/python-list

Re: Having trouble deleting objects from a list...

2005-10-19 Thread Jason Stitt
On Oct 19, 2005, at 8:16 PM, KraftDiner wrote: > I have a list, and within it, objects are marked for deletion. > However when I iterate through the list to remove objects > not all the marked objects are deleted.. > here is a code portion: > > i = 0 > for obj in self.objLis

Re: Upper/lowercase regex matching in unicode

2005-10-19 Thread George Sakkis
"Jason Stitt" <[EMAIL PROTECTED]> wrote: > What's the best way to match uppercase or lowercase characters with a > regular expression in a unicode-aware way? Obviously [A-Z] and [a-z] > aren't going to cut it. I thought there were character classes of the > form ::upper:: or similar syntax, but ca

Having trouble deleting objects from a list...

2005-10-19 Thread KraftDiner
I have a list, and within it, objects are marked for deletion. However when I iterate through the list to remove objects not all the marked objects are deleted.. here is a code portion: i = 0 for obj in self.objList: i

Re: Python variables are bound to types when used?

2005-10-19 Thread Aahz
In article <[EMAIL PROTECTED]>, Steven D'Aprano <[EMAIL PROTECTED]> wrote: >On Wed, 19 Oct 2005 20:06:53 +, Grant Edwards wrote: >> >> Python doesn't have variables. >> >> Python has objects of various types. You can bind 0 or more >> names an object. > >I frequently use "variable" as a syn

Re: multi-property groups?

2005-10-19 Thread Ron Adam
This is what I like about Python, there's almost always a way to do it. ;-) Here's an updated version that I think works, but it could use some review. Any way to make this better? Should grouped properties share references to objects? Cheers, Ron """ Grouped properties: This need pr

Re: what does 0 mean in MyApp(0)

2005-10-19 Thread James Stroud
>From Google: Results 1 - 10 of about 1,340,000,000 for 0. (0.09 seconds) James On Friday 30 September 2005 07:15, Alex wrote: > I'm looking at a tutorial with the code below > > from wxPython.wx import * > > class MyApp(wxApp): > def OnInit(self): > frame = wxFrame(NULL, -1, "winApp

Re: Vim IS a capable IDE [was Re: Vim capable IDE?]

2005-10-19 Thread François Pinard
[Chris Lasher] > Thanks for the replies, guys! I had no idea Vim was capable of doing > some of those things. One detail which should be more widely known, in my opinion, is the capability of Vim (if compiled properly) to use Python has an extension language. That is, you may add new Vim command

Re: Controlling exception handling of logging module

2005-10-19 Thread Vinay Sajip
sj wrote: > Thanks, but my point wasn't fixing the bug. I'd like the logging > module to raise an exception on this occasion (rather than print and > consume the error) so that I can find the bug easily. If those two > lines were part of 10,000-line code, I'd have to check all logging > statemen

Re: Python variables are bound to types when used?

2005-10-19 Thread Robert Kern
Steven D'Aprano wrote: > On Wed, 19 Oct 2005 20:06:53 +, Grant Edwards wrote: > >>>Now, in Python variables are bound to types when used, right? >> >>Python doesn't have variables. >> >>Python has objects of various types. You can bind 0 or more >>names an object. > > I frequently use "varia

Re: Python variables are bound to types when used?

2005-10-19 Thread Steven D'Aprano
On Wed, 19 Oct 2005 20:06:53 +, Grant Edwards wrote: >> Now, in Python variables are bound to types when used, right? > > Python doesn't have variables. > > Python has objects of various types. You can bind 0 or more > names an object. I frequently use "variable" as a synonym for "name" wh

Re: How to organize Python files in a (relatively) big project

2005-10-19 Thread Giovanni Bajo
Jarek Zgoda wrote: > How to install this structure eg. on Linux? What layout do you > recommend? It's tempting to use /opt hierarchy for installation target > (as it gives relatively much freedom within application directory), > but > many administrators are reluctant to use this hierarchy and pre

Re: Python variables are bound to types when used?

2005-10-19 Thread [EMAIL PROTECTED]
Fredrik Lundh wrote: > reset your brain: > > http://effbot.org/zone/python-objects.htm Neat link. Can you expand on this: > a type (returned by type(x)) ... > You cannot change the type. Especially what's going on here: >>> class a(object): ... pass ... >>> class b(a): ... pass ...

Re: Yes, this is a python question, and a serious one at that (moving to Win XP)

2005-10-19 Thread James Stroud
First, my apologies. You sound sincere. But, in my defense to jump to conclusions and comparisons: (1) You compared first: "Windows has so many annoyances that I can only compare it...Bay Area...OS X...Portland..." (2) "Unfortunate reasons" can not necessarily be interpreted a

Upper/lowercase regex matching in unicode

2005-10-19 Thread Jason Stitt
What's the best way to match uppercase or lowercase characters with a regular expression in a unicode-aware way? Obviously [A-Z] and [a-z] aren't going to cut it. I thought there were character classes of the form ::upper:: or similar syntax, but can't find them in the docs. Maybe I'm getti

possible bug in cherrypy.lib.autoreloader

2005-10-19 Thread infidel
I may have found the source of my infinite loop when importing kid modules from my cherrypy server. Here is some code from the autoreloader module of cherrypy: def reloader_thread(): mtimes = {} def fileattr(m): return getattr(m, "__file__", None) while RUN_RELOADER:

Re: Converting 2bit hex representation to integer ?

2005-10-19 Thread Leif K-Brooks
Madhusudan Singh wrote: > I am using binascii.b2a_hex to convert some binary data to hex. The > result is a two bit hex representation (i. e., without the leading > 0x). Surely you mean two-byte? > How do I convert the resulting two bit representation into an integer > ? int(foo, 16) -- http://

Re: infinite cherrypy autoreloader loop

2005-10-19 Thread infidel
Ok, the problem seems to be with my cherrypy importing Kid. If I import the kid module or any of my compiled kid template modules, then I get the autoreloader infinite loop. Is anyone else experiencing this effect? -- http://mail.python.org/mailman/listinfo/python-list

Re: Yes, this is a python question, and a serious one at that (moving to Win XP)

2005-10-19 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Try 4NT (http://www.jpsoft.com). It is like cmd on steroids. I've > been using it for years and it is the *only* thing that makes powerful > batch files possible on Windows. why bother with "powerful batch files" when you can use a real programming language ? --

Re: UI toolkits for Python

2005-10-19 Thread Kenneth McDonald
I'd have to agree with this. Unfortunately, the only way to use Swing (in a reasonable manner) from Python is to use Jython, and Jython has other shortcomings that make me not want to use it. Sigh. Ken On 19-Oct-05, at 9:59 AM, Ed Jensen wrote: > Claudio Grondi <[EMAIL PROTECTED]> wrote: > >>

connect to https unpossible. Please help.

2005-10-19 Thread Mark Delon
Hi, i want to log via python script to https page: 'https://brokerjet.ecetra.com/at/' # But it does not work. I am using following code(see below) Has somebody any ideas? How can I get to this https page? Need I to know some infos from "provider"(certificates, etc)? Thank u very much ! sincere

Re: Yes, this is a python question, and a serious one at that (moving to Win XP)

2005-10-19 Thread Kenneth McDonald
Perhaps you didn't read my original post? I'm being forced to consider Windowsfor reasons beyond my control. Given that I wanted a decent shell in Windows,I thought I would ask about Python shells because I think Python is a great language,and such a beast would give me the flexibility I want on a

Re: popen4

2005-10-19 Thread Ralf Muschall
Ganesan Rajagopal wrote: > Try pexpect instead. http://pexpect.sourceforce.net/ ^ That's a content-free ad site. You probably mean sourceforGe. Ralf -- http://mail.python.org/mailman/listinfo/python-list

Re: Sequence and/or pattern matching

2005-10-19 Thread Mike Meyer
"Séb" <[EMAIL PROTECTED]> writes: >> Essentially, if I understand correctly, you want to detect LOOPS given a >> sequence of directed connections A->B. "loop detection" and "graph" >> would then be the keywords to search for, in this case. > > Exactly, but the sequence has to be discovered by the

Re: UI toolkits for Python

2005-10-19 Thread Mike Meyer
[EMAIL PROTECTED] (Alex Martelli) writes: > Mike Meyer <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] (Alex Martelli) writes: >> > Mike Meyer <[EMAIL PROTECTED]> wrote: >> >> What surprises me is that marketing types will accept turning away - >> >> what's the current internet user base? 200 milli

Re: Python variables are bound to types when used?

2005-10-19 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, pranab_bajpai wrote: > So I want to define a method that takes a "boolean" in a module, eg. > > def getDBName(l2): > ... Is that a 12 or l2? > Now, in Python variables are bound to types when used, right? > > Eg. > x = 10 # makes it an INT > whereas > x = "hello" # make

Re: Tkinter or Python issue?

2005-10-19 Thread Russell E. Owen
In article <[EMAIL PROTECTED]>, "Eric Brunel" <[EMAIL PROTECTED]> wrote: >You should now see why it works here: your first tkFont.Font is remembered at >Python level in a variable. So it is not discarded once the tag_config is >over. So the second tkFont.Font is not allocated at the same locati

Re: Extention Woes

2005-10-19 Thread Dave Brueck
Tuvas wrote: > I am in the process of writing an extention module, and am coming up > with lots of problems. This isn't a direct answer to your question, but what sort of extension is it? Do you need to actually write a Python extension? I ask because I've all but stopped writing Python extensio

Re: Extention Woes

2005-10-19 Thread Fredrik Lundh
"Tuvas" wrote: > I am in the process of writing an extention module, and am coming up > with lots of problems. Perhaps someone could be of use. I keep getting > data that isn't what I'm sending the program. Let me give the line of C > code and Python Code and output to illistrate the problem. > >

multi-property groups?

2005-10-19 Thread Ron Adam
I was trying to see if I can implement property groups so I can set and pass arguemts as dictionaries. I think this will simplify interfacing to multiple objects and funtions that use a lot of keywords as arguments. But so far, the the following seems like it's not the most efficient way to

Extention Woes

2005-10-19 Thread Tuvas
I am in the process of writing an extention module, and am coming up with lots of problems. Perhaps someone could be of use. I keep getting data that isn't what I'm sending the program. Let me give the line of C code and Python Code and output to illistrate the problem. write_can(can_han,0x0140,'a

Re: Python Doc Error: os.makedirs

2005-10-19 Thread Thomas Bellman
I wrote: >try: > os.makedirs("/tmp/trh/spam/norwegian/blue/parrot/cheese") >except os.error, e: > if e.errno != errno.EEXIST: > raise Actually, when I think more about it, one would probably rather want something like: try: os.makedirs("/tmp/trh/spam/nor

Re: Python variables are bound to types when used?

2005-10-19 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > So I want to define a method that takes a "boolean" in a module, eg. > > def getDBName(l2): > ... > > Now, in Python variables are bound to types when used, right? > > Eg. > x = 10 # makes it an INT > whereas > x = "hello" # makes it a string You don't have it quite r

Re: Python variables are bound to types when used?

2005-10-19 Thread Grant Edwards
On 2005-10-19, Grant Edwards <[EMAIL PROTECTED]> wrote: >> So, if I use "l2" thus: >> >> if (l2): # only then does it make it a boolean? > > That doesn't affect the type of the object with the name "l2" > at all. It checks to see if l2 has a false value or not. > Examples of basic objects with fa

Re: Python variables are bound to types when used?

2005-10-19 Thread Grant Edwards
On 2005-10-19, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > So I want to define a method that takes a "boolean" in a module, eg. > > def getDBName(l2): > ... > > Now, in Python variables are bound to types when used, right? Python doesn't have variables. Python has objects of various types. Y

Re: Extention Module/ list of chars-> string

2005-10-19 Thread Fredrik Lundh
"Tuvas" wrote: > I am currently writing an extention module that needs to recieve a list > of characters that might vary in size from 0 to 8. This is written as a > list of characters rather than a string because it's easier to > manipulate. However, when I pass this list of characters into the >

Re: Python variables are bound to types when used?

2005-10-19 Thread Simon Brunning
On 19 Oct 2005 12:51:02 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > So I want to define a method that takes a "boolean" in a module, eg. > > def getDBName(l2): > ... > > Now, in Python variables are bound to types when used, right? Python doesn't really have variables as such. It has obj

Re: Python variables are bound to types when used?

2005-10-19 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > So I want to define a method that takes a "boolean" in a module, eg. > > def getDBName(l2): > ... > > Now, in Python variables are bound to types when used, right? no. variables are bound to objects, and objects have types. > Eg. > x = 10 # makes it an INT no. that

Re: How to organize Python files in a (relatively) big project

2005-10-19 Thread Jarek Zgoda
Micah Elliott napisał(a): >>How to install this structure eg. on Linux? What layout do you >>recommend? It's tempting to use /opt hierarchy for installation >>target (as it gives relatively much freedom within application >>directory), but many administrators are reluctant to use this >>hierarchy

Re: Yes, this is a python question, and a serious one at that (moving to Win XP)

2005-10-19 Thread Simon Brunning
On 19/10/05, James Stroud <[EMAIL PROTECTED]> wrote: > The OP is obviously a troll. Hey - let's not throw the T word around quite so freely. The OP did say that he was switching to Windows "for unfortunate reasons", and that OSX was "not as bad" as Windows. Besides, it is possible to prefer Windo

Re: Python Doc Error: os.makedirs

2005-10-19 Thread Thomas Bellman
"Xah Lee" <[EMAIL PROTECTED]> wrote: > The "Throws an error exception" should be "Throws an OSError > exception". Both are correct: >>> os.error is OSError True That is even documented in http://python.org/doc/lib/module-os.html: error This exception is raised when a functi

Python variables are bound to types when used?

2005-10-19 Thread pranab_bajpai
So I want to define a method that takes a "boolean" in a module, eg. def getDBName(l2): ... Now, in Python variables are bound to types when used, right? Eg. x = 10 # makes it an INT whereas x = "hello" # makes it a string I take it, the parameters to a function (in the above example "l2") are

infinite cherrypy autoreloader loop

2005-10-19 Thread infidel
I did an "svn update" of cherrypy this morning, and now when I try running a server, the log window just keeps reporting the autoreloader restarting over and over: 2005/10/19 12:42:33 HTTP INFO SystemExit raised: shutting down autoreloader 2005/10/19 12:42:33 HTTP INFO CherryPy shut down 2005/10/1

Re: How to organize Python files in a (relatively) big project

2005-10-19 Thread Micah Elliott
On Oct 19, Jarek Zgoda wrote: > How to install this structure eg. on Linux? What layout do you > recommend? It's tempting to use /opt hierarchy for installation > target (as it gives relatively much freedom within application > directory), but many administrators are reluctant to use this > hierarc

Re: Extention Module/ list of chars-> string

2005-10-19 Thread Martin v. Löwis
Tuvas wrote: > A. Change a list of chars to a single string or > B. Read a list of chars in an extention module Either is possible, but I recommend to do A: data = ''.join(data) Then pass the modified data to the extension module. Regards, Martin -- http://mail.python.org/mailman/listinfo/pyth

Re: Yes, this is a python question, and a serious one at that (moving to Win XP)

2005-10-19 Thread James Stroud
The OP is obviously a troll. Or he doesn't realize that you can use any shell in OSX as the user default. I used OSX for 4 years and had to go 100% Linux because of my employer. OSX is the best of Linux and Windows--anybody who can't see that has obviously not worked with these three types of op

Re: How to organize Python files in a (relatively) big project

2005-10-19 Thread Jarek Zgoda
Giovanni Bajo napisał(a): > Remember that the directory where you start the toplevel script is always > included in the sys.path. This means that you can have your structure like > this: > > main.py >| >| - - pkg1 >| - - pkg2 >| - - pkg3 > > Files in any package can import other

Re: Controlling exception handling of logging module

2005-10-19 Thread sj
Thanks, but my point wasn't fixing the bug. I'd like the logging module to raise an exception on this occasion (rather than print and consume the error) so that I can find the bug easily. If those two lines were part of 10,000-line code, I'd have to check all logging statements one-by-one. -- h

Extention Module/ list of chars-> string

2005-10-19 Thread Tuvas
I am currently writing an extention module that needs to recieve a list of characters that might vary in size from 0 to 8. This is written as a list of characters rather than a string because it's easier to manipulate. However, when I pass this list of characters into the extention module, it keeps

Re: Python Doc Error: os.makedirs

2005-10-19 Thread the_crazy88
if not os.path.isdir("your_dir_name"): makedirs("your_dir_name") -- http://mail.python.org/mailman/listinfo/python-list

Re: How to organize Python files in a (relatively) big project

2005-10-19 Thread The Eternal Squire
I, too have often come up against the inconvenience of creating libraries that I want to reuse but that do not want to incorporate into the Python library. I came up with this Python library addition to automagically add the directory of where a module resides that I want to import to the system

Re: Yes, this is a python question, and a serious one at that (moving to Win XP)

2005-10-19 Thread robinsiebler
Try 4NT (http://www.jpsoft.com). It is like cmd on steroids. I've been using it for years and it is the *only* thing that makes powerful batch files possible on Windows. It has a slew of features, including batch file debugging. -- http://mail.python.org/mailman/listinfo/python-list

Re: Controlling exception handling of logging module

2005-10-19 Thread [EMAIL PROTECTED]
make the second statement 'logging.info("%d %d", 1, 2)' or 'logging.info("%d %d %d", 1, 2, 3)', and all works. for every argument you want to log you need one format specifier -- http://mail.python.org/mailman/listinfo/python-list

Re: question about timestamp and MySQLdb

2005-10-19 Thread Micah Elliott
On Oct 19, Sean Berry wrote: > I am using MySQLdb to connect to a database and retrieve a timestamp > from a table. The problem is I want the timestamp as a long, > unformatted and all. > > In the table I have a timestamp like this > 20051019111617 > > But, when I retrieve the value and print it

Xul - Python

2005-10-19 Thread Salvatore
Hello, Nufox. You can give a try with Firefox or Mozilla on http://www.salvatore.exolia.net:9090/ Regards -- http://mail.python.org/mailman/listinfo/python-list

Re: question about timestamp and MySQLdb

2005-10-19 Thread Ron Garret
In article <[EMAIL PROTECTED]>, "Sean Berry" <[EMAIL PROTECTED]> wrote: > I am using MySQLdb to connect to a database and retrieve a timestamp from a > table. The problem is I want the timestamp as a long, unformatted and all. > > In the table I have a timestamp like this > 20051019111617 > >

Controlling exception handling of logging module

2005-10-19 Thread sj
Suppose the following are part of a long file and executed: logging.basicConfig(stream = sys.stderr, level=logging.INFO) logging.info("%d %d", 1, 2, 3)# buggy Python prints the traceback of the error as follows: Traceback (most recent call last): File ".../local

  1   2   >