Re: Tkinter or Python issue?

2005-10-19 Thread Eric Brunel
On Tue, 18 Oct 2005 22:30:33 -0400, Ron Provost <[EMAIL PROTECTED]> wrote: > Hello, > > I'm using python 2.4.2 on Win XP Pro. I'm trying to understand a behavior > I'm seeing in some Tkinter code I have. I've reduced my question to a small > piece of code: > > > #BEGIN CODE > ###

Re: Tkinter or Python issue?

2005-10-19 Thread Fredrik Lundh
Eugene Druker wrote: > tkFont.Font(...) is a class instance, while you need font description. Font instances are font descriptors. >>> f = tkFont.Font(family="ariel", size=24, weight=tkFont.BOLD) >>> f >>> print f font10726496 > t.tag.config( 'TBU', font=('times', 12, 'bold

Re: Microsoft Hatred FAQ

2005-10-19 Thread Alan Connor
On comp.os.linux.misc, in <[EMAIL PROTECTED]>, "Michael Heiming" wrote: This is your 7th post on this thread, Michael. You spend a lot of time griping about trolls. Maybe you should consider not feeding them, you stupid hypocrite. To all the shit-for-brains trolls that are polluting these group

Re: How to get a raised exception from other thread

2005-10-19 Thread Antoon Pardon
Op 2005-10-18, dcrespo schreef <[EMAIL PROTECTED]>: >> Before, after, or during the .start() call, or somewhere else? > > I'd like to catch *just after* the .start() call. > >> I'm quite sure the problem you are trying to solve can be solved, but >> you are still describing part of the solution you

Re: A little help with time calculations

2005-10-19 Thread Steve Holden
iminal wrote: > what i have so far is : > > # Get values needed to make time calculations > CT = input("input your chronometer time (ex. 07:21:46): ") > CE = input("input your chronometer correction (ex. 00:01:32): ") > CEfastslow = raw_input("is your chronometer correction fast or

Re: UI toolkits for Python

2005-10-19 Thread Paul Rubin
[EMAIL PROTECTED] (Alex Martelli) writes: > > You mean like google? Until recently, they're an outstanding example > > of doing things right, and providing functionality that degrades > > gracefully as the clients capabilities go down. > > I'm not sure what you mean by "until recently" in this con

Re: nested escape chars in a shell command

2005-10-19 Thread Juho Schultz
Eli Criffield wrote: > I'm try run an ssh command in pexpect and I'm having trouble getting > everything escaped to do what i want. > > Here's a striped down script showing what i want to do. > > -- > #!/usr/bin/env python > import pexpect > import sys > if len(sys.argv) < 3: > print "ssh

Re: write a loopin one line; process file paths

2005-10-19 Thread Xah Lee
[EMAIL PROTECTED] wrote: > it will be added in 2.5 I beleve. At the moment, you can: > > predicate and or Ah, i see. Here's the full code again: # -*- coding: utf-8 -*- # python import re, os.path imgPaths=[u'/Users/t/t4/oh/DSCN2059m-s.jpg', u'/Users/t/t4/oh/DSCN2062m-s.jpg', u'/Users/t/t4/o

Re: how to return correct value of update stmt

2005-10-19 Thread Steve Holden
[EMAIL PROTECTED] wrote: > hi > i use odbc to update a table in a database but i always get return > value of -1 > even though i tried to return an integer. the table is updated though > ... > sql = """ >update table >set column = 0 >where col = "%s"

Sequence and/or pattern matching

2005-10-19 Thread Séb
Hi everyone, I'm relatively new to python and I want to write a piece of code who do the following work for data mining purpose : 1) I have a list of connexion between some computers. This list has this format : Ip A Date Ip B ...... ... 192

Re: write a loopin one line; process file paths

2005-10-19 Thread [EMAIL PROTECTED]
Xah Lee wrote: > besides syntactical issues, another thing with doing functional > programing in imperative languages is that they become very inefficent. > Functional languages are optimized by various means of functional > programings styles. Doing them in imperative languages usually comes > wi

Re: Any 3state Check Tree Ctrl for wxPython available?

2005-10-19 Thread Franz Steinhaeusler
On Mon, 17 Oct 2005 12:14:47 +0200, "Petr Prikryl" <[EMAIL PROTECTED]> wrote: >Hi, > >I am experimenting with wxPython on Windows box. >What I need to implement is a check tree control >with 3 states for each checkbox: unchecked, checked, >gray checked. The status of the checkbox should reflect >

Re: Sequence and/or pattern matching

2005-10-19 Thread Alex Martelli
Séb <[EMAIL PROTECTED]> wrote: > Hi everyone, > > I'm relatively new to python and I want to write a piece of code who do > the following work for data mining purpose : Essentially, if I understand correctly, you want to detect LOOPS given a sequence of directed connections A->B. "loop detectio

"dynamical" importing

2005-10-19 Thread Joerg Schuster
Hello, I need to import modules from user defined paths. I.e. I want to do something like: module_dir = sys.argv[1] my_path = os.path.join(module_dir, 'bin', 'my_module') from my_path import my_object Obviously, it doesn't work this way. How would it work? Jörg Schuster -- http://mail.pytho

Re: UI toolkits for Python

2005-10-19 Thread Steve Holden
Alex Martelli wrote: > Mike Meyer <[EMAIL PROTECTED]> wrote: [... browser audience discussion ...] >>What makes you think that the expenditure of effort is "totally out of >>proportion"? In my experience, that isn't the case - at least if you >>go into it planning on doing things that way. Retrofit

Re: "dynamical" importing

2005-10-19 Thread Laurent Rahuel
Hi, I guess you need to look at __import__ Regards, Laurent. Joerg Schuster wrote: > Hello, > > I need to import modules from user defined paths. I.e. I want to do > something > like: > > module_dir = sys.argv[1] > > my_path = os.path.join(module_dir, 'bin', 'my_module') > > from my_path i

Re: Microsoft Hatred FAQ

2005-10-19 Thread Roedy Green
On Tue, 18 Oct 2005 23:16:32 -0700, "David Schwartz" <[EMAIL PROTECTED]> wrote or quoted : >No, I did not. I said that their obligation is to their shareholders. > >> If that is not what you mean, I think you need to hedge more. > >I was perfectly clear. This is a lot of deliberate misunde

Re: Microsoft Hatred FAQ

2005-10-19 Thread Roedy Green
On Tue, 18 Oct 2005 23:18:31 -0700, "David Schwartz" <[EMAIL PROTECTED]> wrote or quoted : >Perhaps you aren't following the thread, but I was talking about the >obligations a company has, not the obligations any individual has. And I was >talking about obligations *to* individuals. To me t

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

2005-10-19 Thread spinner
I have this problem myself, and as I am a recent Python convert my aproach may not be conventional - but as it is working for me I thought I would share. First off you need to split your code into logical objects. In my case I have an obvious client and server object, But within each I have indi

Re: Microsoft Hatred FAQ

2005-10-19 Thread Roedy Green
On Wed, 19 Oct 2005 07:10:55 GMT, Alan Connor <[EMAIL PROTECTED]> wrote or quoted : >To all the shit-for-brains trolls that are polluting these groups >with this crap, which I haven't even bothered to read: A single thread does not pollute a group. It is trivially easy to ignore a thread. If you

Re: UI toolkits for Python

2005-10-19 Thread Steve Holden
Claudio Grondi wrote: > "Steve Holden" <[EMAIL PROTECTED]> schrieb im Newsbeitrag > news:[EMAIL PROTECTED] > >>Claudio Grondi wrote: [...] >Do I miss here something? > While you are correct in saying (I paraphrase) that HTML interfaces nowadays can offer a rich graphical inter

Re: "dynamical" importing

2005-10-19 Thread Fredrik Lundh
Joerg Schuster wrote: > I need to import modules from user defined paths. I.e. I want to do > something like: > > module_dir = sys.argv[1] > > my_path = os.path.join(module_dir, 'bin', 'my_module') > > from my_path import my_object > > Obviously, it doesn't work this way. How would it work? some

Re: "dynamical" importing

2005-10-19 Thread John Abel
Try: userModule = _importModule( pathToModule ) def _importModule( moduleName ): modName = __import__ ( moduleName ) modComponents = moduleName.split( '.' ) for indivComp in modComponents[ 1: ]: modName = getattr( modName, indivComp ) return modName HTH, J Joerg Schust

Re: Microsoft Hatred FAQ

2005-10-19 Thread David Schwartz
"Luke Webber" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > As much as I hate to jump in on this thread, well I'm gonna... > I think you'll find that companies have all manner of legal obligations. > Certainly to their shareholders, but beyond that they have an obligation > to

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

2005-10-19 Thread Giovanni Bajo
TokiDoki wrote: > At first, I had all of my files in one single directory, but now, with > the increasing number of files, it is becoming hard to browse my > directory. So, I would want to be able to divide the files between 8 > directory, according to their purpose. The problem is that it breaks

Re: Microsoft Hatred FAQ

2005-10-19 Thread David Schwartz
"Roedy Green" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Tue, 18 Oct 2005 23:18:31 -0700, "David Schwartz" > <[EMAIL PROTECTED]> wrote or quoted : >>Perhaps you aren't following the thread, but I was talking about the >>obligations a company has, not the obligations an

Re: Sequence and/or pattern matching

2005-10-19 Thread Séb
> 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 piece of code ! > Does this "then" imp

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

2005-10-19 Thread Claudio Grondi
If I understand you right you need a concept in which you can put the files of your project where you want, i.e. restructure the nesting of directories storing your scripts without the problem of breaking the import statements. This will give you not a solution to any problem you maybe have with ma

Re: Sequence and/or pattern matching

2005-10-19 Thread Ben Sizer
Séb wrote: > 1) I have a list of connexion between some computers. This list has > this format : It looks like you want graph theory. > Ip A Date Ip B > ...... ... > 192.168.0.119.10.2005 192.168.0.2 > 192.168.0.319.10.2

Re: Microsoft Hatred FAQ

2005-10-19 Thread Jerzy Karczmarczuk
Roedy Green wrote: > On Wed, 19 Oct 2005 07:10:55 GMT, Alan Connor <[EMAIL PROTECTED]> > wrote or quoted : > > >>To all the shit-for-brains trolls that are polluting these groups >>with this crap, which I haven't even bothered to read: > > > A single thread does not pollute a group. It is trivi

Re: Upgrading 2.4.1 to 2.4.2

2005-10-19 Thread Ben Sizer
[EMAIL PROTECTED] wrote: > Not sure that is a good idea on a linux system. MS should be fine, but > I actually tried that on linux. Didn't realize how much on a linux > system depends on Python. I had that problem once, although to be fair it really does depend on which distribution you use as to

Re: Microsoft Hatred FAQ

2005-10-19 Thread John Bokma
Jerzy Karczmarczuk <[EMAIL PROTECTED]> wrote: [ this thread ] > The pollution *is* there, despite the possibility of individual > screening. The subject and the contents violates some basic nsgroup > principles, such as topicality. One to ten irrelevant postings do no > harm. More than hundred - b

Re: UI toolkits for Python

2005-10-19 Thread Claudio Grondi
> > Another possible scenario I have in mind is to control the Internet browser > > directly from a Python script using DHTML as a language for definition of > > appearance and specification of necessary data processing of in the browser > > displayed UI. This way the Internet browser and HTML with

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

2005-10-19 Thread Claudio Grondi
Maybe looking at the todays thread ["dynamical" importing] can be helpful also here. Claudio P.S. Below a copy of one of the responses: : Joerg Schuster wrote: > I need to import modules from user defined paths. I.e. I want to do > something like: > > module_dir = sys.argv[1] > > my_path = os.pa

Re: override a property

2005-10-19 Thread Robin Becker
Steven Bethard wrote: > Robin Becker wrote: > ... > > Can you add the object to be observed as another parameter to the add > method? > > py> class ObservableProperty(property): > ... def __init__(self, *args, **kwargs): .. > py> A.x.add(b, obs2) > py> b.x = 7 > obs2: 7 > > Probabl

Re: "dynamical" importing

2005-10-19 Thread Fredrik Lundh
John Abel wrote: > def _importModule( moduleName ): > modName = __import__ ( moduleName ) > modComponents = moduleName.split( '.' ) > for indivComp in modComponents[ 1: ]: > modName = getattr( modName, indivComp ) > >return modName __import__ takes a module name, not an ar

Re: Well written open source Python apps

2005-10-19 Thread Misto .
I suggest also these: Spark: - http://pages.cpsc.ucalgary.ca/~aycock/spark/ Few files. I like how doc strings are used for handling the grammar. Twisted: http://twistedmatrix.com/ I like everything, from test to comments! (many are funny) Misto -- http://mai

Re: write a loopin one line; process file paths

2005-10-19 Thread Xah Lee
Thanks a lot for various notes. Bonono? I will have to look at the itertools module. Just went to the doc http://www.python.org/doc/2.4.1/lib/module-itertools.html looks interesting. > But I believe Python is designed for easy to code and read and maintain > in mind. > One has to admit that with

Re: Microsoft Hatred FAQ

2005-10-19 Thread Antoon Pardon
Op 2005-10-19, David Schwartz schreef <[EMAIL PROTECTED]>: > > "Luke Webber" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >> As much as I hate to jump in on this thread, well I'm gonna... > >> I think you'll find that companies have all manner of legal obligations. >> Certainly

Re: html parser?

2005-10-19 Thread Laszlo Zsolt Nagy
Thorsten Kampe wrote: >* Christoph Söllner (2005-10-18 12:20 +0100) > > >>right, that's what I was looking for. Thanks very much. >> >> > >For simple things like that "BeautifulSoup" might be overkill. > >import formatter, \ > htmllib, \ > urllib > >url = 'http://python.org'

Re: Python Doc Error: os.makedirs

2005-10-19 Thread pclinch
if os.access( path, os.F_OK): print 'path exists' See also os.stat(path) for further info. about a file or dir. regards, Paul Clinch -- http://mail.python.org/mailman/listinfo/python-list

Re: Microsoft Hatred FAQ

2005-10-19 Thread Roedy Green
On Wed, 19 Oct 2005 01:54:14 -0700, "David Schwartz" <[EMAIL PROTECTED]> wrote or quoted : >They have obligations to their clients because (and only because) >failure to provide the services they contract to provide will result in >lawsuits and harm to the shareholders. All other obligations

Re: write a loopin one line; process file paths

2005-10-19 Thread [EMAIL PROTECTED]
Xah Lee wrote: > This i'm not sure. Of the past couple of years i increasingly developed > a theory (probably well-known among proper experts), that the > difficulty of human feats of various forms, are primarily a perception > and familiarity thing. This may be getting off topic, but i wrote an >

Re: Microsoft Hatred FAQ

2005-10-19 Thread Roedy Green
On 19 Oct 2005 09:41:09 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote or quoted : >As far as I understand you, the company should ship the faulty model. This is what they do. However, I find it odd people seriously suggesting that is the way society SHOULD run. -- Canadian Mind Products, Roedy G

Re: "dynamical" importing

2005-10-19 Thread John Abel
Fredrik Lundh wrote: >John Abel wrote: > > > >>def _importModule( moduleName ): >>modName = __import__ ( moduleName ) >>modComponents = moduleName.split( '.' ) >>for indivComp in modComponents[ 1: ]: >>modName = getattr( modName, indivComp ) >> >> return modName >> >> >

Re: Microsoft Hatred FAQ

2005-10-19 Thread David Schwartz
"Roedy Green" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Wed, 19 Oct 2005 01:54:14 -0700, "David Schwartz" > <[EMAIL PROTECTED]> wrote or quoted : >>They have obligations to their clients because (and only because) >>failure to provide the services they contract to pro

Re: Microsoft Hatred FAQ

2005-10-19 Thread David Schwartz
"Antoon Pardon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > A company figures out something is wrong with one of their new models. > They have two options. They can repair the problem or they can leave > it as is and brace the laswsuits that will likely follow. An analysis > sh

Re: "dynamical" importing

2005-10-19 Thread Joerg Schuster
Thanks a lot to all. -- http://mail.python.org/mailman/listinfo/python-list

problem running a python script using apache,mod_python on linux

2005-10-19 Thread neha
hi, i m trying to integrate python with apache on linux.For this i m using mod_python. I dont see any problem with the versions of python,apache and mod_python i m using. the versions i m using are apache version2. mod_python v3.1.14 python2.4 The problem is,when i m running my python script,after

Re: Microsoft Hatred FAQ

2005-10-19 Thread Antoon Pardon
Op 2005-10-19, David Schwartz schreef <[EMAIL PROTECTED]>: > > "Antoon Pardon" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >> A company figures out something is wrong with one of their new models. >> They have two options. They can repair the problem or they can leave >> it as

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

2005-10-19 Thread Chris Lasher
Thanks for the replies, guys! I had no idea Vim was capable of doing some of those things. The source browser in Vim is slick--I never would have known about that. As far as the GDB goes, it doesn't look like it has support for Python, but it's nice to know it's there for C if I get the chance to l

Re: A little help with time calculations

2005-10-19 Thread iminal
thanks -- http://mail.python.org/mailman/listinfo/python-list

path

2005-10-19 Thread Shi Mu
I have installed Python 2.3 and I type "help()" and then "Keywords". I get a list of words. And it says that I can enter any of the words to get more help. I enter "and" and I get the following error message: "Sorry, topic and keyword documentation is not available because the Python HTML document

path

2005-10-19 Thread Shi Mu
I have installed Python 2.3 and I type "help()" and then "Keywords". I get a list of words. And it says that I can enter any of the words to get more help. I enter "and" and I get the following error message: "Sorry, topic and keyword documentation is not available because the Python HTML document

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

2005-10-19 Thread toki doki
Hello again, Actually, I found a (pretty ugly) workaround to my problem: In every __init__.py of the subdirectories I created, I add the following lines: import os.path,sys for directory,sub_dir,files in os.walk(os.path.normpath(os.path.join(os.path.dirname(__file__),".."))):     sys.path.append(

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

2005-10-19 Thread Christopher Subich
Chris Lambacher wrote: > The shell that comes with MSys (from the MinGW guys). Is pretty good, although > it does have a bit of a problem with stdout output before a process exits, ie > it will hold back output until the process exits. > > As a bonus, the file system is a little more sane, and if

Re: Microsoft Hatred FAQ

2005-10-19 Thread Antoon Pardon
Op 2005-10-19, Roger Blake schreef <[EMAIL PROTECTED]>: > In article <[EMAIL PROTECTED]>, Antoon Pardon wrote: >> A company figures out something is wrong with one of their new models. >> They have two options. They can repair the problem or they can leave >> it as is and brace the laswsuits that w

Re: How to get a raised exception from other thread

2005-10-19 Thread dcrespo
> Now that may not be perfect, since I'm not familiar with the TCPServer() > call. I've sort of assumed it does something quickly and returns, or > raises an exception if the input is bad. If it doesn't actually return > if it starts successfully, you would need a little different approach. > Pro

ANN: Beginning Python (Practical Python 2.0)

2005-10-19 Thread Magnus Lie Hetland
I guess it has actually been out for a while -- I just haven't received my copies yet... Anyways: My book, "Beginning Python: From Novice to Professional" (Apress, 2005) is now out. It is an expanded and revised version of "Practical Python" (Apress, 2002). More information can be found at http:

Re: How to get a raised exception from other thread

2005-10-19 Thread dcrespo
Ok, sorry about the above question. I solved it adding this to the main thread: try: SrvrTCP = module.ThreadedTCPServer(ip,port) SrvrTCP.start() except Exception, description: MsgBox(self,"TCPServer Error:\n\n"+str(description),title="TCPServer",style=wx.OK | wx.ICON_ERROR) return

Re: [newbie]Is there a module for print object in a readable format?

2005-10-19 Thread Steven D'Aprano
On Wed, 19 Oct 2005 09:39:48 +0800, James Gan wrote: > Hi, Steven > > :) width parameter do the magic : > > >>> pprint.pprint([1,2,3,4,[0,1,2,[3,4]],5], width=1,indent=4) > [ 1, > 2, > 3, > 4, > [ 0, > 1, > 2, > [ 3, > 4]], >

Re: how to return correct value of update stmt

2005-10-19 Thread eight02645999
hi yes , the table is updated. Just feels "uncomfortable" with the return of -1. was also concerned that what if the actual table doesn't exist, will it return -1? anyway, i will go check it out .. thanks -- http://mail.python.org/mailman/listinfo/python-list

RE:

2005-10-19 Thread David Gutierrez
Hugo, Cual documento es el que leiste. David. From: hugo hernandez diaz <[EMAIL PROTECTED]> To: python-list@python.org Date: Tue, 18 Oct 2005 23:03:39 -0600 MIME-Version: 1.0 Received: from smtp-vbr3.xs4all.nl ([194.109.24.23]) by MC8-F32.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 1

Re: Dealing with Excel

2005-10-19 Thread Francois Lepoutre
Robert Hicks wrote: > I need to pull data out of Oracle and stuff it into an Excel > spreadsheet. What modules have you used to interface with Excel and > would you recommend it? > > Robert > http://sourceforge.net/projects/pyexcelerator/ http://sourceforge.net/projects/pyxlwriter/ We use the l

parser question

2005-10-19 Thread Daniel Sch
Hello *, I have one format with this structure A { x=1 y=3 B { z = "something here" } } C { } A { x=0 y=0 B { z = "other" } } are there parsers for this kind of structure? specially I am inter

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

2005-10-19 Thread Micah Elliott
On Oct 19, Chris Lasher wrote: > Where do you guys go to learn all the capabilities of Vim? Just > browsing through vim.org? Just type: :h to see extensive info from the "User Manual", "Reference Manual", and any plugins. The near-comprehensive doc list: http://vimdoc.sourceforge.net/ I don

Re: parser question

2005-10-19 Thread Daniel Sch
> pattern = re.compile(r"^\s*A\s*{.*}\s*", re.MULTILINE | re.DOTALL) correction pattern = re.compile(r"^\s*A\s*{.*?}\s*", re.MULTILINE | re.DOTALL) I forgot to make it non gready :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Dealing with Excel

2005-10-19 Thread Larry Bates
Using ODBC interface to Oracle Excel can do this without any external (Python) program. Just: 1) Create a ODBC DSN that interfaces with Oracle 2) In Excel do Data-Get External Data-New Database Query 3) Tell Excel what tables/columns/order/filtering you want You can even save the Database Query

Re: Is there a module for print object in a readable format?

2005-10-19 Thread dcrespo
Maybe you don't have an up to date python version. I'm using 2.4.2. I tried: import pprint pprint.pprint([1,2,3,4,[0,1,2,[3,4]],5], width=1,indent=4) [ 1, 2, 3, 4, [ 0, 1, 2, [ 3, 4]], 5] Works fine. -- http://mail.python.org/mailman

Re: UI toolkits for Python

2005-10-19 Thread Ed Jensen
Claudio Grondi <[EMAIL PROTECTED]> wrote: > I haven't seen any really platform-independent software yet and I don't > expect to see any in the future. > It is simply not possible to have one, even if much progress was done lately > in many areas in order to try to approach it as close as possible.

Re: [newbie]Is there a module for print object in a readable format?

2005-10-19 Thread Micah Elliott
On Oct 20, Steven D'Aprano wrote: > That's not what I get. What are you using? > > py> pprint.pprint([1,2,3,4,[0,1,2], 5], width=1, indent=4) > Traceback (most recent call last): > File "", line 1, in ? > TypeError: pprint() got an unexpected keyword argument 'width' I find it useful to have al

Re: path

2005-10-19 Thread pclinch
The python help function does not use python23.chm, which is a windows only help file. You must open it from a menu item or the desktop explorer. It does contain an entry for "and". Other platforms usually have documentation in html format, which is why you get a confusing error message. Regards

Re: parser question

2005-10-19 Thread Micah Elliott
On Oct 19, Daniel Sch�le wrote: > I have one format with this structure > > A { > x=1 > y=3 > B { > z = "something here" > } > } > > C { > } > > A { > x=0 > y=0 > B { > z = "other" > } > } > >

Re: UI toolkits for Python

2005-10-19 Thread Paul Boddie
Mark Roseman wrote: > What I'm suggesting is taking the effort you'd put to the 5%, and > applying that effort instead to making the 95% even better. If that > extra effort would affect conversion rates, it's a justifiable option. Yes, but isn't this where the 90/10 rule kicks in? In other words,

Re: UI toolkits for Python

2005-10-19 Thread Paul Boddie
Steve Holden wrote: [80/20 rule] > This is as much an economic decision as a marketing one, but a good engineer > knows instinctively that there is a desirable cut-off point beyond which > adding further functionality is a waste of engineering effort. But Mike Meyer's point was that the Web stan

Re: [newbie]Is there a module for print object in a readable format?

2005-10-19 Thread Kent Johnson
Micah Elliott wrote: > On Oct 20, Steven D'Aprano wrote: > >>That's not what I get. What are you using? >> >>py> pprint.pprint([1,2,3,4,[0,1,2], 5], width=1, indent=4) >>Traceback (most recent call last): >> File "", line 1, in ? >>TypeError: pprint() got an unexpected keyword argument 'width' >

Re: parser question

2005-10-19 Thread Kent Johnson
Micah Elliott wrote: > You might be able to tackle this easily enough with REs if your > structures don't nest arbitrarily. It's hard to tell if this deserves > a formal grammar based on the example. If it does, you could try PLY > (which I've had a pleasant experienc

Re: write a loopin one line; process file paths

2005-10-19 Thread Jeremy Jones
Xah Lee wrote: >Peter Hansen wrote: > > >>Xah Lee wrote: >> >> >>>If you think i have a point, ... >>> >>> >>You have neither that, nor a clue. >> >> > >Dear Peter Hansen, > >My messages speak themselfs. You and your cohorts's stamping of it does >not change its nature. And if this

ssl and timeout issue

2005-10-19 Thread Tarek Ziadé
Hello, I cannot manage to use socket timeouts with an imap ssl connector,and i badly *need* it :'( I have already mentionned it here: http://archives.free.net.ph/message/20050620.151244.e5390efe.en.html Does anyone have a solution ? (I thought of coding my own threaded timer over the ssl so

Converting 2bit hex representation to integer ?

2005-10-19 Thread Madhusudan Singh
Hi 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). How do I convert the resulting two bit representation into an integer ? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Converting 2bit hex representation to integer ?

2005-10-19 Thread Larry Bates
Can you give us an example. I don't know what two bit hex means (takes at least 4 bits to make a hex digit). Now I'm going to try to guess: If the data is binary then all you need to do is to use the struct.unpack module to convert to integer. Larry Bates Madhusudan Singh wrote: > Hi > > I am

Re: Python Doc Error: os.makedirs

2005-10-19 Thread Dr. Who
Xah Lee wrote: > i think the function shouldn't complain if dir already exists. How is a > programer to distinguish if the dir already exists, or if there's a > problem creating the dir? Of course it should thrown an exception because it was unable to do what it was asked: create a directory. Th

Re: problem running a python script using apache,mod_python on linux

2005-10-19 Thread Brad Teale
Neha, > I have made the required changes to the httpd.conf file > *** > LoadModule python_module /home/ngupta/Apache2/modules/mod_python.so Did you also add the line: AddModule mod_python.c > DocumentRoot "/home/ngupta/Apache2/htdocs" > > > AllowOverride FileInfo > > > *** > I m using a

Re: Converting 2bit hex representation to integer ?

2005-10-19 Thread Madhusudan Singh
Larry Bates wrote: > Can you give us an example. I don't know what two bit > hex means (takes at least 4 bits to make a hex digit). Like 64(base 16)=100. I am referring to 64 in the above. > > Now I'm going to try to guess: > > If the data is binary then all you need to do is to > use the str

Re: Converting 2bit hex representation to integer ?

2005-10-19 Thread Madhusudan Singh
Madhusudan Singh wrote: > Larry Bates wrote: > >> Can you give us an example. I don't know what two bit >> hex means (takes at least 4 bits to make a hex digit). > > Like 64(base 16)=100. > I am referring to 64 in the above. > >> >> Now I'm going to try to guess: >> >> If the data is binary

Re: html parser?

2005-10-19 Thread leonardr
To extract links without the overhead of Beautiful Soup, one option is to copy what Beautiful Soup does, and write a SGMLParser subclass that only looks at 'a' tags. In general I think writing SGMLParser subclasses is a big pain (which is why I wrote Beautiful Soup), but since you only care about o

Re: Converting 2bit hex representation to integer ?

2005-10-19 Thread Fredrik Lundh
Madhusudan Singh wrote: >> Can you give us an example. I don't know what two bit >> hex means (takes at least 4 bits to make a hex digit). > > Like 64(base 16)=100. > I am referring to 64 in the above. that's two digits, not two bits. >>> print int("64", 16) 100 >> Now I'm going to try

Re: Threads and socket.setdefaulttimeout

2005-10-19 Thread Russell Warren
Thanks for the detailed repsone... sorry for the lag in responding to it. After reading and further thought, the only reason I was using setdefaulttimeout in the first place (rather then using a direct settimeout on the socket) was because it seemed like the only way (and easy) of getting access t

Re: Threads and socket.setdefaulttimeout

2005-10-19 Thread Steve Holden
Russell Warren wrote: > Thanks for the detailed repsone... sorry for the lag in responding to > it. [discussion of problems with timeouts on threaded code's sockets] > > Not quite what I was after I don't think since potentially interfering > code needs to check the lock (via acquire) to avoid con

question about timestamp and MySQLdb

2005-10-19 Thread Sean Berry
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 I get 2005-10-19 11:16:17 I want the nume

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

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 > >

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 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

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: 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: 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: 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

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: 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

  1   2   >