Danny Yoo wrote:
>
> The code above is a demonstration of a representation of numbers using
> functions, more commonly known as "Church Numerals". Functions are very
> powerful. *grin*
>
>
> So the fundamental notation of number isn't necessarily tied down to
> anything except the operations
The function just mathematically converted a base-10 number into a
base-2 number.
> For what its worth - we say "base 10" to mean "decimal". But 10 =
> decimal only when we have already agreed we are talking decimal!
> Consider a planet where residents have 8 fingers. They count 0
>> What was the bug?
>
> If the stringifier saw two instances of the same object, it'd think that
> recursion was going on. Unfortunately, since the numbers between 1-100
> are typically interned (as well as strings), it'd also think that if I
> visited "0" twice,that I was in a recursive loop
>>> I should, though, rephrase the signature as:
>>>
>>>register: object str_function -> string or None
>>>
>>> to be more readable. Separately, I can then define that a 'str_function' is
>>> a callable that takes anything and turns it into a string.
>>
>> Ok, I made those changes. I've also
Thanks for the great feedback! I was missing the whole "methods that share the same data" aspect of a class.. Thats makes them MUCH more clear to understand. Thanks for both of you having the patience to help me figure this out =D Time for me to ditch the classes from my
pyForge.py!On 11/11/06, Al
Chris,
>I guess I'm just lost as to the point of classes... Outside of using
>them to
> abstract a collection of methods that have similair roles
Most people get hung up on the data aspect of classes
and forget that the behaviour(the methods) are actually
the most important bit. However you have
Bob Gailer wrote:
> Luke Paireepinart wrote:
The function just mathematically converted a base-10 number into a
base-2 number.
> For what its worth - we say "base 10" to mean "decimal". But 10 =
> decimal only when we have already agreed we are talking decimal!
> Consider a
Chris Hengge wrote:
> I guess I'm just lost as to the point of classes... Outside of using
> them to abstract a collection of methods that have similair roles I
> dont see the point.. But when I group similar methods together
> (promptForge is a bad example, but I've got class fileForge which ha
Luke Paireepinart wrote:
>>> The function just mathematically converted a base-10 number into a
>>> base-2 number.
>>>
For what its worth - we say "base 10" to mean "decimal". But 10 =
decimal only when we have already agreed we are talking decimal!
Consider a planet where residents have
I need to do some automated checkouts of CVS projects from Python scripts, and want ot be able to handle success and failure conditions.While sending the command lines to cvs isn't a problem, I could use some suggestions for how to check the cvs responses.
Parsing the text returned from CVS isn't
I guess I'm just lost as to the point of classes... Outside of using them to abstract a collection of methods that have similair roles I dont see the point.. But when I group similar methods together (promptForge is a bad example, but I've got class fileForge which has a few file writing or reading
I'm using, perhaps misusing numpy which is eating up the memory and, eventually
crashing my program.
Isolating it, the following piece of code continually eats memory. Is it my
program or what ...?
Thanks
Joel Levine
Using Mac OSX 10.4.7
Not clear on versions: Appears to be 0.9.8 with py2.4
Okay, so let's see where we are.
Integers, as well as strings, and everything else, are stored in memory
as binary.
This is a given, because the architecture of the computer is binary.
You say 'the string representation of the integer is in base-10.'
Okay, well, python's representation of any obje
Luke Paireepinart wrote:
> Kent Johnson wrote:
>> Luke Paireepinart wrote:
>>> I was trying to make it clear that Python wasn't directly accessing
>>> the binary from memory with this function Carlos had.
>>> The function just mathematically converted a base-10 number into a
>>> base-2 number.
>>
Kent Johnson wrote:
> Luke Paireepinart wrote:
>> I was trying to make it clear that Python wasn't directly accessing
>> the binary from memory with this function Carlos had.
>> The function just mathematically converted a base-10 number into a
>> base-2 number.
>
> No. It converts a binary repre
Luke Paireepinart wrote:
> I was trying to make it clear that Python wasn't directly accessing the
> binary from memory with this function Carlos had.
> The function just mathematically converted a base-10 number into a
> base-2 number.
No. It converts a binary representation of a number into a
Kent Johnson wrote:
> Luke Paireepinart wrote:
>
>> > working>
>
> I think you are a bit confused here.
>
Quite possible!
> It's important to make a distinction between the way a number is
> actually stored in the computer and the string that is created when a
> number is printed.
>
> Most
"Asrarahmed Kadri" <[EMAIL PROTECTED]> writes:
> fd.write(e)
fd.close()
>
>
i hope it helps
regards,
SK
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
"Asrarahmed Kadri" <[EMAIL PROTECTED]> writes:
>
> fd.write(e)
>
>
add: fd.close() to your code
I hope it helps
regards,
SK
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Hi Folks,
I am trying to create a XML document and then writing it to a file, But the porblem is that I have to run the program twice before the contents are written to the file. Can you explain the reason for such a strange behaviour ?? The code is as below:
from elementtree import Eleme
picio_slug wrote:
Hello,
what are the equivalent Pyhton tools you suggest to handle:
SAX
DOM
and which api for XSLT ?
I know that this is a really newbie question...But I'm a true python newbie ;) !
Daniele
P.s: I know I can also google-it a little bit to find those answers
but your advices
Marcus Goldfish wrote:
> Hoping someone can help with this...
>
> I have a logical python namespace using a directory tree and __init__.py
> files. For example, PYTHONPATH points to ~pyroot, and I have the following:
>
> ~pyroot/
> ~pyroot/utils/
> ~pyroot/utils/commands/mygrep.py
>
> Which ma
johnf wrote:
> Hi
> I'm working on a python interface to freetds. And freetds can access MS SQL
> database engines. But I'm having trouble with datatime datatypes.
>
> The python module I'm using is MSSQL.py written back in 2003. After getting
Why are you using such an old version?
> it c
Luke Paireepinart wrote:
>
>> But probably (surely) my interpretation is wrong. Hehe
>>
> Ah, well, it's just the terminology you were using was a bit misleading.
> You say
> ' Hey Rooy, so its possible to copy binary numbers from memory?'
> All his function does is converts an integer (that's
Danny Yoo wrote:
>> I should, though, rephrase the signature as:
>>
>>register: object str_function -> string or None
>>
>> to be more readable. Separately, I can then define that a 'str_function' is
>> a callable that takes anything and turns it into a string.
>
> Ok, I made those changes.
doug shawhan wrote:
> I'm having some difficulties with elementtree as well.
>
> I'm attempting to parse a fairly sizeable xml file (it's the ebay
> "category tree" report. I've cached a copy at
> http://www.crackrabbit.com/misc/CatTree.xml). 900K or so! :-)
> I've made a smaller version that I
Chris,
>pyForge.promptForge.prompt()
> TypeError: unbound method prompt() must be called with promptForge
> instance
> as first argument (got nothing instead)
>
> ^ Thats why... I have to use :
> import pyForge
> pyForge.promptForge().prompt()
I think the real issue that Luke was raising was
Oops... should have said this... pyForge.promptForge.prompt()TypeError: unbound method prompt() must be called with promptForge instance as first argument (got nothing instead)
^ Thats why... I have to use :import pyForgepyForge.promptForge().prompt()On 11/11/06, Chris Hengge <
[EMAIL PROTECTED]
>So why did you use two sets of parenthesis here?>Are you completely sure you understand everything that's happening here? pyForge.promptForge.prompt()TypeError: unbound method prompt() must be called with promptForge instance as first argument (got nothing instead)
^ Thats why... I have to use
29 matches
Mail list logo