Re: Use list name as string

2009-02-04 Thread Hendrik van Rooyen
"MRAB" wrote: > The actual names of the variables and functions shouldn't matter to the > outside world; the name of an output file shouldn't depend on the name > of a variable. That is a matter of opinion. It is however, an interesting problem, namely: How does one get hold of the actual nam

Re: Scanning a file character by character

2009-02-04 Thread Bard Aase
On 5 Feb, 07:48, Spacebar265 wrote: > Hi. Does anyone know how to scan a file character by character and > have each character so I can put it into a variable. I am attempting > to make a chatbot and need this to read the saved input to look for > spelling mistakes and further analysis of user inp

Scanning a file character by character

2009-02-04 Thread Spacebar265
Hi. Does anyone know how to scan a file character by character and have each character so I can put it into a variable. I am attempting to make a chatbot and need this to read the saved input to look for spelling mistakes and further analysis of user input. Thanks Spacebar265 -- http://mail.python.

time: Daylight savings confusion

2009-02-04 Thread Tim H
On Win XP 64bit, Python 2.6.1 64bit I am trying to rename files by their creation time. It seems the time module is too smart for its own good here. time.localtime(os.path.getctime(f)) returns a value one hour off from what windows reports for files that were created when Daylight savings tim

Re: Find the critical points

2009-02-04 Thread Tim Roberts
antoniosacch...@gmail.com wrote: > >someone can help me?? >I am new to programing, >but I need to make some script like this: >http://blogs.nyu.edu/blogs/agc282/zia/2008/11/using_python_to_solve_optimiza.html >so th equestion is : >is possible to open it than it ask something and it tell me the >re

Re: Use list name as string

2009-02-04 Thread Aahz
In article , Rhodri James wrote: > >Fundamentally, the concept of a single unique name for any object isn't >something built into the language (or, indeed, most languages I can think >of). An object can have no names (though it'll promptly get garbage >collected if it isn't assigned to a name som

Re: Use list name as string

2009-02-04 Thread Jervis Whitley
On Thu, Feb 5, 2009 at 2:37 PM, Vincent Davis wrote: > Jervis Whitley wrote "Although you should really solve your problem by > thinking about it > from a completely different angle, maybe subclassing your datatype and > adding a 'name' > attribute ? I'm sure some of the others here have suggested

Re: Comparing two book chapters (text files)

2009-02-04 Thread Nick Matzke
Chris Rebert wrote: On Wed, Feb 4, 2009 at 5:20 PM, Nick Matzke wrote: Hi all, So I have an interesting challenge. I want to compare two book chapters, which I have in plain text format, and find out (a) percentage similarity and (b) what has changed. Some features make this problem differ

Re: Use list name as string

2009-02-04 Thread Vincent Davis
Jervis Whitley wrote "Although you should really solve your problem by thinking about it from a completely different angle, maybe subclassing your datatype and adding a 'name' attribute ? I'm sure some of the others here have suggested that already." That is beyond my current knowledge. Any suggest

Re: Use list name as string

2009-02-04 Thread Vincent Davis
"The problem is you seem to be thinking in terms of objects having names. They don't. Names have objects."I agree this is my problem. This is not correct terminology then? The name of the object is anobject Let me give another example and let me know if I am just beating a dead horse. In my curr

Re: Use list name as string

2009-02-04 Thread Jervis Whitley
On Thu, Feb 5, 2009 at 3:57 AM, Vincent Davis wrote: > Sorry for not being clear > I would have something like this > x = [1, 2, 3,5 ,6 ,9,234] > Then > def savedata(dataname): .. > > savedata(x) > this would save a to a file called x.csv This is my problem, getting the > name to be x.csv

Re: Upgrade 2.6 to 3.0

2009-02-04 Thread Steve Holden
Tim Rowe wrote: > 2009/2/5 Giampaolo Rodola' : > >> Just out of curiosity, am I the only one who think that switching to >> 3.x right now is not a good idea? > > I'm looking at making the switch, but I'm put off by the lack of 3rd > party stuff such as PyWin (and I can't see a NumPy build for Pyt

Re: Using while loop and if statement to tell if a binary has an odd or even number of 1's.

2009-02-04 Thread Steve Holden
todp...@hotmail.com wrote: > By "binary representation", I mean a byte of 0s and 1s. Example: 0101 > Also, I'm interested in only using while loop and if statement > to accomplish this task. > Thanks. > I smell homework. Do it yourself! -- Steve Holden+1 571 484 6266 +1 800 494 3119

