butes):
attributeNames["AttributeName.%d" % (n+1)] = attribute
Then use a generator expression to feed the dict:
attributes = ['foo', 'bar']
attributeNames = dict(("AttributeName.%d" % (n+1), attribute)
for n, attribute in enumerate(attributes))
Hope this helps,
--
Amaury
--
http://mail.python.org/mailman/listinfo/python-list
File "/usr/src/sound.d/pyramid/pyramid.py", line 618, in len
> return _pyramid.MidiBytes_len(*args)
> TypeError: in method 'MidiBytes_len', argument 1 of
> type 'pyramid::MidiBytes *'
This message is typical of a swig object whos
ro facility.
But in this particular case, it is very simple. Just add:
o = outfile.write
after the variable outfile is initialized.
It is not a macro (just another name for a function object)
but it looks the same...
--
Amaury
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
John Nagle a écrit :
> dmitrey wrote:
>> howto make Python list from numpy.array?
>> Thx, D.
>>
>
> lst = map(None, arr)// for 1D arrays.
Which can be expressed more simply as:
lst = list(arr)
--
Amaury
--
http://mail.python.org/mailman/listinfo/python-list
python-list/2006-April/377070.html
The problem is that wxWidgets embeds its own copy of expat. You may have
to recompile either python or wxWidgets so that they use the same expat
version.
--
Amaury Forgeot d'Arc
--
http://mail.python.org/mailman/listinfo/python-list
should read the file PCBuild/readme.txt.
It explains how to build python from source, and has long explanations
about the same list of modules you are asking for.
And it works: I regularly use the debug build of python for my own projects.
--
Amaury Forgeot d'Arc
--
http://mail.python.org/mailman/listinfo/python-list
an instance of the previous class.
Voilà, it's not much.
In the hope that you can do something with it.
But don't give up. At the end, it works...
--
Amaury
--
http://mail.python.org/mailman/listinfo/python-list
iffers with your second example because the parentheses are
missing after the name "Class3".
- Your second example does not work as you say. 'var' is a local
variable and cannot be accessed from the outside. I suppose you actually
entered something like:
self.var="var"
which works indeed.
Again, it is difficult to guess what you are trying to do.
--
Amaury
--
http://mail.python.org/mailman/listinfo/python-list
:
print "no matching item"
return False
# ... continue with value
--
Amaury
--
http://mail.python.org/mailman/listinfo/python-list
d the following thread:
http://lists.wxwidgets.org/archive/wx-users/msg31855.html
or
http://lists.wxwidgets.org/archive/wx-users/msg31983.html
It suggest that you use another kind of control instead.
Is a disabled TextCtrl acceptable?
Hope this helps,
--
Amaury
--
http://mail.python.org/m
exe-users/3180430
It seems a regression since py2exe 0.6.5, already corrected in CVS trunk.
And according to another post, version 0.6.3 works fine:
http://permalink.gmane.org/gmane.comp.python.py2exe/1502
Hope this helps,
--
Amaury
--
http://mail.python.org/mailman/listinfo/python-list
w the class name. It does not appear in
the error traceback)
Depending on your architecture, this may be written this way:
import codepsyco
psyco.cannotcompile(codepsyco.YourClassHere.GET)
--
Amaury
--
http://mail.python.org/mailman/listinfo/python-list
rkaround, you should prevent psyco from optimizing the functions
calling render().
psyco.cannotcompile(web.djangoerror)
psyco.cannotcompile(??.GET)
P.S. I just had a look at the web.py code and it seems that there are
several uses of _getframe(x).f_locals. I find this trick not very
pythonic (a function's docstring even says:"""Guido van Rossum doesn't
want you to use this function.""") and anyway psyco will not appreciate it.
--
Amaury
--
http://mail.python.org/mailman/listinfo/python-list
o emit code specialized for the
actual data. It works by replacing blocks of code by other blocks,
optimized for the kind of data seen the previous times.
On the contrary, the code outside functions is run only once. You'll
never get the chance to run the optimized version again...
--
iable, and want to
call a function with the tree arguments:
args = (1,None,"Hello!")
func(args) # equivalent to func((1,None,"Hello!"))
func(*args) # equivalent to func(1,None,"Hello!")
Note the '*' on the second call, it will flatten the args,
3, 4], ['a', 'b', 'c', 'd', 'e']]
>
unzip() could be also be written like this:
def unzip(seq):
return zip(*seq)
Faster and nicer, isn't it?
Except that it returns a list of tuples:
>>>unzip(zip(range(5), 'abcde'))
[(0, 1, 2, 3, 4), ('a', 'b', 'c', 'd', 'e')]
--
Amaury
--
http://mail.python.org/mailman/listinfo/python-list
init__ directly calls
the C++ constructor, completely ignoring wxFrame.__init__.
The call to the superclass' constructor is done in C++.
Since replacing C++ method is much more difficult (if possible at all),
I'm afraid you will have to do the replacement you plan for every
derived class.
Ama
it__ directly calls
the C++ constructor, completely ignoring wxFrame.__init__.
The call to the superclass' constructor is done in C++.
Since replacing C++ method is much more difficult (if possible at all),
I'm afraid you will have to do the replacement you plan for every
derived class.
Amaury.
--
http
18 matches
Mail list logo