Re: Python object overhead?

2007-03-23 Thread Mark Nenadov
time units" open() iterator -> 0.41 "time units" -- Mark Nenadov -> skype: marknenadov, web: http://www.marknenadov.com -> "They need not trust me right away simply because the British say that I am O.K.; but they are so ridiculous. Microphones everywhere and planted

Re: Python object overhead?

2007-03-23 Thread Mark Nenadov
I don't think you can get around some overhead with the objects. However, in terms of generally efficiency not specifically related to object instantiation, you should look into xreadlines(). I'd suggest doing the following instead of that while loop: for line in open(sys.argv[1]).

Re: Randomizing in Python

2007-03-03 Thread Mark Nenadov
a random > experience database for a game. What would be necessary to do so? Look into the random module (http://docs.python.org/lib/module-random.html) random.choice selects a random item out of a sequence random.shuffle shuffles a sequence randomly random.random gives a random floating point

Re: Getting a module's byte code, how?

2005-02-02 Thread Mark Nenadov
de() ;-) > > --Irmen The inspect API documentation says that code objects have "co_code", which is a string of raw compiled bytecode. Hope that helps! - - Mark Nenadov Python Byte Solutions http://www.pythonbyte.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Finding user's home dir

2005-02-02 Thread Mark Nenadov
tried your function in my environment (Python 2.3.3 on Linux) and it returned the home directory properly - - Mark Nenadov Python Byte Solutions http://www.pythonbyte.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: What can I do with Python ??

2005-01-01 Thread Mark Nenadov
you make a full-screen game with it? Yes, most certainly--providing you have the skill/knowledge to program a full-screen game. But then again that is rarely a matter of having the right programming language, but rather a matter of having the right libraries. -- ~Mark Nenadov On Sat, 01 Jan 2005 21:5