Re: Use list name as string

2009-02-04 Thread Rhodri James
On Thu, 05 Feb 2009 01:36:17 -, Vincent Davis wrote: if I start with M = [1,3,5,7] M is [1,3,5,7] This seems one way, as [1,3,5,7] is not M in the sense that there is no operation I can preform on [1,3,5,7] and get M back. Other than asking/testing M==[1,3,5,7] Correct. If you actually

Re: JDBC in CPYTHON

2009-02-04 Thread KMCB
Thanks Simon and Marc, I currently have an app on OSX that I wanted to migrate to NIX, it uses a ODBC DBAPI interface to communicate with Filemaker. Unfortunately, FMP does not support linux drivers. They do have a JDBC driver that looks like it may work. My preference was to run that app on one

Re: Does array.read() move file pointer automatically?

2009-02-04 Thread John Machin
On Feb 5, 9:51 am, Lionel wrote: > Hello everyone. Quick question: When using the "read()" method in the > array module, must I redirect the current file pointer or will that > occur automatically? > > For example, if I were to sequentially read data in chunks from a > binary file as in: > > for c

Re: is python Object oriented??

2009-02-04 Thread Thorsten Kampe
* Russ P. (Tue, 3 Feb 2009 21:04:30 -0800 (PST)) > Imagine you own a company, and you decide to lease an office building. > Would you expect the office doors to have locks on them? Oh, you > would? Why? You mean you don't "trust" your co-workers? What are locks > but enforced access restriction? >

More on ancient pythons (before version 0.0?)

2009-02-04 Thread Scott David Daniels
Apparently there is some fossil evidence of an early version of Python over 50 million years ago. Must have been some large negative version. It apparently suffered from serious code bloat, since the article says it was 13 meters long and over a megagram. http://news.bbc.co.uk/1/hi/sci/tech/

How do i add body to email.mime.multipart.MIMEMultipart instance?

2009-02-04 Thread srinivasan srinivas
Hi, Could someone tell me the way to add body to the instance email.mime.multipart.MIMEMultipart instance which has attachments? Thanks, Srini Bollywood news, movie reviews, film trailers and more! Go to http://in.movies.yahoo.com/ -- http://mail.python.org/mailman/listinfo/python-list

Embedded python output capture

2009-02-04 Thread Deepak Chandran
I have a program with embedded Python. If the python code has print statements, how do I retrieve those values (which normally go to stdout)? The output from Py_RunString is just NULL Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Use list name as string

2009-02-04 Thread Tim Chase
My argument comes down to; we use M so we don't have to type [1,3,5,7], I realize that this is in part because we might not no what M will be. This is starting to sound like double talk on my part, I have only been programing in python for 2 weeks so my credibility is only that of an outside that

Re: Feet and inches

2009-02-04 Thread Tim Rowe
2009/2/5 todp...@hotmail.com : > I'm trying to get Python to say: > > Enter the height (in metres): > > and convert whatever value to feet and inches. This looks like another homework assignment. You'll probably get more help (on *any* language forum) if you admit that up front. However, at least

Re: Feet and inches

2009-02-04 Thread Tim Chase
Enter the height (in metres): and convert whatever value to feet and inches. I've done this part as you can see below, but how can I terminate the program when user inputs a height less than 1/2 inch? Dang...I got suckered into answering a homework problem for the last one. My apologies to

Re: Feet and inches

2009-02-04 Thread Rhodri James
On Thu, 05 Feb 2009 01:28:06 -, todp...@hotmail.com wrote: I'm trying to get Python to say: Enter the height (in metres): and convert whatever value to feet and inches. I've done this part as you can see below, but [...] Holy homework, you are busy tonight. Hang on while I put the li

Re: Upgrade 2.6 to 3.0

2009-02-04 Thread Tim Rowe
2009/2/5 Giampaolo Rodola' : > Just out of curiosity, am I the only one who think that switching to > 3.x right now is not a good idea? I'm looking at making the switch, but I'm put off by the lack of 3rd party stuff such as PyWin (and I can't see a NumPy build for Python 2.6 yet, never mind 3.0)

Re: Couple of noobish question

