build a syntax tree

2007-12-18 Thread Federico
Hi I've some trivial question: for exercise I want to parse a string that like this: "x -34 + 65 * 96 = 102" now if I had this ("(25+24)/2") is extremely easy to have a result but I want to resolve the above string (for the 'x' variable) what can I do? Especially for symbolic function I think

Subprocess and 16-bit FORTRAN

2007-11-22 Thread Federico Ceccatto
Hello, For the past year I've been building an XP Python/wxPython shell of sorts for several dozen command line FORTRAN tools developed for various material science problems. Given how the methods and how-to's have been lost to everyone but the original creators for these 80's to 90's pieces of co

Re: Generator slower than iterator?

2008-12-16 Thread Federico Moreira
The defaultdict option looks faster than the standard dict (20 secs aprox). Now i have: # import fileinput import sys from collections import defaultdict match_counter = defaultdict(int) for line in fileinput.input(sys.argv[1:]): match_counter[line.split()[0]] +=

Re: Generator slower than iterator?

2008-12-16 Thread Federico Moreira
2008/12/16 > Python 3.0 does not support has_key, it's time to get used to not using it > :) > Good to know line.split(None, 1)[0] really speeds up the proccess Thanks again. -- http://mail.python.org/mailman/listinfo/python-list

Generator slower than iterator?

2008-12-16 Thread Federico Moreira
min 20 seg Should i leave fileinput behind? Am i using generators with the wrong aproach? Thanks in advance, Federico. -- http://mail.python.org/mailman/listinfo/python-list

Re: Generator slower than iterator?

2008-12-19 Thread Federico Moreira
Great, 2min 34 secs with the open method =) but why? ip, sep, rest = line.partition(' ') match_counter[ip] += 1 instead of match_counter[line.strip()[0]] += 1 strip really takes more time than partition? I'm having the same results with both of them right now. -- http://mail.python.org

Re: Generator slower than iterator?

2008-12-19 Thread Federico Moreira
Yep i meant split sorry. Thanks for the answer! -- http://mail.python.org/mailman/listinfo/python-list

Re: Generator slower than iterator?

2008-12-20 Thread Federico Moreira
Wow, thanks again =) -- http://mail.python.org/mailman/listinfo/python-list

Re: python web programming for PHP programmers

2008-12-24 Thread Federico Moreira
You can try also web2py (http://mdp.cti.depaul.edu/) but i think you may be interested on http://www.modpython.org/ -- http://mail.python.org/mailman/listinfo/python-list

Objective Cairo

2006-03-22 Thread federico . pelloni
As pycairo is one of the less pythonish things I ever saw, it went into my mind to create some sort of objective wrapper over its python api making graphic manipulation much more coherent to the python way. As of the moment, I can: - create (and reorder) multiple layers (this is not present in th