Re: Preferred Random Library

2007-04-25 Thread Robert Kern
ributions implemented. numpy.random does not implement jumpahead(). random, naturally, does not require a third-party package. By and large, I'd say the distinguishing factor is whether or not you want to use numpy in your program. If so, then use numpy.random. If not, then use random. -- Robe

Re: Import Problems

2007-04-27 Thread Robert Kern
at a higher level for external callers. If you have a module whose contents are being exposed in your __init__.py, never rely on the contents of that __init__.py in that code. Instead, go straight to the real modules that implement the symbols that you need. So mytest.py should read: from importtest.tes

Re: Numeric + wxPython, can't understand a bug...

2007-04-27 Thread Robert Kern
essage... wx.Point objects are being recognized as sequences by array(). Consequently, reshape() thinks you are trying to reshape a (height*width, 2) array into a (height, width) array. You might want to create an empty (height, width) PyObject array first, and simply assign wx.Point values into i

Re: howto make Python list from numpy.array?

2007-05-06 Thread Robert Kern
lst = list(arr) For N-D arrays, that will give you a list of arrays. If you want a list of lists (of lists of lists ... etc N times), use the .tolist() method of arrays. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made t

Re: howto make Python list from numpy.array?

2007-05-06 Thread Robert Kern
ist() > Traceback (most recent call last): > File "", line 1, in > ValueError: rank-0 arrays don't convert to lists. > > Here I used Python 2.4.3, numpy 1.02 All of these results are entirely correct. A scalar (or rank-0 array) is not a sequence. If you have a need to

Re: change of random state when pyc created??

2007-05-09 Thread Robert Kern
hich is non-random, varies across Python implementations, and depends on the dictionary's history of insertions and deletions. """ The sets documentation is a bit less explicit, though. http://docs.python.org/lib/types-set.html """ Like other collections, sets

Re: Single precision floating point calcs?

2007-05-09 Thread Robert Kern
) Out[10]: True In [11]: 1.0 + 1e-8 == 1.0 Out[11]: False If you can afford to be slow, I believe there is an ASPN Python Cookbook recipe for simulating floating point arithmetic of any precision. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma th

Re: change of random state when pyc created??

2007-05-09 Thread Robert Kern
Alan G Isaac wrote: > Robert Kern wrote: >> http://docs.python.org/lib/typesmapping.html >> """ >> Keys and values are listed in an arbitrary order which is non-random, varies >> across Python implementations, and depends on the dictionary's history o

Re: change of random state when pyc created??

2007-05-09 Thread Robert Kern
Alan Isaac wrote: >>> Robert Kern wrote: >>>> http://docs.python.org/lib/typesmapping.html >>>> """ >>>> Keys and values are listed in an arbitrary order which is non-random, > varies >>>> across Python implementations,

Re: change of random state when pyc created??

2007-05-09 Thread Robert Kern
Steven D'Aprano wrote: > On Wed, 09 May 2007 21:18:25 -0500, Robert Kern wrote: > >> Actually, the root cause of Peter's specific example is the fact that the >> default implementation of __hash__() and __eq__() rely on identity >> comparisons. >> Two sepa

Re: change of random state when pyc created??

2007-05-10 Thread Robert Kern
mory location of the elements. It's misleading. It only depends on the memory location of the elements if __hash__() is implemented as id() (the default). How about this? """Never rely on the order of dictionaries and sets.""" -- Robert Kern "

Re: Towards faster Python implementations - theory

2007-05-13 Thread Robert Brown
sturlamolden <[EMAIL PROTECTED]> writes: > On May 10, 7:18 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > > CMUCL and SBCL depends on the dominance of the x86 architecture. CMUCL and SBCL run on a variety of architectures, including x86, 64-bit x86, PowerPC, Sparc, Alpha, and Mips. See http

Re: Trying to choose between python and java

2007-05-15 Thread Robert Kern
3.0 team. They've already implemented the translation for print statements, too: http://svn.python.org/view/sandbox/trunk/2to3/ http://svn.python.org/view/sandbox/trunk/2to3/fixes/fix_print.py?rev=54501&view=auto -- Robert Kern "I have come to believe that the whole world is

Re: try

2007-05-16 Thread Robert Kern
ept: > else: > print "couldn't find incident" The except: block still needs something in it, even if it is just "pass". -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our ow

Re: FreeType

