module error for elementtree

2007-05-11 Thread saif . shakeel
#!/usr/bin/env python from elementtree import ElementTree as Element tree = et.parse("testxml.xml") for t in tree.getiterator("SERVICEPARAMETER"): if t.get("Semantics") == "localId": t.set("Semantics", "dataPackageID") tree.write("output.xml") Hi,

Re: High resolution sleep (Linux)

2007-05-11 Thread Laurent Pointal
John a écrit : > Anyways, what I need is high resolution sleep, not high resolution > timing. Installing a real time OS seems like overkill. IDEA Maybe try creating threading.Event and waiting for it with a timeout. -- http://mail.python.org/mailman/listinfo/python-list

Re: module error for elementtree

2007-05-11 Thread half . italian
On May 11, 12:05 am, [EMAIL PROTECTED] wrote: > #!/usr/bin/env python > > from elementtree import ElementTree as Element > tree = et.parse("testxml.xml") > > for t in tree.getiterator("SERVICEPARAMETER"): > if t.get("Semantics") == "localId": > t.set("Semantics", "dataPackag

Re: Change serial timeout per read

2007-05-11 Thread Hendrik van Rooyen
<[EMAIL PROTECTED]> wrote: > What I actually want to do is to respond immediately if the expected > string comes in, but not raise a timeout unless it takes longer than > the maximum time. So if the device I'm communicating with usually > responds in a second, but _can_ take up to 20 seconds,

Re: High resolution sleep (Linux)

2007-05-11 Thread Nick Craig-Wood
Bart <[EMAIL PROTECTED]> wrote: > What about C module with usleep,nanosleep? Unlikely to help! It is an linux OS limit that the minimum sleep time is 1/HZ. -- Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Re: how to refer to partial list, slice is too slow?

2007-05-11 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, 人言落日是天涯,望极天涯不见家 wrote: > I make a sample here for the more clearly explanation > > s = " . - this is a large string data - ..." > > def parser1(data) > # do some parser > ... > # pass the remainder to next parser > parser2(data[100:]) > > def

Re: Newbie question about string(passing by ref)

2007-05-11 Thread Duncan Booth
lazy <[EMAIL PROTECTED]> wrote: > I want to pass a string by reference. I understand that strings are > immutable, but Im not > going to change the string in the function, just to aviod the overhead > of copying(when pass-by-value) because the > strings are long and this function will be called ov

Re: Simple Tkinter Progress Bar

2007-05-11 Thread Stefan Sonnenberg-Carstens
On Fr, 11.05.2007, 08:42, Gurpreet Singh wrote: > Hi > > I am a newbie in Python > > I am creating a simple Tkinter based application. > I have written Tkinter GUI source code and the > programme logic in the same .py file. > > I am searching for a way to implement a simple > Progress bar for my ap

checking if hour is between two hours

2007-05-11 Thread Flyzone
Hi all, i'm again working on my script of parsing logfiles :) I putted a new function to disable the rule of error between a certain hours, cause i want to use it as a monitoring script that run every 5 minutes and to disable error in hours of maintenance. But i have some "problems" to check it. In

Re: 4 byte integer

2007-05-11 Thread Michael Bentley
On May 11, 2007, at 4:25 AM, Paul D Ainsworth wrote: > Greetings everyone. I'm a relative newcomer to python and I have a > technical > problem. > > I want to split a 32 bit / 4 byte unsigned integer into 4 separate > byte > variables according to the following logic: - > > bit numbers 0..7 b

Jessica Reveals all "Again"

2007-05-11 Thread wise . of . clean791
http://jessicasboobs.blogspot.com/ - Download snazzy jessica images (I bet you will find her naked) -- http://mail.python.org/mailman/listinfo/python-list

Re: Erlang style processes for Python

2007-05-11 Thread Michael
Jacob Lee wrote: > Funny enough, I'm working on a project right now that is designed for > exactly that: PARLEY, http://osl.cs.uiuc.edu/parley . Have you seen Kamaelia? Some people have noted that Kamaelia seems to have a number of similarities to Erlang's model, which seems to come from a common

Re: searching algorithm

2007-05-11 Thread Michael Bentley
On May 10, 2007, at 12:26 PM, Gigs_ wrote: > Hi all! > > I have text file (english-croatian dictionary) with words in it in > alphabetical > order. > This file contains 17 words in this format: > english word: croatian word > > I want to make instant search for my gui > Instant search, i me

