[Tutor] Is there an easy way to conduct binary numbers?

2004-12-23 Thread Juan Shen
I have found there are easy functions and options to do basic octal and hexadecimal number operation. oct(...) oct(number) -> string Return the octal representation of an integer or long integer. hex(...) hex(number) -> string Return the hexadecimal representation of an integer or long integer.

Re: [Tutor] implementing a table data structure in python?

2004-12-21 Thread Juan Shen
Maarten, First of all, welcome to [EMAIL PROTECTED] I've done a little modification on Kent's code to make it more sensible. Please try it. Assuming the data file is 'mydata' $cat mydata 1 1 2 3 23 0.1 13 2 3 4 24 0.15 24 1

Re: [Tutor] Matrix

2004-12-19 Thread Juan Shen
Try SciPy. http://www.scipy.org/ It has mat class to handle matrix and much else. Juan Bugra Cakir wrote: hi, I want to create a matrix in Python. For example 3x4 how can i create this? thanks ___ Tutor maillist - [EMAIL PROTECTED] http://mail.pyt

Re: [Tutor] Vpython

2004-12-19 Thread Juan Shen
If you need to plot many math pictures, try SciPy     http://www.scipy.org/ I have galanced VPython's website and tutorial.  It seems it handles 3D-Plotting even better.     Juan Aztech Guy wrote: Hey, that's pretty good. Tried it out. VPython is cool too. --- "Jacob S." <[EMAIL PROTECTED]

Re: [Tutor] OT: Flow chart

2004-12-19 Thread Juan Shen
Brian van den Broek wrote: Alan Gauld said unto the world upon 2004-12-19 12:23: I'm looking for any good link or tutorial of flow charting A good resource for all notations related to software design is at smartdraw.com: http://www.smartdraw.com/exp/tec/tutorials/software.htm But flow charts a

Re: [Tutor] removedirs ?

2004-12-16 Thread Juan Shen
return 1 elif v=='C' or v=='c': return 2 else: print 'Take your input as No.' continue return 0 >>>from myrmtree import tree >>>top='/home/juan/test' #Your dir need

Re: [Tutor] removedirs ?

2004-12-16 Thread Juan Shen
Of course, shutil.rmtree() is a fast and direct method, but still a little warning, it could be dangerous. No warning and ensure will be raised while removing a tree of files. Juan Shen Kent Johnson wrote: You misunderstand what removedirs does. It removes an empty directory; then, if the

Re: [Tutor] am I missing another simpler structure?

2004-12-16 Thread Juan Shen
Kent, Bingle! Python's 'and' and 'or' operation only returns the right value (any kind of value: integer, string, list, excuting a function and so on) not Boolean value (True or False). It's a real fuzzy tip for beginners. See Chapter 4.6 of Dive into Python f

Re: [Tutor] AttributeError: instance has no __call__ method

2004-12-16 Thread Juan Shen
Juan Shen wrote: Marc Gartler wrote: Hi everybody, Prior to this chunk of code 'glass' has been chosen from a list of colors via user input, and I now want to have that choice connect to one of several possible classes: def glass_type(glasstype): if glasstype == 'Red&#x

Re: [Tutor] AttributeError: instance has no __call__ method

2004-12-16 Thread Juan Shen
Marc Gartler wrote: Hi everybody, Prior to this chunk of code 'glass' has been chosen from a list of colors via user input, and I now want to have that choice connect to one of several possible classes: def glass_type(glasstype): if glasstype == 'Red': myglass = RedGlassCost() el

Re: [Tutor] am I missing another simpler structure?

2004-12-16 Thread Juan Shen
e, then use it, modify its value and so on. If you choose Python, you should adapt to it that variable needn't to be defined specificly before being used! Juan Shen ___ Tutor maillist - [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] check_range

2004-12-15 Thread Juan Shen
I agree with Kent's opinion. A boolean statement, like 9>> ( 9 < value ) and ( value < 90 ) , maybe a good sense of boolean type will be made, because 'and' operation is always associating with boolean. Juan Shen 在 2004-12-15三的 07:43 -0500,Kent Johns