2007-05-17 Thread Robert Kern
ill need to install libfreetype, then build matplotlib. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco -- http://mail.pytho

Re: FreeType

2007-05-17 Thread Robert Kern
Steve Holden wrote: > Alternatively use the Python Imaging Library (PIL), which I believe > includes freetype support. The OP seems to be trying to build matplotlib, which actually does require the FreeType library. The PIL, lovely though it is, is not a substitute. -- Robert Kern &

Re: namespace question

2007-05-18 Thread Robert Kern
= 2 c = 4 def myFun(self): print self.a, self.b, myClass.c return numpy.sin(self.a) -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco -- http://mail.python.org/mailman/listinfo/python-list

Re: docs patch: dicts and sets

2007-05-19 Thread Robert Kern
t to the bottom of an issue they > are having by reading those comments. And most will simply be confused. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an under

Re: 0 == False but [] != False?

2007-05-23 Thread Robert Kern
uot;. For empty lists, strings, tuples, dicts and some other things, "bool(foo) == False", while for lists, etc., with at least one element, "bool(foo) == True". -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco -- http://mail.python.org/mailman/listinfo/python-list

Re: Different methods with same name but different signature?

2007-05-24 Thread Robert Kern
No. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco -- http://mail.python.org/mailman/listinfo/python-list

Re: Newsgroups and mailing lists (was Re: Slightly OT: Why all the spam?)

2007-05-24 Thread Robert Kern
Aahz wrote: > These days, because of the cancelbot wars, ... Heh. Sounds like a particularly dire episode of Doctor Who. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as thoug

Re: Long double in Python

2007-05-25 Thread Robert Kern
99969733e+199 In [58]: x * x Out[58]: 9.99939489e+399 In [59]: x * x * x Out[59]: 9.99909194e+599 In [60]: 1e200 * 1e200 * 1e200 Out[60]: inf -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by

Re: printing list, is this a bug?

2007-05-25 Thread Robert Kern
__, __repr__ will get > called. Is this a bug? No, it's deliberate design. The string representation of a list object, either list.__str__() or list.__repr__(), uses the __repr__() of its contained objects. -- Robert Kern "I have come to believe that the whole world is an enigma, a

Confused with csv.reader copies