4 byte integer

2007-05-11 Thread Paul D Ainsworth
Greetings everyone. I'm a relative newcomer to python and I have a technical problem. I want to split a 32 bit / 4 byte unsigned integer into 4 separate byte variables according to the following logic: - bit numbers 0..7 byte 1 bit numbers 8..15 byte 2 bit numbers 16..23 byte 3 bit numbers 24..

Re: searching algorithm

2007-05-11 Thread Michael Bentley
> > Call me dense, but how does one do this in Python - which doesn't have > pointers? Dictionaries with dictionaries within dictionaries... (with > each letter as the key and the its children as values) is going to be > extremely space inefficient, right? Isn't *everything* in python essentially

Re: newb: Python Module and Class Scope

2007-05-11 Thread Dave Baum
In article <[EMAIL PROTECTED]>, johnny <[EMAIL PROTECTED]> wrote: > Can a class inside a module, access a method, outside of class, but > inside of the module? > > Eg. Can instance of class a access main, if so how? What is the > scope of "def main()" interms of class A? > > myModule: > > cl

Re: 4 byte integer

2007-05-11 Thread Paul D Ainsworth
> > Have a look at http://aspn.activestate.com/ASPN/Cookbook/Python/ > Recipe/113799 Brilliant - thank you :) -- http://mail.python.org/mailman/listinfo/python-list

Re: newb: Python Module and Class Scope

2007-05-11 Thread Duncan Booth
Dave Baum <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > johnny <[EMAIL PROTECTED]> wrote: > >> scope of "def main()" interms of class A? >> >> myModule: >> >> class A: >>main() >> >> def main(): >> > > Yes, class A can access main. The name "main" will be defined at th

Custom Software Development

2007-05-11 Thread VB
iTechArt Group - Custom Software Development and Offshore outsourcing Company http://www.itechart.com/ Offshore custom software development company iTechArt - Web site and Content Management Solutions development, CMS consulting: Ektron, Drupal and DotNetNuke iTechArt Group provides high quality

Re: module error for elementtree

2007-05-11 Thread Stefan Behnel
[EMAIL PROTECTED] wrote: > On May 11, 12:22 pm, [EMAIL PROTECTED] wrote: >> On May 11, 12:05 am, [EMAIL PROTECTED] wrote: >> >> >> >> >> >>> #!/usr/bin/env python >>> from elementtree import ElementTree as Element >>> tree = et.parse("testxml.xml") >>> for t in tree.getiterator("SERVICEPARAMETER"):

Re: module error for elementtree

2007-05-11 Thread saif . shakeel
On May 11, 12:22 pm, [EMAIL PROTECTED] wrote: > On May 11, 12:05 am, [EMAIL PROTECTED] wrote: > > > > > > > #!/usr/bin/env python > > > from elementtree import ElementTree as Element > > tree = et.parse("testxml.xml") > > > for t in tree.getiterator("SERVICEPARAMETER"): > > if t.get("Semant

vim e autoindentazione commenti

