fortepianissimo wrote:
> I have a simple xmlrpc server/client written in Python, and the client
> throws a list of lists to the server and gets back a list of lists.
> This runs without a problem.
>
> I then wrote a simple Java xmlrpc client and it calls the python
> server.
I have a simple xmlrpc server/client written in Python, and the client
throws a list of lists to the server and gets back a list of lists.
This runs without a problem.
I then wrote a simple Java xmlrpc client and it calls the python
server. But I can't figure out what type to cast the result (of t
Diez B. Roggisch wrote:
> fortepianissimo schrieb:
> > Is there a solution to enable Java programmers to call functions
> > written in Python? Any wrapper generator that wraps Python code into
> > some Java-callable form?
> >
> > I briefly looked at Jython, but if
Is there a solution to enable Java programmers to call functions
written in Python? Any wrapper generator that wraps Python code into
some Java-callable form?
I briefly looked at Jython, but if I understand it right, it didn't
support full power of Python 2.3.x (which I need).
Any suggestion is w
Kent Johnson wrote:
> Paul Boddie wrote:
> > Yes, Python does this - it puts the directory of bar.py (B in this
> > case) in sys.path, but not the directory in which you're sitting when
> > you run the program from the shell (A in this case).
>
> This seems to be OS dependent. If I put 'print sys.
Paul Boddie wrote:
> fortepianissimo wrote:
> > Hm this doesn't work. Say I have the following directory structure:
> >
> > A
> > |--- util
> > ||--- foo.py
> > |
> > |--- B
> > |--- bar.py
> >
> >
> > And bar.py
Interesting - Python seems to act differently under Windows then. Here
I'm using Python 2.4 on Mac OS X. With all of the files, directories
and command exactly like yours, it's still not working.
One thing I noticed is that you have this 'C:\\WUTemp\\A' when you
print sys.path in B/bar.py, but min
Hm this doesn't work. Say I have the following directory structure:
A
|--- util
||--- foo.py
|
|--- B
|--- bar.py
And bar.py has this line
from util import foo
I then run
python B/bar.py
in directory A. Still got error
ImportError: No module named util
A check of sys.path in bar
Ok I guess a little more "hunch" might be needed to elicit suggestions.
If I chose to put foo in A, is there a way for code in B to import foo
from A? Namely, is there a way to import stuff from a parent
directory/package?
If it's not possible without changing sys.path, what's the path of
least ef
Say I have the following package organization in a system I'm
developing:
A
|B
|C
|D
I have a module, say 'foo', that both package D and B require. What is
the best practice in terms of creating a 'common' package that hosts
'foo'? I want to be able to
- Testing modules in
Thank you very much for the prompt reply and the patch - I applied it
and everything is well now.
Looking forward to the update!
--
http://mail.python.org/mailman/listinfo/python-list
This is a question to all of you who use Komodo IDE for development:
when I tried to debug my script which uses __file__ to get the absolute
path to the file, Komodo complained that the variable is not defined.
Anyway to work around this? (without changing the code)
Or if I need to change the cod
To be complete, the first code snippet, when modified as follows, works
fine in Python 2.4.2:
--- START ---
#!/usr/bin/env python
import copy
class Foo (object):
__slots__ = ('i', )
def __init__ (self):
self.i = 10
class Bar (Foo):
__slots__ = ('j', )
def __init__ (self):
supe
Mystery solved - when there's only one slot I should've used __slots__
= ('i', ). Duh!
So in short, __slots__ and copy.copy() work fine in Python 2.4.2.
--
http://mail.python.org/mailman/listinfo/python-list
More weird observations: the following code does not work until you
change the name of the member 'longer' to a one-char name, for example,
'j':
--- START ---
#!/usr/bin/env python
import copy
class Foo (object):
__slots__ = 'i'
class Bar (Foo):
__slots__ = 'longer'
#__slots__ = 'j'
I should've mentioned this was tested on Python 2.4.2.
fortepianissimo wrote:
> I remember from painful experience that copy.copy() won't really copy
> __slots__ members. But I have trouble explaning why the following code
> works:
>
> --- START---
> #!/usr/bi
I remember from painful experience that copy.copy() won't really copy
__slots__ members. But I have trouble explaning why the following code
works:
--- START---
#!/usr/bin/env python
import copy
class Foo (object):
__slots__ = 'i'
def __init__ (self):
self.i = 10
class Bar (Foo):
_
Thanks Steve - actually my question was simpler than that. I just
wanted to use Daniels' recipe of lazy initialization on objects with
__slots__:
class Lazy(object):
def __init__(self, calculate_function):
self._calculate = calculate_function
def __get__(self, obj, _=None):
Thank you so much about this useful tip! I learned the new decorator
feature of 2.4 simply because of your post.
Unfortunately I don't have luxury right now to run Python 2.4 (for what
I'm doing anyways). You mentioned the way to do decorator in 2.3. Still
I have a question here. Here is Scott Dav
This seems to be what I need. My use case is to do lengthy
intialization as late as possible. In this case this is to initialize
class variables. Does this make sense?
Thank you.
--
http://mail.python.org/mailman/listinfo/python-list
We all know that using __getattr__() we can compute an instance
variable on demand, for example:
class Foo:
def __getattr__ (self, name):
if name == 'bar':
self.bar = 'apple'
return self.bar
else:
raise AttributeError()
Then we can
f = Foo()
s1 = f.bar
s2 = f.bar # this uses the "cached" resul
Problem solved:
from Carbon.File import *
fs, _, _ = ResolveAliasFile('/some/path', 1)
print fs.as_pathname()
--
http://mail.python.org/mailman/listinfo/python-list
This is a question only relevant to Mac OS X. Could someone offer a
simple example how to use Carbon.File module (perhaps
Alias.FSResolveAlias()?) to resolve an alias? Basically I'd like to
load in an alias file and find out which file/directory the alias
points to.
Thanks a lot!
--
http://mail.
23 matches
Mail list logo