2007-07-23 Thread Robert Dailey
First, take a look at my example code: - import csv def pass1( reader ): print reader.next() print reader.next() def pass2( reader ): print reader.next() print reader.next() reader = csv.reader( open( "C:/IT/Meth

wxPython - How to add sorting to a ListCtrl?

2007-07-24 Thread Robert Dailey
Hi, I have 3 columns in my list control, each with a different "type" of data (for example, one column has names, the other has dates, etc). Can anyone reference a tutorial for solving this issue? I've done my share of googling to no avail. I need the user to be able to click any of the column hea

datetime.time() class - How to pass it a time string?

2007-07-24 Thread Robert Dailey
Hi, I have a string in the following format: "00:00:25.886411" I would like to pass this string into the datetime.time() class and have it parse the string and use the values. However, the __init__() method only takes integers (which means I'd be forced to parse the string myself). Does anyone k

Re: Another C API Question

2007-07-26 Thread Robert Kern
to double without writing a giant switch() that exhausts > every single type of number? Convert it to a Python float using PyNumber_Float(), then use PyFloat_AsDouble() to get the C double value from it. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless eni

128 or 96 bit integer types?

2007-07-27 Thread Robert Dailey
Hi, Is there build-in or third party support for large integer types, such as 96 or 128 bits in size? I require such large sizes for precision issues (nanoseconds). Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: C++ Modules for python: How to?

2007-07-27 Thread Robert Dailey
On Jul 6, 7:39 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Jul 7, 9:26 am,RobertDailey<[EMAIL PROTECTED]> wrote: > > > > > On Jul 6, 3:06 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > > >RobertDaileyschrieb: > > > > > Hi, > > > > > I'm interested in making a C++ library of mine usable t

Re: C++ Modules for python: How to?

2007-07-27 Thread Robert Dailey
Okay I've actually got it compiling now, however it is saying it can't find "stdio.h" (No such file or directory). This means it doesn't know where the include directories are. How do I specify include directories? -- http://mail.python.org/mailman/listinfo/python-list

Iteration over strings

2007-07-31 Thread Robert Dailey
Hi, I have the following code: str = "C:/somepath/folder/file.txt" for char in str: if char == "\\": char = "/" The above doesn't modify the variable 'str' directly. I'm still pretty new to Python so if someone could explain to me why this isn't working and what I can do to achieve

Re: Iteration over strings

2007-07-31 Thread Robert Dailey
7;t able to find the 'replace()' function you guys are talking about. It's actually the perfect solution for the problem. I appreciate your time. On 7/31/07, Hexamorph <[EMAIL PROTECTED]> wrote: > > Jay Loden schrieb: > > Robert Dailey wrote: > >>

Re: Wing IDE for Python v. 3.0 beta1 released

2007-07-31 Thread Robert Dailey
Too bad it's not free. I'll stick with PSPad & IPython On 7/31/07, Wingware <[EMAIL PROTECTED]> wrote: > > Hi, > > I'm happy to announce the first beta release of Wing IDE 3.0. It is > available from http://wingware.com/wingide/beta > > Wing IDE is a commercial IDE designed specifically for Pytho

Time object?

2007-08-01 Thread Robert Dailey
Hi, I'm well aware of the datetime module, however it is really inconsistent and useless to me. In order to do any arithmetic on time objects, I have to use the 'timedelta' class, which doesn't even allow me to do all the math I want to do. For example, I want to do "1 / timeobj", where timeobj m

Checking object types

2007-08-01 Thread Robert Dailey
Hi, I'm currently interested in creating an __add__() operator for one of my classes. This class handles both integers and objects its own type, however I don't know how I can perform special add operations depending on which is passed in. Since I haven't seen any evidence of function overloading,

Re: Wing IDE for Python v. 3.0 beta1 released

2007-08-01 Thread Robert Dailey
He's secretly an employee of Wing IDE in disguise!!! On 8/1/07, Joshua J. Kugler <[EMAIL PROTECTED]> wrote: > > On Wednesday 01 August 2007 13:28, John K Masters wrote: > > > On 15:34 Tue 31 Jul , Wingware wrote: > >> Hi, > >> > >> I'm happy to announce the first beta release of Wing IDE 3.0.

Re: XML Processing

2007-08-02 Thread Robert Dailey
Both strings in your example are exactly the same, unless I'm missing something. On 8/2/07, Roman <[EMAIL PROTECTED]> wrote: > > Is there a package that converts a string that contains special > characters in xml to to literal value. For instance, converts string > http://myhome/¶m to http://myho

Re: bias in random.normalvariate??

2007-08-03 Thread Robert Kern
; hi=mean > sd=10 > sum=0 > while(i<=samplen): > x=random.normalvariate(mean,sd) > #print x > if x if x>hi: high=x > sum+=x > i+=1 > print 'sample mean=', sum/samplen, '\n' > print 'low value =', l

Re: SciPy's site is down

2007-08-08 Thread Robert Kern
orrectly on Python 2.5 on WinVista? If you can connect again to scipy.org, please tell us the problems you've had installing numpy on Vista at [EMAIL PROTECTED] I believe that someone has mentioned that the binary installer worked fine for them. http://scipy.org/Mailing_Lists -- Robert Ke

Re: I am giving up perl because of assholes on clpm -- switching to Python

2007-08-11 Thread Robert Dailey
I had this very same problem with the doxygen mailing list... doxygen is such a great tool but full of assholes in their mailing list. On 8/2/07, Jamie <[EMAIL PROTECTED]> wrote: > > In <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] mentions: > >Python is a better language, with php support, anyway, but

Binary, Hex, and Decimal string conversions

2007-08-11 Thread Robert Dailey
Hi, I was wondering if there is a built in module that supports conversion in any direction between Binary, Hex, and Decimal strings? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: I am giving up perl because of assholes on clpm -- switching to Python

2007-08-12 Thread Robert Dailey
pure stupidity. On 8/11/07, Greg Donald <[EMAIL PROTECTED]> wrote: > > On 8/11/07, Robert Dailey <[EMAIL PROTECTED]> wrote: > > I had this very same problem with the doxygen mailing list... doxygen is > > such a great tool but full of assholes in their mailing list.

Re: Python not freeing memory (?)

2007-08-12 Thread Robert Kern
s unlikely that the bug is in Python. Let's bring it over to numpy-discussion. What version of numpy are you using? Can you give us a complete example that demonstrates the leak? -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terri

Re: Binary, Hex, and Decimal string conversions

2007-08-12 Thread Robert Dailey
Well, I decided to implement my own way of doing this. I've attached the source. You're all welcome :) On 8/12/07, Michael Bentley <[EMAIL PROTECTED]> wrote: > > Hi Robert, > On Aug 11, 2007, at 3:59 PM, Robert Dailey wrote: > > Hi, I was wondering if there is

Python script for mobile platforms -- suggested?

2007-08-12 Thread Robert Dailey
Hi, I'm currently developing a game for a cell phone. The game has a GUI system that's currently using XML to define the individual menus. Basically this means that for every single menu the user goes to, it loads and parses an XML file. Would using Python Script instead of XML be a reasonable rep

Re: Binary, Hex, and Decimal string conversions

2007-08-13 Thread Robert Dailey
Just curious Dick, why are you making your own to_base method? Doesn't the source I provided in my earlier email give you all that you need? I was hoping my source might be useful to a few people, even though it's pretty trivial code. On 8/12/07, Dick Moores <[EMAIL PROTECTED]> wrote: > > At 07:04

Problem with Thread.join()

2007-08-13 Thread Robert Dailey
Hi, I have a class that derives from threading.Thread. To signal the thread to exit its infinite loop, I set an Event. Once the thread checks Event.isSet() and it is true, it proceeds to break out of the loop and exit the function. In the main thread, right after calling Event.set(), I call Thread

Re: Python script for mobile platforms -- suggested?

2007-08-13 Thread Robert Dailey
*bump* On 8/12/07, Robert Dailey <[EMAIL PROTECTED]> wrote: > > Hi, > > I'm currently developing a game for a cell phone. The game has a GUI > system that's currently using XML to define the individual menus. Basically > this means that for every single menu the

Re: Car Air Conditioners

2007-08-13 Thread Robert Coe
On Mon, 13 Aug 2007 08:18:40 -, Lepi Duja <[EMAIL PROTECTED]> wrote: : All the informations about car air conditioners can be found on this : website... : : http://car-air-conditioning.blogspot.com/ It's hard to imagine anything more OT in this newsgroup, but FWIW my 2003 Kia has the most pow

Re: Python script for mobile platforms -- suggested?

2007-08-14 Thread Robert Dailey
he game to create the menu and other important things. I hope I've given enough examples and details. If I haven't, please let me know and I'll answer any questions you may have. Thanks for following up. On 8/13/07, Jay Loden <[EMAIL PROTECTED]> wrote: > > Robert Daile

Pass by reference or by value?

2007-08-16 Thread Robert Dailey
Hi, I previously created a topic named "Pass by reference or by value" where I inquired on how python's function parameters work. I received a lot of nice responses, however I'm still confused on the topic. Note that I come from a C++ background to Python, so any comparisons to C++ would be very h

Re: Pass by reference or by value?

2007-08-16 Thread Robert Dailey
an object of type class Integer would allow me to modify the value from inside the function? On 8/16/07, Steve Holden <[EMAIL PROTECTED]> wrote: > > Robert Dailey wrote: > > Hi, > > > > I previously created a topic named "Pass by reference or by value" where

Re: Pass by reference or by value?

2007-08-16 Thread Robert Dailey
( 5 ) def change_me( var ): var.set( 6 ) Of course, I'd probably use overloaded operators in a more realized example. On 8/16/07, Steve Holden <[EMAIL PROTECTED]> wrote: > > Robert Dailey wrote: > > So immutable objects cannot be modified directly? I guess this

Re: Problem with directory recursion!

2007-08-17 Thread Robert Dailey
older. The output is consistent with the 'print' statements you will see in the function I posted earlier. On 8/17/07, Robert Dailey <[EMAIL PROTECTED]> wrote: > > Hi, > > I've created a function that is used to recurse a directory tree in > Windows XP using os.

Problem with directory recursion!

2007-08-17 Thread Robert Dailey
Hi, I've created a function that is used to recurse a directory tree in Windows XP using os.walk(). For the most part it works, however in some instances the data is incorrect and I'm getting invalid sub-directory paths. Here's the function: def __doSearch( root_dir, sub_path, restype, ext ):

Re: Problem with directory recursion!

2007-08-17 Thread Robert Dailey
I figured it out. I was doing a recursive function call when I didn't have to. The walk() method already walks into every possible sub-directory for you! On 8/17/07, Robert Dailey <[EMAIL PROTECTED]> wrote: > > Here's part of the output that's incorre

Re: Array and floating point

2007-08-17 Thread Robert Kern
pend(float("0.1")) >>>> x[0] > 0.1000149011612 >>>> float("0.1") > 0.10001 > > I'm expecting x[0] = 0.10001 'f' denotes a single-precision floating point number. Python's float objects are double-precision fl

Question about 'for' loop

2007-08-17 Thread Robert Dailey
Hi, I noticed that the 'for' loop can be used inline with a list definition. For example: print [i for i in mylist] My first question is what is the name for this? I couldn't find this usage in the python docs; I only managed to learn about it through code samples on the internet. Secondly, I'm

str().join() isn't working

2007-08-20 Thread Robert Dailey
Hi, First have a look at the following code: In main.py: --- space = " " includes = space.join( system._user_includes ) + " " + space.join( system._system_includes ) In system.py: -

Re: Problem with Thread.join()

2007-08-20 Thread Robert Dailey
exiting! > > > On 8/20/07, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > > En Mon, 13 Aug 2007 20:10:53 -0300, Robert Dailey <[EMAIL PROTECTED]> > > escribi�: > > > > > I have a class that derives from threading.Thread. To signal the thread >

Re: str().join() isn't working

2007-08-20 Thread Robert Dailey
./../Symbian/9.1/NGAGE_SDK_1.1/EPOC32/include", "../../../../../../Symbian/9.1/NGAGE_SDK_1.1/EPOC32/include/osextensions/rga", "../../../../../../Symbian/9.1/NGAGE_SDK_1.1/EPOC32/include/osextensions/stdapis", "../../../../../../Symbian/9.1/NG

Re: Mouse control with ctypes in OS X

2007-08-20 Thread Robert Kern
uses this API. It's only available in OSX 10.4, however. http://developer.apple.com/documentation/Carbon/Reference/QuartzEventServicesRef/index.html -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt

Re: CIE Colorspace Conversions

2007-08-20 Thread Robert Kern
kern/cgi-bin/hgwebdir.cgi/lcms Let me know if there is anything I can do to make this code more useful to you. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco -- http://mail.python.org/mailman/listinfo/python-list

Re: str().join() isn't working

2007-08-20 Thread Robert Dailey
Hi all, Thanks for your response. I figured out the issue. I was using list.append() to append another list, when I should have been using expand(). Sorry for the confusion. On 8/20/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On Aug 20, 1:16 pm, "Robert Dailey" <[E

optparse - required options

2007-08-20 Thread Robert Dailey
Hi, I've been reading through the python documentation on the optparse module and I was unable to find out how to specify if an option is optional or required. The documentation vaguely states that actions can be used to do this, however I was not able to figure out how. If anyone could help I'd g

Re: Mouse control with ctypes in OS X

2007-08-20 Thread Robert Kern
Robert Kern wrote: > Googling around a bit more, however, I see that the Quartz Event Services is > documented and provides similar functionality. The DarwiinRemote project has a > mouse emulation mode for the Nintendo Wii controller that uses this API. It's > only available in

Re: optparse - required options

2007-08-20 Thread Robert Dailey
e it convenient. It would definitely help on code duplication. Thanks for your response. On 8/20/07, Jay Loden <[EMAIL PROTECTED]> wrote: > > Robert Dailey wrote: > > Hi, > > > > I've been reading through the python documentation on the optparse > > module and I was

Re: datetime in microseconds

2007-08-20 Thread Robert Dailey
A small off topic question. Why use divmod() instead of the modulus operator? On 8/20/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > On Aug 20, 4:17 pm, [EMAIL PROTECTED] wrote: > > On Aug 20, 3:15 pm, John Machin <[EMAIL PROTECTED]> wrote: > > > > > > > > > On Aug 20, 9:52 pm, [EMAIL PROTEC

Re: datetime in microseconds

2007-08-20 Thread Robert Kern
Robert Dailey wrote: > A small off topic question. Why use divmod() instead of the modulus > operator? Because he needed both the quotient and the remainder. % only gives you the remainder. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enig

Re: str().join() isn't working

2007-08-20 Thread Robert Dailey
Yeah! That's it lol. Sorry, I wasn't looking at the documentation. At least you got the point! Thanks again guys. On 8/20/07, Terry Reedy <[EMAIL PROTECTED]> wrote: > > > "Robert Dailey" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >

Python is removing my quotes!

2007-08-21 Thread Robert Dailey
Hi, Note: I'm using Python on Windows I have an application that allows a user to submit a password as a command line parameter. The password of choice may contain any characters the user wishes, including quotes. If I do the following: python password.py ""MyPassword The resulting output w

Re: Python is removing my quotes!

2007-08-21 Thread Robert Dailey
Thank you for your response. The back slashes work! It's a bit annoying; but I have Microsoft to thank for that. On 8/21/07, Gary Herron <[EMAIL PROTECTED]> wrote: > > Robert Dailey wrote: > > Hi, > > > > Note: I'm using Python on Windows > > > >

Tokenizer for python?

2007-08-21 Thread Robert Dailey
Hi, I am looking for a sort of "tokenizer" for python. I've taken a look at the tokenize module, but that seems to parse python code from what I read. I want a tokenizer that works a little like boost::tokenizer, however for python. Basically I want to be able to pass in an arbitrary string (or li

Re: Latest models of Gibson guitars

2007-08-21 Thread Robert Dailey
lol... On 8/21/07, Tony <[EMAIL PROTECTED]> wrote: > > I don't who is posting here stupid shit about guitars > who ever is do self fever hang your self with one of strings > > > "kaldrenon" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > On Aug 20, 8:54 pm, Twisted <[EMAIL PROTEC

Re: What Are These Import/From Statements about?

2007-08-22 Thread Robert Kern
W. Watson wrote: > Is there a single source that explains these statements? http://docs.python.org/tut/node8.html -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it

Class destruction

2007-08-22 Thread Robert Dailey
Hi, I'm wondering where the most appropriate location is to cleanup class objects. For example, i have a file handle as an instance attribute in one of my classes and I need to call f.close() on it when the class object falls out of scope. Any ideas? I've tried __del__() but I don't remember this

Re: What Are These Import/From Statements about?

2007-08-22 Thread Robert Kern
lob, bisect, and datetime are standard library modules. http://docs.python.org/modindex.html -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." --

Re: Class destruction

2007-08-22 Thread Robert Dailey
Thanks; I'll give it a try. On 8/22/07, Nils Oliver Kröger <[EMAIL PROTECTED]> wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Robert Dailey schrieb: > > Hi, > > > > I'm wondering where the most appropriate location is to cleanup cla

Re: What Are These Import/From Statements about?

2007-08-22 Thread Robert Kern
W. Watson wrote: > Thanks very much. Where's the global index? http://docs.python.org/modindex.html -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an und

Re: optparse - required options

2007-08-24 Thread Robert Dailey
Thank you VERY much for mentioning argparse- this is EXACTLY what I needed! Thank you! On 8/23/07, Steven Bethard <[EMAIL PROTECTED]> wrote: > > Omari Norman wrote: > > On Mon, Aug 20, 2007 at 05:31:00PM -0400, Jay Loden wrote: > >> Robert Dailey wrote: > >>>

Re: Co-developers wanted: document markup language

2007-08-24 Thread Robert Kern
Wildemar Wildenburger wrote: > Torsten Bronger wrote: >> Hallöchen! >> > Yes, you're German. Have you ever noticed that (we) Germans are > virtually the only ones that feel the need to rub our nationality into > everyones faces? ;) Howdy! We Americans do the sa

Re: Biased random?

2007-08-27 Thread Robert Kern
hem do what I need? > > That's weird. random.randint(a,b) will be enough for most cases. Test > your system to see the distribution is uniform with something like: The distribution is uniform. However, he wants a way to get non-uniform sampling of that list. -- Robert Kern "

Re: Gmane's been quiet ...

2007-08-29 Thread Robert Marshall
-via-gmane on gmane > before seeing the original post appear there I shall assume they've > been having some sort of issue. > See http://news.gmane.org/gmane.discuss for some discussion of this... Robert -- La grenouille songe..dans son château d'eau Links and things http://rmst

Re: list index()

2007-08-30 Thread Robert Kern
A that are not in directory B. > I have used exceptions in other languages and only do so on logic that > should never happen. Python is different than those languages. Exceptions are used much more frequently in Python and often for things that will *definitely* happen not just those things t

Re: subclassing Python types

2007-08-30 Thread Robert Kern
__init__() method on str. class MyString(str): def __init__(self, strInput): str.__init__(self, strInput) # ... other stuff -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpr

Re: Biased random?

2007-08-30 Thread Robert Kern
o the 0s stack. # # ### ### 0123 The method does not work because of that. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco -- http://mail.python.org/mailman/listinfo/python-list

Re: strings (dollar.cents) into floats

2007-08-30 Thread Robert Kern
I won't have problems. Binary floating point has the advantage of being widely implemented and quite fast compared to decimal floating point. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to inter

Re: status of Programming by Contract (PEP 316)?

2007-08-30 Thread Robert Brown
[EMAIL PROTECTED] (Alex Martelli) writes: > DbC and allegedly rigorous compile-time typechecking (regularly too weak > due to Eiffel's covariant vs countervariant approach, btw...), based on > those empirical results, appear to be way overhyped. My experience with writing Eiffel code was a bit di

Re: Biased random?

2007-08-31 Thread Robert Kern
Jeffrey Barish wrote: > Robert Kern wrote: > >> Ivan Voras wrote: >>> Jeffrey Barish wrote: >>> >>>> If you take the difference between two uniformly distributed random >>>> variables, the probability density function forms an isosceles tr

Re: Biased random?

2007-08-31 Thread Robert Kern
Jeffrey Barish wrote: > I'm sorry that I took the time to respond. I'm sorry. I didn't intend my post to be as harsh as it was. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to in

Re: Looking for Delaunay triangulation module...

2007-09-02 Thread Robert Kern
into a separate package. If you can remember what problems you had, I'd like to fix them. I'm clearing up a number of (really dumb) memory leaks. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad att

Re: Applying transformation matrix to 3D vertex coordinates

2007-09-03 Thread Robert Kern
t; 0.4294860.1897141.]] > > Am I going in the right direction? No. The reshape didn't do what you want it to. The elements will have the same order; it won't transpose the array. To do that, use the transpose() function. > What do I do with the result? :) When

Re: scipy.org website

2007-09-04 Thread Robert Kern
py-user/2007-September/013573.html -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco -- http://mail.python.org/mailman/listinfo/python-list

Rendering API for python?

2007-09-04 Thread Robert Dailey
Hi, I'm developing a quick python script to test an algorithm of mine. I would like to be able to plot the algorithm results to a diagram (much like you can do in Matlab). I was wondering if there's an API around that would allow me to quickly do this? Perhaps some sort of rendering API or plottin

Re: Rendering API for python?

2007-09-04 Thread Robert Dailey
Well, I guess I wrote too soon. I found this: http://matplotlib.sourceforge.net/ I'm going to try it out and see if it is what I'm looking for, however I'm pretty confident! On 9/4/07, Robert Dailey <[EMAIL PROTECTED]> wrote: > > Hi, > > I'm developing a qu

Re: Python and CUDO

2007-09-06 Thread Robert Kern
DA" rather than "NIVIDAS CUDO"). http://code.google.com/p/pystream/ -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -

Re: Python and CUDO

2007-09-07 Thread Robert Kern
Paddy wrote: > On Sep 6, 10:12 pm, Robert Kern <[EMAIL PROTECTED]> wrote: >> Veronika Lindstrand Kant wrote: >>> Hi! >>> I just wonder if there are any plans for building any support using >>> NIVIDAS CUDO plattform into python? >> Not into Pytho

Re: question on python syntax

2007-09-10 Thread Andrew Robert
a.m. wrote: > If I type this in shell > > $ ./yourfile.py 12:34 PM & > > What does '$', '.', '/' and '& means in this succession? Note: 12:34 > PM is a argument to the yourfile.py. > This not python syntax but Unix shell. $ = shell prompt ./= look for the program in my

Re: noob: reloading modified python file within Python Shell

2007-09-10 Thread Robert Kern
johnny wrote: > from people.models import * > > Now I make changes to the models.py. How do I reload this module in > Python Shell? import people.models reload(people.models) from people.models import * -- Robert Kern "I have come to believe that the whole world is an e

Re: Why is this loop heavy code so slow in Python? Possible Project Euler spoilers

2007-09-11 Thread Robert Brown
Neil Cerutti <[EMAIL PROTECTED]> writes: > On 2007-09-02, Steven D'Aprano > <[EMAIL PROTECTED]> wrote: >> A big question mark in my mind is Lisp, which according to >> aficionados is just as dynamic as Python, but has native >> compilers that generate code running as fast as highly >> optimized C.

<    19   20   21   22   23   24   25   26   27   28   >