2007-05-11 Thread Alan Franzoni
Ciao a tutti, alla fine dopo le mille dispute emacs vs vim mi sono messo a provarli entrambi... e mi pare ora di essere diventato un vimmaro (pur se molto 'custom' in quanto lo sto rendendo un bel po' + simile a cream). Una domanda stupida. Forse è più da comp.editors. Come faccio a far sì che vim

Re: How to tell whetehr Python script called as CGI or from command line?

2007-05-11 Thread rowan
> import os > if "QUERY_STRING" in os.environ: > # CGI script > > might work. Thanks Steve for this suggestion. I did something similar: import os req = os.getenv('REQUEST_URI') if (not req is None) and len(req) > 0: web = True which seemed to work for me. Rowan -- htt

Re: Jython 2.2 Beta2 is available

2007-05-11 Thread Aahz
In article <[EMAIL PROTECTED]>, Charlie Groves wrote: > >I'm happy to announce that Jython 2.2-beta2 is available for download: >http://sourceforge.net/project/showfiles.php?group_id=12867&package_id=12218&release_id=507592 >See http://jython.org/Project/installation.html for installation instruct

RE: Python and Decimal integers from DB

2007-05-11 Thread Sampson, David
Here is the solution, for the record. import pyodbc conn = pyodbc.connect("DSN=NAPL;UID=NAPL_VIEW;PWD=NAPVIEW") curs = conn.cursor() roll_num = 'A27255' Cols = 'TO_CHAR(X_NO) as X_NO' Table = 'photos' Select = 'Select ' + Cols + ' from ' + Table + ' where roll_number = '

Re: searching algorithm

2007-05-11 Thread Neil Cerutti
On 2007-05-11, ciju <[EMAIL PROTECTED]> wrote: > By the way, both data structures could be implemented as tuple > in python, for I suppose, if only lookup is needed tuple gives > better performance than list. I used a list instead of a tuple where I thought a list would be convenient while buildin

software testing articles

2007-05-11 Thread [EMAIL PROTECTED]
Have you ever been interested in software testing? Giving you an in depth analysis/knowledge on software testing!! http://www.top-itarticles.com/softtest/main.asp -- http://mail.python.org/mailman/listinfo/python-list

Re: module error for elementtree

2007-05-11 Thread Jerry Hill
On 11 May 2007 00:05:19 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > For the above code to work elementtree is > imported in first line ,but when running it says : > ImportError: No module named elementtree.ElementTree > Does thie module exists as default or a patch is

Re: vim e autoindentazione commenti

2007-05-11 Thread Neil Cerutti
On 2007-05-11, Alan Franzoni <[EMAIL PROTECTED]> wrote: > Al contrario con altri tipi di file (es. Java) questa aggiunta > è automatica e la trovo molto, molto comoda. > > Dovrei andae a intaccare il file di indentazione? o quello di > sintassi? Colto prego nel manuale Vim: :help format-comments

Re: setting extra data to a wx.textctrl

2007-05-11 Thread kyosohma
On May 10, 10:51 pm, Pom <[EMAIL PROTECTED]> wrote: > Hello group! > > I have an application which uses a lot of mysql data fields, all the > same data type (floats). > > I created a panel which executes a "SELECT * FROM tablename" and makes > as much fields as needed, using de cursor.description a

Re: append

2007-05-11 Thread vdicarlo
> > the reference material. I want to know about list >> operations such as > > append. I've been struggling myself to assemble and learn just the right combination of quick references. Here is some of what I've found. For a quick search for the syntax and a simple example of a particular method

Dyla'07: 3rd Workshop on Dynamic Languages and Applications

2007-05-11 Thread Alexandre Bergel
Dear colleague, Please, note that after the workshop, best papers will be selected, and a second deadline will then be set regarding preparation of the Electronic Communications of the EASST. Note that we submission deadline has been extended. The important dates: - May 27: deadlin

Re: searching algorithm

2007-05-11 Thread Alex Martelli
Michael Bentley <[EMAIL PROTECTED]> wrote: > > > > Call me dense, but how does one do this in Python - which doesn't have > > pointers? Dictionaries with dictionaries within dictionaries... (with > > each letter as the key and the its children as values) is going to be > > extremely space ineffici

Re: Towards faster Python implementations - theory

2007-05-11 Thread sturlamolden
On May 10, 4:02 pm, Tim Golden <[EMAIL PROTECTED]> wrote: > But the relevant bit of your last paragraph is at the start: > "We should...". Sorry, bad choice of words. > see it faster. That's great. But unless people > puts their money where their mouths are, I don't I know, I know. But that doe

Re: Newbie look at Python and OO

2007-05-11 Thread Grant Edwards
On 2007-05-10, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Thu, 10 May 2007 18:21:42 -0300, <[EMAIL PROTECTED]> escribió: > >> These conversations are funny to me. I use Python every day and I >> have never actually thought about the implications of binding objects >> to names, or two names

Re: software testing articles

2007-05-11 Thread Andrew Koenig
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Have you ever been interested in software testing? Giving you an in > depth analysis/knowledge on software testing!! Looking around the site at random, I saw no "in depth analysis/knowledge" of anything. -- http://mail.python.org/

Re: Towards faster Python implementations - theory

2007-05-11 Thread sturlamolden
On May 10, 7:18 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > Unfortunately, native machine code depends on the machine, or at least the > machine being emulated by the hardware. Fortunately or not, the dominance > of the x386 model makes this less of a problem. CMUCL and SBCL depends on the do

Re: change of random state when pyc created??

2007-05-11 Thread Alan Isaac
This is an attempt to synthesize Bill and Carsten's proposals. http://docs.python.org/lib/typesmapping.html: for footnote (3) Keys and values are listed in an arbitrary order. This order is indeterminate and generally depends on factors outside the scope of the containing

Better way to isolate string

2007-05-11 Thread HMS Surprise
Greetings. Given the string s below and using only python built-in capabilities, I am trying to isolate the substring G132153. This string may have any number of digits but the pieces around it will not change. I have accomplished this with split but there must be a more elegant and compact way t

Re: Newbie look at Python and OO

2007-05-11 Thread Duncan Booth
Grant Edwards <[EMAIL PROTECTED]> wrote: > http://www.ariel.com.au/jokes/An_Interview_with_Bjarne_Stroustrup.html > > Maybe BS thought he was joking, but IMO, it's true. > > "Stroustrup: Remember the length of the average-sized 'C' >project? About 6 months. Not nearly long enough for a guy

Re: Better way to isolate string

2007-05-11 Thread Tim Golden
HMS Surprise wrote: > I suppose a one liner would look better, but I am alway leery of these > things 'breaking'. > > t = s.split('">')[-1].split('<')[0] > s ='G132153' Only if you're competing in an obscurity competition ;) If you're really confined to built-ins (ie you can't import a single mo

PyGTK : a NEW simple way to code an app

2007-05-11 Thread manatlan
I was a fan of "SimpleGladeApp/tepache way" to build a pygtk app. I've build a new efficient/dynamic way to build a pygtk app ... Here is an example : = class Fen(GladeApp): """ Window win .title="Hello" @delete_event

Re: vim e autoindentazione commenti

2007-05-11 Thread Alan Franzoni
Il Fri, 11 May 2007 13:15:01 GMT, Neil Cerutti ha scritto: >:help format-comments > > (Spiacente per la mia scrittura difettosa. Sto utilizzando il > traduttore di altavista.) Really sorry ^_^ I thought I was posting in it.comp.lang.python Thank you BTW! -- Alan Franzoni <[EMAIL PROTECTED]>

Re: Newbie look at Python and OO

2007-05-11 Thread Grant Edwards
On 2007-05-11, Duncan Booth <[EMAIL PROTECTED]> wrote: > Grant Edwards <[EMAIL PROTECTED]> wrote: > >> http://www.ariel.com.au/jokes/An_Interview_with_Bjarne_Stroustrup.html >> >> Maybe BS thought he was joking, but IMO, it's true. >> >> "Stroustrup: Remember the length of the average-sized 'C'

Re: Simple Python REGEX Question

2007-05-11 Thread Gary Herron
johnny wrote: > I need to get the content inside the bracket. > > eg. some characters before bracket (3.12345). > > I need to get whatever inside the (), in this case 3.12345. > > How do you do this with python regular expression? > >>> import re >>> x = re.search("[0-9.]+", "(3.12345)") >>> pr

Re: Towards faster Python implementations - theory

2007-05-11 Thread John Nagle
Tim Golden wrote: > sturlamolden wrote: > >> On May 8, 5:53 pm, John Nagle <[EMAIL PROTECTED]> wrote: >> >>> The point here is that we don't need language changes or >>> declarations >>> to make Python much faster. All we need are a few restrictions that >>> insure that, when you're doing so

Re: Better way to isolate string

2007-05-11 Thread HMS Surprise
I suppose a one liner would look better, but I am alway leery of these things 'breaking'. t = s.split('">')[-1].split('<')[0] s ='G132153' jh -- http://mail.python.org/mailman/listinfo/python-list

Simple Python REGEX Question

2007-05-11 Thread johnny
I need to get the content inside the bracket. eg. some characters before bracket (3.12345). I need to get whatever inside the (), in this case 3.12345. How do you do this with python regular expression? -- http://mail.python.org/mailman/listinfo/python-list

Re: path stuff

2007-05-11 Thread fscked
On May 10, 6:08 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 10 May 2007 19:04:30 -0300, fscked <[EMAIL PROTECTED]> > escribió: > > > > > > > ok, I lied, it is still doing the archived folders. Here is the code: > > > import os, sys > > from path import path > > > myfile = open("b

Re: Better way to isolate string

2007-05-11 Thread HMS Surprise
On May 11, 10:45 am, Tim Golden <[EMAIL PROTECTED]> wrote: > HMS Surprise wrote: > > I suppose a one liner would look better, but I am alway leery of these > > things 'breaking'. > > > t = s.split('">')[-1].split('<')[0] > > s ='G132153' > > Only if you're competing in an obscurity competition ;) >

Re: Towards faster Python implementations - theory

2007-05-11 Thread Paul Boddie
On 11 May, 18:04, John Nagle <[EMAIL PROTECTED]> wrote: > > Another problem is that if the language is defined as > "whatever gets put in CPython", that discourages other > implementations. The language needs to be standards-based. Indeed. This was suggested by one of the speakers at last ye

Re: software testing articles

2007-05-11 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Have you ever been interested in software testing? Giving you an in | depth analysis/knowledge on software testing!! Random non-Python IT topics are spam. Please desist. [Link to page with 75% ads deleted] -- http://mail.python.o

Re: File modes

2007-05-11 Thread HMS Surprise
On May 10, 7:11 pm, Jon Pentland <[EMAIL PROTECTED]> wrote: > I don't really see the use for being able to do that. Have you tried > Well, I think I found a reason and it probably happens quite a bit. I open the file and read it into a list. I pop some elements from the list for processing and th

File writing success

2007-05-11 Thread HMS Surprise
If file writing has no return value (http://docs.python.org/lib/bltin- file-objects.html), how do you know if the write was successful? Should one assume that if the open was successful then write are also? Thanks, jvh -- http://mail.python.org/mailman/listinfo/python-list

A newbie question about FileDialog in wxPython

2007-05-11 Thread OhKyu Yoon
Hi! I am opening files using the wx.FileDialog in wxPython. I want to modify the FileDialog such that some information about a highlighted file is displayed before I decide to open the file. This is what I tried: class ModifiedFileDialog(wx.FileDialog): def __init__(self,parent,message,wildca

Re: Towards faster Python implementations - theory

2007-05-11 Thread Terry Reedy
"sturlamolden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | On May 10, 4:02 pm, Tim Golden <[EMAIL PROTECTED]> wrote: | I know, I know. But that doesn't stop me from envying what the Lisp | community has achieved. But do not let your envy stop you from noticing and appreciating

Re: File writing success

2007-05-11 Thread Jason
On May 11, 12:21 pm, HMS Surprise <[EMAIL PROTECTED]> wrote: > If file writing has no return value (http://docs.python.org/lib/bltin- > file-objects.html), how do you know if the write was successful? > Should one assume that if the open was successful then write are also? > > Thanks, > > jvh In P

Re: File writing success

2007-05-11 Thread Jon Ribbens
On 2007-05-11, HMS Surprise <[EMAIL PROTECTED]> wrote: > If file writing has no return value (http://docs.python.org/lib/bltin- > file-objects.html), how do you know if the write was successful? Because no exception was thrown? Although bear in mind that some errors might not become apparent unti

Interesting list Validity (True/False)

2007-05-11 Thread nufuhsus
Hello all, First let me appologise if this has been answered but I could not find an acurate answer to this interesting problem. If the following is true: C:\Python25\rg.py>python Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "c

stealth screen scraping with python?

2007-05-11 Thread different . engine
Folks: I am screen scraping a large volume of data from Yahoo Finance each evening, and parsing with Beautiful Soup. I was wondering if anyone could give me some pointers on how to make it less obvious to Yahoo that this is what I am doing, as I fear that they probably monitor for this type of ac

Re: stealth screen scraping with python?

2007-05-11 Thread Dotan Cohen
On 11 May 2007 12:32:55 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Folks: > > I am screen scraping a large volume of data from Yahoo Finance each > evening, and parsing with Beautiful Soup. > > I was wondering if anyone could give me some pointers on how to make > it less obvious to Yaho

Re: File writing success

2007-05-11 Thread Facundo Batista
HMS Surprise wrote: > If file writing has no return value (http://docs.python.org/lib/bltin- > file-objects.html), how do you know if the write was successful? If not, you'll get an error raised. Regards, -- . Facundo . Blog: http://www.taniquetil.com.ar/plog/ PyAr: http://www.python.org/ar/

Re: stealth screen scraping with python?

2007-05-11 Thread kyosohma
On May 11, 2:32 pm, [EMAIL PROTECTED] wrote: > Folks: > > I am screen scraping a large volume of data from Yahoo Finance each > evening, and parsing with Beautiful Soup. > > I was wondering if anyone could give me some pointers on how to make > it less obvious to Yahoo that this is what I am doing,

Re: Interesting list Validity (True/False)

2007-05-11 Thread Grant Edwards
On 2007-05-11, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Then why do I get the following results: > C:\Python25\rg.py>help.py -o > print arg ['-o'] > type(arg): > arg is True? False > help.py version 1.0 Copyright RDEG (c) 2007 > ['-o'] is an unrecognized opti

test

2007-05-11 Thread Joe Eagar
sorry just a test. Joe -- http://mail.python.org/mailman/listinfo/python-list

Re: Interesting list Validity (True/False)

2007-05-11 Thread [EMAIL PROTECTED]
On May 11, 2:28 pm, [EMAIL PROTECTED] wrote: > Hello all, > > First let me appologise if this has been answered but I could not find > an acurate answer to this interesting problem. > > If the following is true: > C:\Python25\rg.py>python > Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [

Re: test

2007-05-11 Thread Sherm Pendley
Joe Eagar <[EMAIL PROTECTED]> writes: > sorry just a test. Sorry, you failed. You missed alt.test by a mile. sherm-- -- Web Hosting by West Virginians, for West Virginians: http://wv-www.net Cocoa programming in Perl: http://camelbones.sourceforge.net -- http://mail.python.org/mailman/listinf

Re: Interesting list Validity (True/False)

2007-05-11 Thread Grant Edwards
On Fri, May 11, 2007 at 01:20:44PM -0700, [EMAIL PROTECTED] wrote: > On May 11, 3:55 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: > > You got those results because that's what your program does. > > > > Were you intending it to do something else? If so, you're > > going to have to explain what you

Re: Interesting list Validity (True/False)

2007-05-11 Thread nufuhsus
On May 11, 2:28 pm, [EMAIL PROTECTED] wrote: > > > > > > > Hello all, > > > First let me appologise if this has been answered but I could not find > > an acurate answer to this interesting problem. > > > If the following is true: > > C:\Python25\rg.py>python > > Python 2.5.1 (r251:54863, A

Path python versions and Macosx

2007-05-11 Thread andrea
Hi everyone, I use python on macosx with textmate as editor (great program). I also use macport to install unix programs from the command line and I find it great too. Well I would like to have all my modules in the path when I'm using textmate AND when I use the commandline (ipython), but because

name capitalization of built-in types, True, and False

2007-05-11 Thread cbtube03
I see that naming conventions are such that classes usually get named CamelCase. So why are the built-in types named all lowercase (like list, dict, set, bool, etc.)? And names for instances of classes are usually written in lowercase, like foo in ``foo = CamelCase()``. So why are True and False (

Time

2007-05-11 Thread HMS Surprise
I need to convert the string below into epoch seconds so that I can perform substractions and additions. I assume I will need to break it up into a time_t struct and use mktime. Two questions if you will please: Is there a way to use multiple separator characters for split similar to awk's [|] st

Re: Time

2007-05-11 Thread HMS Surprise
> > Could you point to an example of a python time_t struct? > Or maybe that should be a tm struct??? -- http://mail.python.org/mailman/listinfo/python-list

Re: Simulating simple electric circuits

2007-05-11 Thread Bjoern Schliessmann
Dave Baum wrote: > Sounds reasonable. Depending on the size of your network, I might > not worry too much about precomputing and saving information. Thanks. Yes, I'm actually testing it presently without any optimizations and it runs very well. > If your circuit has loops in it (where the ou

Re: Interesting list Validity (True/False)

2007-05-11 Thread Carsten Haese
On Fri, 2007-05-11 at 12:28 -0700, [EMAIL PROTECTED] wrote: > Hello all, > > First let me appologise if this has been answered but I could not find > an acurate answer to this interesting problem. > > If the following is true: > C:\Python25\rg.py>python > Python 2.5.1 (r251:54863, Apr 18

Problems with grid() layout under tkinter

2007-05-11 Thread Thomas Jansson
Dear all I am trying to make a small wrapper program for textbased program and it is going well but I have one problem. Namely that I simply do not understand how this grid thing work. I have assigned every widget a specific placement in a grid but when I am running the program it looks very stran

Re: Interesting list Validity (True/False)

2007-05-11 Thread nufuhsus
On May 11, 4:32 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: > On Fri, May 11, 2007 at 01:20:44PM -0700, [EMAIL PROTECTED] > wrote: > > > On May 11, 3:55 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: > > > You got those results because that's what your program does. > > > > Were you intending it to

Re: Interesting list Validity (True/False)

2007-05-11 Thread Carsten Haese
On Fri, 2007-05-11 at 14:07 -0700, [EMAIL PROTECTED] wrote: > OK. Then how would you differenciate between a call with an option > versus one without (e.g. help.py -o (where arg == ['-o']) Vs. help.py > (where arg == []))? if arg: print "With options" else: print "Without options" -- Carsten

Re: Interesting list Validity (True/False)

2007-05-11 Thread nufuhsus
On May 11, 5:07 pm, Carsten Haese <[EMAIL PROTECTED]> wrote: > On Fri, 2007-05-11 at 12:28 -0700, [EMAIL PROTECTED] wrote: > > Hello all, > > > First let me appologise if this has been answered but I could not find > > an acurate answer to this interesting problem. > > > If the following is true: >

Re: Interesting list Validity (True/False)

2007-05-11 Thread Carsten Haese
On Fri, 2007-05-11 at 14:12 -0700, [EMAIL PROTECTED] wrote: > However, how would you test for the falsness of the object arg? if not arg: # stuff -- Carsten Haese http://informixdb.sourceforge.net -- http://mail.python.org/mailman/listinfo/python-list

Re: Interesting list Validity (True/False)

2007-05-11 Thread nufuhsus
On May 11, 5:12 pm, [EMAIL PROTECTED] wrote: > On May 11, 5:07 pm, Carsten Haese <[EMAIL PROTECTED]> wrote: > > > > > > > On Fri, 2007-05-11 at 12:28 -0700, [EMAIL PROTECTED] wrote: > > > Hello all, > > > > First let me appologise if this has been answered but I could not find > > > an acurate answ

Re: Interesting list Validity (True/False)

2007-05-11 Thread nufuhsus
On May 11, 5:19 pm, Carsten Haese <[EMAIL PROTECTED]> wrote: > On Fri, 2007-05-11 at 14:12 -0700, [EMAIL PROTECTED] wrote: > > However, how would you test for the falsness of the object arg? > > if not arg: ># stuff > > -- > Carsten Haesehttp://informixdb.sourceforge.net I think that is the ti

Re: setting extra data to a wx.textctrl

2007-05-11 Thread Pom
[EMAIL PROTECTED] wrote: > On May 10, 10:51 pm, Pom <[EMAIL PROTECTED]> wrote: >> Hello group! >> >> I have an application which uses a lot of mysql data fields, all the >> same data type (floats). >> >> I created a panel which executes a "SELECT * FROM tablename" and makes >> as much fields as nee

Re: Interesting list Validity (True/False)

2007-05-11 Thread Rob Williscroft
wrote in news:[EMAIL PROTECTED] in comp.lang.python: > >>> [] == [] > True > >>> ['-o'] == [] > False > >>> ['-o'] == False > False > >>> To test wether something is true use if. To test wether something is false use if not. The python values "True" and "False" are

Re: Interesting list Validity (True/False)

2007-05-11 Thread [EMAIL PROTECTED]
On May 11, 3:36 pm, [EMAIL PROTECTED] wrote: > On May 11, 2:28 pm, [EMAIL PROTECTED] wrote: > > > > > > > > > > Hello all, > > > > First let me appologise if this has been answered but I could not find > > > an acurate answer to this interesting problem. > > > > If the following is true: > > >

Re: Interesting list Validity (True/False)

2007-05-11 Thread nufuhsus
Just an update of my output after Carsten and company's advice: C:\Python25\rg.py>help.py -h help.py Version 1.0 Copyright RDEG (c) 2007 Options : -h, --help -- display this message Progam Exit (0) C:\Python25\rg.py>help.py -i print arg ['-i'] type(arg): arg is True? False

Re: Time

2007-05-11 Thread HMS Surprise
Sorry, reading a little closer I see that the time tuple is apparently an ordinary list. jvh -- http://mail.python.org/mailman/listinfo/python-list

OMG BRITNEYS AT IT AGAIN AGAIN!!!!!!

2007-05-11 Thread wise . of . clean789
http://britneyboobs.blogspot.com/2007/05/britney-spears-slips-up-again-exposes.html - Exclusive pics of Britney Spears.. -- http://mail.python.org/mailman/listinfo/python-list

Re: OMG BRITNEYS AT IT AGAIN AGAIN!!!!!!

2007-05-11 Thread notbob
On 2007-05-11, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > http://britneyboobs.blogspot.com/2007/05/britney-spears-slips-up-again-exposes.html > - Exclusive pics of Britney Spears.. Britneyboobs what?... you take pride in being one? nb -- http://mail.python.org/mailman/listinfo/python

Recursion limit problems

2007-05-11 Thread elventear
Hello everyone, I am runing into recursion limit problems. I have found that the culprit was related to the __hash__ function that I had assigned to the objects that were added to a set. Basically my __hash__ function is the following: def __hash__(self): out_int = 0

py2exe LoadLibrary question

2007-05-11 Thread gordon . chapman
Yep, it's the old LoadLibrary failed problem. I understand that python24.dll is required for the executable to run, but I'm going to be building a few of these executables and I don't want to have to bundle python24 along with each one. We have python24.dll installed in c:/windows/system32, why i

matplotlib: howto set title of whole window?

2007-05-11 Thread dmitrey
hi all, does anyone know howto set title of whole window? (I mean not just area above plot but string in the same line where buttons 'close', 'iconify', 'fullscreen' are situated) Thx, D. -- http://mail.python.org/mailman/listinfo/python-list

find out all threads?

2007-05-11 Thread Sven Rech
Hi, I have a written a C program which makes use of python embedding. I want to find out all threads that a loaded module has started. But I can't find anything about this in the docs. Is it possible? -- http://mail.python.org/mailman/listinfo/python-list

mmap thoughts

2007-05-11 Thread James T. Dennis
I've been thinking about the Python mmap module quite a bit during the last couple of days. Sadly most of it has just been thinking ... and reading pages from Google searches ... and very little of it as been coding. Mostly it's just academic curiosity (I might be teaching an "overview of

Re: Path python versions and Macosx

2007-05-11 Thread half . italian
On May 11, 1:36 pm, andrea <[EMAIL PROTECTED]> wrote: > Hi everyone, > I use python on macosx with textmate as editor (great program). > > I also use macport to install unix programs from the command line and > I find it great too. > Well I would like to have all my modules in the path when I'm usi

Re: Time

2007-05-11 Thread John Machin
On May 12, 7:46 am, HMS Surprise <[EMAIL PROTECTED]> wrote: [first message] HS ==> I need to convert the string below into epoch seconds so that I can perform substractions and additions. JM ==> I presume you mean "seconds since the epoch". You don't need to do that. HS ==> I assume I will need

Re: Questions about bsddb

2007-05-11 Thread sinoodle
Thanks for the suggestion, I do remember reading that, but I don't think that helped much. I found experimenting around with the different settings, that the cache size is where the problem was. I've got it set to 1.5 GB and it's pretty happy at the moment, and the reduction in build time is a fra

Re: matplotlib: howto set title of whole window?

2007-05-11 Thread attn . steven . kuo
On May 11, 3:44 pm, dmitrey <[EMAIL PROTECTED]> wrote: > hi all, > does anyone know howto set title of whole window? (I mean not just > area above plot but string in the same line where buttons 'close', > 'iconify', 'fullscreen' are situated) > Use coordinates to set a title for the current figur

Re: Simple Python REGEX Question

2007-05-11 Thread John Machin
On May 12, 2:21 am, Gary Herron <[EMAIL PROTECTED]> wrote: > johnny wrote: > > I need to get the content inside the bracket. > > > eg. some characters before bracket (3.12345). > > > I need to get whatever inside the (), in this case 3.12345. > > > How do you do this with python regular expression?

docs patch: dicts and sets

2007-05-11 Thread Alan Isaac
This is an attempt to synthesize Bill and Carsten's proposals. (I'm changing the subject line to better match the topic.) http://docs.python.org/lib/typesmapping.html: for footnote (3) Keys and values are listed in an arbitrary order. This order is indeterminate and generally dep

  1   2   >