2009-02-04 Thread afriere
On Feb 5, 11:45 am, Tim Rowe wrote: [snip] > Python in a Nutshell states that os.uname "exists only on certain > platforms", and in the code sample wraps it in a try statement. That > seems to be the safe way to go -- except (and I don't know much about > this) wouldn't code have to be digging

Re: Does array.read() move file pointer automatically?

2009-02-04 Thread Lionel
On Feb 4, 5:10 pm, MRAB wrote: > Lionel wrote: > >  > On Feb 4, 3:10 pm, MRAB wrote: >> Lionel > wrote: > >  >> >  >>  > Hello everyone. Quick question: When using the "read()" method in the >  >>  > array module, must I redirect the current file pointer or will that >  >>  > occur automatically

Re: Using while loop and if statement to tell if a binary has an odd or even number of 1's.

2009-02-04 Thread Tim Chase
Using while loop and if statement, I'm trying to get Python to tell me whether there are even or odd number of 1's in a binary representation. For example, if I give Python a 0111, then I want it to say that the binary representation given has an odd number of 1's. If I give it 00010111, then

Re: Comparing two book chapters (text files)

2009-02-04 Thread Chris Rebert
On Wed, Feb 4, 2009 at 5:20 PM, Nick Matzke wrote: > Hi all, > > So I have an interesting challenge. I want to compare two book chapters, > which I have in plain text format, and find out (a) percentage similarity > and (b) what has changed. > > Some features make this problem different than what

Re: Upgrade 2.6 to 3.0

2009-02-04 Thread Giampaolo Rodola'
On 5 Feb, 01:18, Tim Rowe wrote: > 2009/2/4 Scott David Daniels : > > > joviyach wrote: > > >> I am fairly new to Python, the first version I loaded was 2.6. I have > >> since downloaded 3.0 and I was wondering what the best practice for > >> upgrading is? I am using Windows XP Pro for my OS. > >

Re: Using while loop and if statement to tell if a binary has an odd or even number of 1's.

2009-02-04 Thread Chris Rebert
A "byte" is *not* a Python type. My question was what *Python type* (i.e. bytes (which is distinctly different from the abstract notion of a byte), str/unicode, int, etc...) you were using for you "binary representation", which you still haven't answered. Also, please don't reply by top-posting (ht

Re: Use list name as string

2009-02-04 Thread Vincent Davis
if I start with M = [1,3,5,7] M is [1,3,5,7] This seems one way, as [1,3,5,7] is not M in the sense that there is no operation I can preform on [1,3,5,7] and get M back. Other than asking/testing M==[1,3,5,7] This seems fine to me. but when I savedata(M) it seems I should be able to refer to both [

Re: Cross platform compilation?

2009-02-04 Thread David Boddie
On Tuesday 03 February 2009 03:59, John Harper wrote: > Before I try to reverse engineer completely setup.py, is there > something obvious that needs to be done to get it to use the right tool > chain? I think it's more complicated than that, though in an ideal world it wouldn't have to be that w

Feet and inches

2009-02-04 Thread todp...@hotmail.com
I'm trying to get Python to say: Enter the height (in metres): and convert whatever value to feet and inches. I've done this part as you can see below, but how can I terminate the program when user inputs a height less than 1/2 inch? How can I also take into account all the cases that need a

Re: How to trigger a smart link?

2009-02-04 Thread Chris Rebert
On Wed, Feb 4, 2009 at 5:16 PM, Muddy Coder wrote: > Hi All, > > Using urllib2 can trigger CGI script in server side. However, I > encountered a problem of the so-called smart link. When a fairly large > site, the server needs to track the identifier of each request from > client, so it generated

Re: Using while loop and if statement to tell if a binary has an odd or even number of 1's.

2009-02-04 Thread Tim Rowe
2009/2/5 todp...@hotmail.com : > Using while loop and if statement, I'm trying to get Python to tell me > whether there are even or odd number of 1's in a binary representation. > For example, if I give Python a 0111, then I want it to say that the > binary representation given has an odd numbe

RE: Using while loop and if statement to tell if a binary has an odd or even number of 1's.

2009-02-04 Thread todp...@hotmail.com
By "binary representation", I mean a byte of 0s and 1s. Example: 0101 Also, I'm interested in only using while loop and if statement to accomplish this task. Thanks.> Date: Wed, 4 Feb 2009 17:18:25 -0800> Subject: Re: Using while loop and if statement to tell if a binary has an odd or even n

Comparing two book chapters (text files)

2009-02-04 Thread Nick Matzke
Hi all, So I have an interesting challenge. I want to compare two book chapters, which I have in plain text format, and find out (a) percentage similarity and (b) what has changed. Some features make this problem different than what seems to be the standard text-matching problem solvable wi

How to trigger a smart link?

2009-02-04 Thread Muddy Coder
Hi All, Using urllib2 can trigger CGI script in server side. However, I encountered a problem of the so-called smart link. When a fairly large site, the server needs to track the identifier of each request from client, so it generated an ugly escape string attached on url. It seems that I must get

Re: Using while loop and if statement to tell if a binary has an odd or even number of 1's.

2009-02-04 Thread Chris Rebert
On Wed, Feb 4, 2009 at 5:02 PM, todp...@hotmail.com wrote: > Using while loop and if statement, I'm trying to get Python to tell me > whether there are even or odd number of 1's in a binary representation. > For example, if I give Python a 0111, then I want it to say that the > binary represen

Re: Does array.read() move file pointer automatically?

2009-02-04 Thread MRAB
Lionel wrote: > On Feb 4, 3:10 pm, MRAB wrote: >> Lionel wrote: >> >> > Hello everyone. Quick question: When using the "read()" method in the >> > array module, must I redirect the current file pointer or will that >> > occur automatically? >> > >> > For example, if I were to sequentially re

Using while loop and if statement to tell if a binary has an odd or even number of 1's.

2009-02-04 Thread todp...@hotmail.com
Using while loop and if statement, I'm trying to get Python to tell me whether there are even or odd number of 1's in a binary representation. For example, if I give Python a 0111, then I want it to say that the binary representation given has an odd number of 1's. If I give it 00010111, the

Re: structs

2009-02-04 Thread Mark Wooding
Keith Thompson writes: > "Gary Herron" writes: >> Python *is* object-oriented > > I disagree. Care to provide proof of that statement? AWOOGA! The article I'm following up to (together with at least one other) is a forgery, and the Followup-To header is set to comp.lang.c as part of an effort

Re: Couple of noobish question

2009-02-04 Thread Tim Rowe
2009/2/5 : > On Feb 5, 11:14 am, Tim Rowe wrote: > > ... > >> On an MS Windows system, os.uname()[0] raises an AttributeError -- sys >> doesn't seem to contain uname. Is that a Linux thing? Would os.name >> work on Linux? Or would one have to use exception handling and catch >> the Windows case?

Re: sys.float_info.epsilon

2009-02-04 Thread Tim Rowe
2009/2/5 Scott David Daniels : > And, of course he is right (and didn't even whomp on my typo of "makes" > as "mes in the first line quoted above). A typo for "makes" didn't bother me. Non-associativity of the real numbers under addition risked making my whole world fall apart :-) -- Tim Rowe

Re: Couple of noobish question

2009-02-04 Thread afriere
On Feb 5, 11:14 am, Tim Rowe wrote: ... > On an MS Windows system, os.uname()[0] raises an AttributeError -- sys > doesn't seem to contain uname. Is that a Linux thing? Would os.name > work on Linux? Or would one have to use exception handling and catch > the Windows case? It seems to be a Wind

Re: sys.float_info.epsilon

2009-02-04 Thread Scott David Daniels
I wrote: > You are missing the whole thing that mes floating point tricky > The reason it is tough is that addition is not associative in real > numbers, and associativity is at the core > of a lot of proofs in > arithmetic (and group theory). In response to which Tim Rowe wrote: ... Thanks

Re: Upgrade 2.6 to 3.0

2009-02-04 Thread Tim Rowe
2009/2/4 Scott David Daniels : > joviyach wrote: >> >> I am fairly new to Python, the first version I loaded was 2.6. I have >> since downloaded 3.0 and I was wondering what the best practice for >> upgrading is? I am using Windows XP Pro for my OS. > > On Windows, X.Y.* all go in one directory (ov

Re: Couple of noobish question

2009-02-04 Thread Tim Rowe
2009/2/4 Bruno Desthuilliers : > # somemodule.py > > import os > > if os.uname()[0] == "Linux": On an MS Windows system, os.uname()[0] raises an AttributeError -- sys doesn't seem to contain uname. Is that a Linux thing? Would os.name work on Linux? Or would one have to use exception handling and

Re: Use list name as string

2009-02-04 Thread Rhodri James
On Wed, 04 Feb 2009 17:23:55 -, Vincent Davis wrote: I guess what I am saying is that it does not seem like I am adding any information that is not already there when I have to enter that list and list name after all they are the same. Thanks But you are. Consider just for a moment wha

Re: How to find wxPython method documentation??

2009-02-04 Thread andrew cooke
On Feb 4, 8:06 pm, len wrote: > How does one find the methods that are available in the classes. heh. welcome to the wonderful world of wxpython :o( if you use eclipse to edit your code, then (providing the wind is in the right direction and the file you are editing doesn't have any syntax erro

Re: Does array.read() move file pointer automatically?

2009-02-04 Thread Lionel
On Feb 4, 3:10 pm, MRAB wrote: > Lionel wrote: > >  > Hello everyone. Quick question: When using the "read()" method in the >  > array module, must I redirect the current file pointer or will that >  > occur automatically? >  > >  > For example, if I were to sequentially read data in chunks from a

Re: Structuring Modules with a Ubiquitous Base Class (Circular Dependencies)

2009-02-04 Thread andrew cooke
On Feb 4, 7:49 pm, andrew cooke wrote: > This leads to a circular dependency - the base class wants to import > the components, which in turn want to import the base class. > > Is there any standard solution to this? well, to partially answer my own question, this is certainly possible. in the g

Re: Does array.read() move file pointer automatically?

2009-02-04 Thread MRAB
Lionel wrote: > Hello everyone. Quick question: When using the "read()" method in the > array module, must I redirect the current file pointer or will that > occur automatically? > > For example, if I were to sequentially read data in chunks from a > binary file as in: > > > for currentChunk in ra

How to find wxPython method documentation??

2009-02-04 Thread len
Hi I am going through the "wxPython in Action" book by Noel Rappin and Robin Dunn. I have been typing in the example programs as I go and play with modifing the code. Thought I should start trying to find my way around the documentation found on the wxPython web site. The problem I have been hav

Re: [Web 2.0] Added-value of frameworks?

2009-02-04 Thread Bruno Desthuilliers
Gilles Ganault a écrit : Hello If I wanted to build some social web site such as Facebook, what do frameworks like Django or TurboGears provide over writing a site from scratch using Python? Quite a lot of abstractions and factorisation of the boilerplate code, a known way to organize your ap

Does array.read() move file pointer automatically?

2009-02-04 Thread Lionel
Hello everyone. Quick question: When using the "read()" method in the array module, must I redirect the current file pointer or will that occur automatically? For example, if I were to sequentially read data in chunks from a binary file as in: for currentChunk in range(numberOfChunksToRead):

Structuring Modules with a Ubiquitous Base Class (Circular Dependencies)

2009-02-04 Thread andrew cooke
Is there a good solution to the following problem? I have a library whose components I would like to separate into distinct modules. These components inherit from a common base class that provides common functionality (the inheritance is important only for implementation; there's a separate ABC m

Re: Couple of noobish question

2009-02-04 Thread Bruno Desthuilliers
Catherine Heathcote a écrit : Firstly hi, I don't know any of you yet but am picking up Python and will be lurking here a lot lol. I am a hobbiest coder (did 3 out of 4 years of a comp tech degree, long story) and am learning Python, 'cos I saw some code and it just looks a really nice language

Re: Upgrade 2.6 to 3.0

2009-02-04 Thread joviyach
On Feb 4, 2:43 pm, Scott David Daniels wrote: > joviyach wrote: > > I am fairly new to Python, the first version I loaded was 2.6. I have > > since downloaded 3.0 and I was wondering what the best practice for > > upgrading is? I am using Windows XP Pro for my OS. > > On Windows, X.Y.* all go in o

Re: structs

2009-02-04 Thread Steve Holden
Keith Thompson wrote: > "Gary Herron" writes: >> Python *is* object-oriented > > I disagree. Care to provide proof of that statement? Disagree all you like. Just do it silently, please. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://w

Re: is python Object oriented??

2009-02-04 Thread Luis Zarrabeitia
On Wednesday 04 February 2009 10:53:54 am Russ P. wrote: > On Feb 4, 5:35 am, Luis Zarrabeitia wrote: > > Quoting "Russ P." : > > This analogy is nonsense. There is no way you will execute code on my > > system if I don't authorize it, regardless of how "public" are the > > variables declared in m

Re: Understanding descriptors

2009-02-04 Thread Aahz
In article , Brian Allen Vanderburg II wrote: > > [...] > >When a lookup is done it uses this descriptor to make a bound or unbound >method: > >c=C() > >C.F # unbound method object, expects explicit instance when calling the >function >c.F # bound method object provides instance implicitly whe

Re: how to compile in jython 2.5b1??

2009-02-04 Thread Diez B. Roggisch
ruelle schrieb: What do you need jythonc for? That's purely for a somewhat neater integration of *Java* with jython - nothing to do with sympy. Diez I need jythonc to compile a simple script in java, this script import SymPy library. You need to find other ways. The usual approach to this i

Re: sys.float_info.epsilon

2009-02-04 Thread Tim Rowe
2009/2/4 Scott David Daniels : Thanks for that. It makes me feel guilty to point out that: > addition is not associative in real numbers should presumably be "addition is not associative in floating point numbers". -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: sys.float_info.epsilon

2009-02-04 Thread Tim Rowe
2009/2/4 Mark Dickinson : > There are many positive floating-point values smaller than > sys.float_info.epsilon. > > sys.float_info.epsilon is defined as the difference between 1.0 and > the next largest representable floating-point number. On your system, > the next largest float is almost certa

Re: Unzipping a .zip properly, and from a remote URL

2009-02-04 Thread M.-A. Lemburg
On 2009-02-03 15:32, Tino Wildenhain wrote: > Christopher Culver wrote: >> Tino Wildenhain writes: >>> so instead you would use archive = zipfile.ZipFile(remotedata) >> >> That produces the following error if I try that in the Python >> interpreter (URL edited for privacy): >> > import zipfile

Re: Kill a function while it's being executed

2009-02-04 Thread Ben Finney
"Noam Aigerman" writes: > About the hijacking - I *might* have done it without understanding > what I did (replied to a previous message and then changed the > subject), if that's what you mean... Right. The message still declares itself (via fields in the header) to be a reply to the original,

Re: x64 speed

2009-02-04 Thread M.-A. Lemburg
On 2009-02-04 11:14, Robin Becker wrote: > Martin v. Löwis wrote: I follow David's guess that Linux does better IO than Windows (not knowing anything about the benchmark, of course) >>> I originally thought it must be the vmware host stuff offloading IO to >>> the second core, but wa

Re: structs

2009-02-04 Thread Keith Thompson
"Gary Herron" writes: > Python *is* object-oriented I disagree. Care to provide proof of that statement? -- http://mail.python.org/mailman/listinfo/python-list

Re: JDBC in CPYTHON

2009-02-04 Thread M.-A. Lemburg
On 2009-02-03 19:30, KMCB wrote: > I was wondering if anyone was aware of a JDBC DBAPI module for > cpython. I have looked at PYJDBC and was interested in avoiding using > that extra level of ICE. I was thinking maybe someone would have back > ported zxJDBC from Jython. Or used that as a startin

Re: how to compile in jython 2.5b1??

2009-02-04 Thread ruelle
> What do you need jythonc for? That's purely for a somewhat neater > integration of *Java* with jython - nothing to do with sympy. > > Diez I need jythonc to compile a simple script in java, this script import SymPy library. thank you ruelle -- http://mail.python.org/mailman/listinfo/python-list

Re: structs

2009-02-04 Thread Keith Thompson
"Scott David Daniels" writes: > To avoid using epsilon, do something like: > if 1 + abs(x) != 1: An OK effort, but you're wrong. That's not how to do it at all. -- http://mail.python.org/mailman/listinfo/python-list

Re: Where & how to deallocate resources in Python C extension

2009-02-04 Thread Mark Wooding
fredbasset1...@gmail.com writes: > I've written a C extension, see code below, to provide a Python > interface to a hardware watchdog timer. As part of the initialization > it makes some calls to mmap, I am wondering should I be making > balanced calls to munmap in some kind of de-init function?

Re: how to compile in jython 2.5b1??

2009-02-04 Thread Diez B. Roggisch
pellegrin...@gmail.com schrieb: I have to use jython 2.5b1 couse with the stable version it's not possible to use sympy library for mathematic operation but the "jythonc.bat" it's not included. I look to this link: http://www.jython.org/Project/jythonc.html "..jythonc is unmaintained and will not

Re: is python Object oriented??

2009-02-04 Thread Mark Wooding
Steven D'Aprano writes: > Now, that's a toy example. Languages like Ada make correctness proofs, > well, perhaps not easy, but merely difficult compared to impossible for > languages like Python. Say `generally impractical' rather than `impossible' and I'll agree with you. But I'm not actuall

Re: Upgrade 2.6 to 3.0

2009-02-04 Thread Scott David Daniels
joviyach wrote: I am fairly new to Python, the first version I loaded was 2.6. I have since downloaded 3.0 and I was wondering what the best practice for upgrading is? I am using Windows XP Pro for my OS. On Windows, X.Y.* all go in one directory (over-riding each other) So the whole 2.6.* fami

Upgrade 2.6 to 3.0

2009-02-04 Thread joviyach
I am fairly new to Python, the first version I loaded was 2.6. I have since downloaded 3.0 and I was wondering what the best practice for upgrading is? I am using Windows XP Pro for my OS. Thanks, Jim -- http://mail.python.org/mailman/listinfo/python-list

Re: is python Object oriented??

2009-02-04 Thread Mark Wooding
"Russ P." writes: > Imagine you own a company, and you decide to lease an office building. > Would you expect the office doors to have locks on them? Oh, you > would? Why? You mean you don't "trust" your co-workers? What are locks > but enforced access restriction? Huh? The lock on the door isn

Re: [Web 2.0] Added-value of frameworks?

2009-02-04 Thread James Matthews
They provide a nice framework that will handle most of the annoying things. With Django you don't need to write SQL (in a sense). etc.. On Wed, Feb 4, 2009 at 6:08 PM, Gilles Ganault wrote: > Hello > > If I wanted to build some social web site such as Facebook, what do > frameworks like Django o

Re: sys.float_info.epsilon

2009-02-04 Thread Steve Holden
Tim Rowe wrote: > I'm reading Mark Summerfield's "Programming Python 3.0" at the moment, > and I'm puzzled by some of his uses of sys.float_info.epsilon. I > appreciate the issues of comparing floating point numbers, but I'm > puzzled by code like: > ... > x = float(input(msg)) > if abs

how to compile in jython 2.5b1??

2009-02-04 Thread pellegrinodj
I have to use jython 2.5b1 couse with the stable version it's not possible to use sympy library for mathematic operation but the "jythonc.bat" it's not included. I look to this link: http://www.jython.org/Project/jythonc.html "..jythonc is unmaintained and will not be present in its current form in

Re: sys.float_info.epsilon

2009-02-04 Thread Mark Dickinson
On Feb 4, 7:52 pm, Scott David Daniels wrote: > You are missing the whole thing that mes floating point tricky. > I _believe_ that the epsilon is the smallest positive x such that >     1.0 != 1.0 + x Nitpick alert: this isn't quite the same thing, since that definition is affected by rounding.

Re: Using lxml to screen scrap a site, problem with charset

2009-02-04 Thread Stefan Behnel
Tim Arnold wrote: > "?? ???" wrote in message > news:ciqh56-ses@archaeopteryx.softver.org.mk... >> So, I'm using lxml to screen scrap a site that uses the cyrillic >> alphabet (windows-1251 encoding). The sites HTML doesn't have the > ..content-type.. charset=..> header, but does

Re: sys.float_info.epsilon

2009-02-04 Thread Mark Dickinson
On Feb 4, 7:18 pm, Tim Rowe wrote: > I didn't realise that float() could return anything with an absolute > value less than sys.float_value.epsilon other than 0.0 (which I think > all representations can represent exactly).  What am I missing here? There are many positive floating-point values sm

Re: sys.float_info.epsilon

2009-02-04 Thread Scott David Daniels
Tim Rowe wrote: I'm reading Mark Summerfield's "Programming Python 3.0" at the moment, and I'm puzzled by some of his uses of sys.float_info.epsilon. I appreciate the issues of comparing floating point numbers, but I'm puzzled by code like: ... x = float(input(msg)) if abs(x) < sys.fl

Re: is python Object oriented??

2009-02-04 Thread thmpsn . m . k
On Feb 4, 3:11 am, Bruno Desthuilliers wrote: > thmpsn@gmail.com a écrit : > > > > > On Feb 3, 1:14 am, David Cournapeau wrote: > (snip) > >> after all, we have used FILE* for years and I have no idea about the FILE > >> structure. > > > Your lack of knowledge about it doesn't mean that it ha

Re: x64 speed

2009-02-04 Thread Martin v. Löwis
> Is it the > x64 working faster at its design sizes Another guess (still from the darkness of not having received the slightest clue what the test actually does): if it creates integers in range(2**32, 2**64), then they fit into a Python int on AMD64-Linux, but require a Python long on 32-bit Win

Re: Tkinter

2009-02-04 Thread Scott David Daniels
Luke wrote: Hello, I'm an inexperienced programmer and I'm trying to make a Tkinter window and have so far been unsuccessful in being able to delete widgets from the main window and then add new ones back into the window without closing the main window. The coding looks similar to this: ... from

Re: Tkinter

2009-02-04 Thread Francesco Bochicchio
Luke ha scritto: Hello, I'm an inexperienced programmer and I'm trying to make a Tkinter window and have so far been unsuccessful in being able to delete widgets from the main window and then add new ones back into the window without closing the main window. The coding looks similar to this: .

sys.float_info.epsilon

2009-02-04 Thread Tim Rowe
I'm reading Mark Summerfield's "Programming Python 3.0" at the moment, and I'm puzzled by some of his uses of sys.float_info.epsilon. I appreciate the issues of comparing floating point numbers, but I'm puzzled by code like: ... x = float(input(msg)) if abs(x) < sys.float_info.epsilon:

Re: len()

2009-02-04 Thread Terry Reedy
Pat wrote: Andreas Waldenburger wrote: On Sat, 31 Jan 2009 13:27:02 -0500 Pat wrote: Tobiah wrote: Just out of curiosity, why was len() made to be it's own function? I often find myself typing things like my_list.len before I catch myself. Thanks, Toby I'm surprised that no one responded

Re: is python Object oriented??

2009-02-04 Thread Terry Reedy
Hendrik van Rooyen wrote: "Scott David Daniels" wrote: You might enjoy looking at QNX, since I think it is built along the lines you are describing here. I have an ancient copy of their OS, but haven't followed for more than couple of decades. I vaguely know about it, and I know they claim

Re: is python Object oriented??

2009-02-04 Thread Gabriel Genellina
En Wed, 04 Feb 2009 07:05:22 -0200, Bruno Desthuilliers escribió: Gabriel Genellina a écrit : En Mon, 02 Feb 2009 19:51:11 -0200, Russ P. escribió: Suppose a library developer (or a module developer on a large team) uses leading underscores. Now suppose that, for whatever reason (pressure

Re: len()

2009-02-04 Thread Gabriel Genellina
En Wed, 04 Feb 2009 12:38:04 -0200, Pat escribió: Andreas Waldenburger wrote: On Sat, 31 Jan 2009 13:27:02 -0500 Pat wrote: Tobiah wrote: Just out of curiosity, why was len() made to be it's own function? I often find myself typing things like my_list.len before I catch myself. I'm surpr

Re: Added-value of frameworks?

2009-02-04 Thread J Kenneth King
Matimus writes: > On Feb 4, 8:08 am, Gilles Ganault wrote: >> Hello >> >> If I wanted to build some social web site such as Facebook, what do >> frameworks like Django or TurboGears provide over writing a site from >> scratch using Python? >> >> Thank you for your feedback. > > Why not just look

Running CVSNT commands from python to Automate the job

2009-02-04 Thread sandeep
Hi All, i want to automate my task for of doing cvs checkout for different modules. I am on Windows XP and i am using Python 2.6. here is my attched python code. The thing is when i am running this nothing is happening. I am not sure at which end the problem is. am i giving wrong parameters or wha

Couple of noobish question

2009-02-04 Thread rdmurray
Quoth Catherine Heathcote : > all goes well. I have an idea for a small project, an overly simplistic > interactive fiction engine (well more like those old choose your own > adventure books, used to love those!) that uses XML for its map files. > The main issues I see so far is the XML parsing

Re: Use list name as string

2009-02-04 Thread MRAB
Vincent Davis wrote: I guess what I am saying is that it does not seem like I am adding any information that is not already there when I have to enter that list and list name after all they are the same. If you write: y = x then both x and y refer to the same list. The actual names of the va

Re: Use list name as string

2009-02-04 Thread Tim Chase
can I do it the otherway, that issavedata('nameoflist') for limited cases where your variable is defined globally, you can use: >>> a = [1,2,3,4] >>> def save(s): ... print globals().get(s, "UNDEFINED") ... >>> save("a") [1, 2, 3, 4] >>> save("b") UNDEFINED >>> b = (6,5,

  1   2   >