How is this code going to look like in Python 3.0? (it's deprecated
according to http://docs.python.org/library/new.html#module-new, but
it does not tell what to use instead)
method = new.instancemethod(raw_func, None, cls)
setattr(cls, name, method)
Can we write code in python2.5/2.6 that will
Hi,
I am a big fan of ZODB and use it stand alone on many project of mine.
One of the things I miss is a community around it. I don't care much
about ZOPE (though I admire it) and have not being able to find a
ZODB focused community. Is there one?
thanks
--
http://mail.python.org/mailman/listi
it possible
that in a read, the method return a value that is not an old or a new value?
In other words, is it possible that a 'read' return (due to a 'write' at the
same time by another thread) an invalid value that was never supposed to be
there?
Thanks,
Flavio Preto
--
ht
Hi, I have been playing with set operations lately and came across a
kind of surprising result given that it is not mentioned in the
standard Python tutorial:
with python sets, intersections and unions are supposed to be done
like this:
In [7]:set('casa') & set('porca')
Out[7]:set(['a', 'c'])
I use VIM here too. Mainly because i always switch from Windows to Linux and
using the same text editor is a way to avoid getting crazy.
[]'s
Preto
On 9 May 2007 15:21:41 -0700, BartlebyScrivener <[EMAIL PROTECTED]>
wrote:
On May 9, 1:26 pm, "Looney, James B" <[EMAIL PROTECTED]> wrote:
> I'm
Is it not possible to acomplish this with a token-based algorithm?
With 3 Threads: A, B and C
Thread A start with Token.
Thread with the token writes the byte and send the token to the next
Or python has any issues to a file object shared among a few threads?
[]'s
Flavio
On 5/6/07,
).
The trivial solution that i've imagined is to save to a config file the
current status of the window, but i wish that PyGTK automatic handled this
for me.
Thanks,
Flavio
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 22, 2:04 pm, "Paul Boddie" <[EMAIL PROTECTED]> wrote:
> On 22 Feb, 16:13, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
>
>
>
> > Darn. You're right of course - I just got the basic idea, and formed in my
> > mind the "get the modules filename, thus the path, glob over it for *py,
> > and th
On Feb 22, 12:51 pm, "Flavio" <[EMAIL PROTECTED]> wrote:
> On Feb 22, 12:36 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
>
>
>
> > > Simple plugin system proposal:
>
> > > have a package (directory with __init__.py) called plu
On Feb 22, 12:36 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> > Simple plugin system proposal:
>
> > have a package (directory with __init__.py) called plugins where the
> > actual plugins are modules in this directory.
>
> > When the main script imports the plugins package, all plugin modul
On Feb 22, 10:53 am, "Flavio" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Nowadays the addition of functionality to programs by means of
> plugins is very frequent.
>
> I want to know the opinions of experienced Python developers about the
> best practices when it c
On Feb 22, 11:01 am, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote:
> On 22 Feb 2007 04:53:02 -0800, Flavio <[EMAIL PROTECTED]> wrote:
>
> >Hi,
>
> >Nowadays the addition of functionality to programs by means of
> >plugins is very frequent.
>
> >I
On Feb 22, 11:00 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> Flavio wrote:
> > Hi,
>
> > Nowadays the addition of functionality to programs by means of
> > plugins is very frequent.
>
> > I want to know the opinions of experienced Pytho
On Feb 22, 9:49 am, [EMAIL PROTECTED] wrote:
> I don't know to which forum should I post the message
> I hope someone related to the Python kernel development will read &
> consider the idea
> I'm (a former? meanwhile not sure) MATLAB user & it's very annoing
> typing each time for example
> while
Hi,
Nowadays the addition of functionality to programs by means of
plugins is very frequent.
I want to know the opinions of experienced Python developers about the
best practices when it comes to developing a plugin system for a
Python package.
Should plugins be modules in a separate package?
S
Hi,
sorry for posting here, but the forum in the projects page is not
working. Maybe there is a gdesklet developer lurking... :-)
I cant import anything from a script, it gives me a runtime error.
is this a bug or a feature?
without being able to import from python standard library or other
mo
obvious bug.
On Jan 25, 4:39 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote:
> On 24 Jan 2007 16:25:19 -0800, "Flavio" <[EMAIL PROTECTED]> declaimed
> the following in comp.lang.python:
>
>
>
> > something like this, for instance:
> >http://.wikip
raise UnicodeError, "label too long"
UnicodeError: label too long
very strange, because I tried other unicode urls from the python
console like this
urllib2.urlopen(u'www.google.com')
and it works normally:
Martin v. Löwis escreveu:
> Flavio schrieb:
> > What I a
This is bad, since some links do contain strings with non-ascii
characters.
thanks,
Flávio
Marc 'BlackJack' Rintsch escreveu:
> In <[EMAIL PROTECTED]>, Flavio wrote:
>
> > Hi I am havin a problem with urllib2.urlopen.
> >
> > I get this error when
Hi I am havin a problem with urllib2.urlopen.
I get this error when I try to pass a unicode to it.
raise UnicodeError, "label too long"
is this problem avoidable? no browser or programs such as wget seem to
have a problem with these strings.
--
http://mail.python.org/mailman/listinfo/python-li
! isn't this great?
thanks for all the help you provided. I couldn't have done it without
it.
Cheers,
Flávio
Robert Kern wrote:
> Flavio wrote:
> > Ok,
> >
> > I tried that and it seems we are making progress
> >
> > so here is my command:
> >
ad of mingw32 it does not work!!
So all that remains now is to be able to do it from the setup.py...
thanks again...
Robert Kern wrote:
> Flavio wrote:
> > Ok,
> >
> > I tried that and it seems we are making progress
> >
> > so here is my command:
> >
>
Ok,
I tried that and it seems we are making progress
so here is my command:
python setup.py build_ext --compiler=mingw32 --fcompiler=gnu
Now it is complaining about my pyf!!
error: unknown file type '.pyf'
here is my setup .py:
import setuptools, os
from numpy.distutils.core import setup, Ex
Framework SDK needs to be installed before building
extensions for Python.
any further help will be greatly appreciated...
Thanks again,
Flávio
Robert Kern wrote:
> Flavio wrote:
> > Its been a while since i Tried this and right now I have no access to a
> > windows
> > mac
is a setup.py tailored to compile an f2py
extension on windows. Have you got one of these? if so please send it
to me and I can certainly figure out the rest.
thanks,
Flavio
Robert Kern wrote:
> Flavio wrote:
> > Hello,
> >
> > Compiling f2py extensions in Linux is a trivi
Hello,
Compiling f2py extensions in Linux is a trivial task, You can even
automate it with distutils. Now, in a Windows machine this does not
seem to be an easy task. At least, I could not find any decent tutorial
on how to do it.
Is there a way to do this? Can some one point me to a tutorial.,
; /tmp/tmpIkxhAr/src.linux-i686-2.4
adding '/tmp/tmpIkxhAr/src.linux-i686-2.4/flib-f2pywrappers.f' to
sources.
running build_ext
error: don't know how to compile C/C++ code on platform 'posix' with
'/opt/xmingw/bin/i386-mingw32msvc-gcc' compiler
any further sugg
Craig-Wood wrote:
> Flavio <[EMAIL PROTECTED]> wrote:
> > has anyone tried to build extensions for win32 on Linux using
> > xmingw?
>
> I don't know about xmingw, but we use mingw on linux to compile stuff
> for windows all the time. (We use the mingw packag
Flavio wrote:
> Hi,
>
> has anyone tried to build extensions for win32 on Linux using xmingw?
>
> I need to use f2py to compile code for the win32 platform and I want to
> do this in Linux. I googled aroung but could not find any documentation
> on this.
>
> For thos
Hi,
has anyone tried to build extensions for win32 on Linux using xmingw?
I need to use f2py to compile code for the win32 platform and I want to
do this in Linux. I googled aroung but could not find any documentation
on this.
For those who dont know xmingw is a port to linux of mingw.
any hel
It was human error...
I found the bug...
thanks,
Laszlo Nagy wrote:
> Flavio írta:
> > Hi,
> >
> > I have a miniframe composed mainly of combo boxes, that I need to
> > destroy and recreate multiple time with different choice lists for the
> > combo boxes.
>
its previous incarnation...
how can I completely destroy a miniframe?
Flavio
--
http://mail.python.org/mailman/listinfo/python-list
My application needs needs matplotlib. So cx_Freeze bundles it in. But
it only bundles matplotlib python modules, not its data files!
In the original machine I believe that the frozen executable is somehow
finding those datafiles in their original locations, which is not
desirable, ecause the bund
I am trying to freeze an application which imports matplotlib. It all
works fine on the machine where it was frozen. The executable runs
without a glitch.
But when I move the directory containing the frozen executable and
other libs to a new machine, I get the following error:
Traceback (most re
I know, but the whole point of cx_freeze is to generate standalone
executables, so asking for an installation of an specific version of Qt
is just a little better than asking the end user to install from
source...
--
http://mail.python.org/mailman/listinfo/python-list
Well I managed to get rid of the undefined symbol message by copying
all qt libs to the freeze directory, the problem is that now the
package is huge (83MB)!
So my question is: is there a way to find out exactly which lib is
missing ?
Thanks
--
http://mail.python.org/mailman/listinfo/python-lis
Thanks for the hint. I'll try to get cx_freeze to bundle up other
shared libraries it may not be bundling such as qtcanvas, qtext, qtui,
etc. and see if it works.
I'll post back the results to help other poor souls like me.
Thanks
--
http://mail.python.org/mailman/listinfo/python-list
eback (most recent call last):
File
"/home/fccoelho/Downloads/cx_Freeze-3.0.2/initscripts/Console.py", line
26, in ?
File "epigrass.py", line 4, in ?
ImportError: /home/flavio/freeze/qt.so: undefined symbol:
_ZNK9QSGIStyle9classNameEv
It is looking for the Original cx_freeze in
With so many object relational mappers out there, I wonder which one is
the preferred tool among the Pythonists... is there a favourite?
Sqlobject, PyDO, SQLAlchemy, dejavu, etc...
--
http://mail.python.org/mailman/listinfo/python-list
> Who has created these items? Obviously you, so you _can_ store the list
> of selected items.
well yeah, but the Idea was to let the user select(through the widget)
a subset of the original list and then access that subset...
> Or you use the equally well documented QListViewItemIterator to trav
Iterating over the items and checking if it is selected, sounds like a
good idea, but there no obvious way to get a hold of the list of
items!! The only way you can get an item is if you are in single
selection mode and you call selectedItem(). But I have to use multiple
selection mode, for which
that end.
Any PyQt guru lurking around?
should I try some other list widget, that has a "getSelected()"method?
Is there one?
any help will be appreciated.
Flavio
--
http://mail.python.org/mailman/listinfo/python-list
> If you have a function f and want to make an instancemethod out of it,
> you can simply call f.__get__(theinstance, theclass) and that will build
> and return the new instancemethod you require.
I think that
f.show = MethodType(show,f)
is less cryptic than f.__get__(instance, class)
Flávio
> First of all,why do you think the new module is deprecated? (I can't
> find anything in the docs to indicate this.)
Its in the docs of python 2.4. I dont know about older versions:
Help on module new:
NAME
new - Create new objects of various types. Deprecated.
FILE
/usr/lib/python2.
Addendum to my last reply:
although the New Method is deprecated,
new.instancemethod (from Antoon's message) can be replaced by
from types import MethodType
f.show = MethodType(show,f)
and every thing still works.
--
http://mail.python.org/mailman/listinfo/python-list
This "new" module sounds pretty cool, too bad its deprecated...
I would not want to add a dependancy to a deprecated module in my code.
But maybe I'll check the code for instancemethod within it and see what
it does.
Flávio
--
http://mail.python.org/mailman/listinfo/python-list
There only one puzzle left to solve:
altough the solution I proposed works, this variant has problems:
>>> class Foo:
name='John'
>>> a=Foo()
>>> def p():
print 'Hi, %s!'%self.name
>>> a.met=p
>>> a.met.self = a
>>>a.met()
NameError: global name 'self' is not defined
Thi
If you read my original post, I had no intention of atributing the
user's method to the class, but to the instance.
Anyway I figure it out myself, and its quite a Pythonic solution:
>>> class Foo:
name='John'
>>> a=Foo()
>>> def p(parent):
self=parent
print 'H
Because, by the time the user function is imported and attributed to
the custom method, soandso has already been instantiated and contains
the information tha needs to accessed by the user's function.
--
http://mail.python.org/mailman/listinfo/python-list
hi,
I have an object defined with a number of hardcoded methods.
Class soandso:
def __init__(self):
self.this = 0
self.that = 1
def meth1(self):
...
def meth2(self):
...
def custom(self):
pass
I want to allow the user to write a python modu
to have to refer to them as
variables['whatever']...
dont you think?
Flavio
--
http://mail.python.org/mailman/listinfo/python-list
I wish all my problems involved just a couple of variables, but
unfortunately the real interesting problems tend to be complex...
As a last resort this problem could be solved by something like this:
def fun(**kw):
a = 100
for k,v in kw.items():
exec('%s = %s'%(k,v))
print loc
Ok,
I got it!
Its vey insecure, and it is not guaranteed to work. Fine.
Now what would you do if you wanted to pass a lot of variables (like a
thousand) to a function and did not wanted the declare them in the
function header?
Flávio
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I heard time and again that you are not _supposed_ to update the
locals dictionary.
Can anyone tell me why, if the following code works, I should not do
this?
#
# Extending Local namespace
#
def fun(a=1,b=2,**args):
print 'locals:',locals()
locals().update(args)
pr
hi,
is there a faster way to build a circular iterator in python that by doing this:
c=['r','g','b','c','m','y','k']
for i in range(30):
print c[i%len(c)]
thanks,
Flávio
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] (Flavio codeco coelho) wrote in message news:<[EMAIL
PROTECTED]>...
> struct.unpack returns a tuple of values represented by a string(the
> output of the read command) packed according to the format specified
> by ">BB"
> In this forma st
[EMAIL PROTECTED] (Bengt Richter) wrote in message news:<[EMAIL PROTECTED]>...
> On 9 Jan 2005 14:13:28 -0800, [EMAIL PROTECTED] (Flavio codeco coelho) wrote:
>
> >Hi,
> >
> >I am using pyserial to acquire data from an A/D converter plugged to
> >my serial
I have a program that uses pythondialog for its UI.
Pythondialog is a wrapper of the shell dialog and xdialog libs.
But I would like for it to switch between using Dialog ( when X is not
available ) and xdialog (when X is available)
So my question is: how can I check for the availability of X?
second
byte is different than the one he used. Since hex numbers get me all
confused (and python doesn't convert to binary), I was wondering which
one is the correct masking...
thnaks,
Flavio
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] (Michael Fuhr) wrote in message news:<[EMAIL PROTECTED]>...
> If the actual byte and/or bit order is different then you'll have
> to modify the expression, but this should at least give you ideas.
Hi Michael,
It all looks pretty god but there is a couple of things I still don't
ASAP, meanwhile, could you point me to
references to these bit operations in Python? I am new to this stuff,
and might need to do more of this to support other hardware...
I havent been able to find anything about this on the python
documentation..
Thanks a lot!!
Flavio
--
http://mail.pytho
Hi,
I am using pyserial to acquire data from an A/D converter plugged to
my serial port.
my hardware represents analog voltages as 12bit numbers. So, according
to the manufacturer, this number will be stored in two bytes like
this;
|-bits(1-8)---|
Byte1: x x x n1
62 matches
Mail list logo