Question regarding Higher-Order-Programming in Python

2010-12-22 Thread Mark Fink
I am about to learn Higher-Order-Programming with Lisp, Haskell, and Python. Some people who have gone completely out of their mind call this FP. In Haskell I learned that when I use map on a list it starts nesting as soon as I start adding elements. If I do not like the nesting I use ConcatMap.

Re: Question regarding Higher-Order-Programming in Python

2010-12-22 Thread Mark Fink
list(chain.from_iterable(starmap(product, izip(izip(dims.iterkeys()), dims.itervalues() [('special', '+'), ('special', '-'), ('number', 1), ('number', 2), ('number', 3), ('letter', 'a'), ('letter', 'b')] Peter so far I have never noticed chain.from_iterable, but many thanks to you

Jython Pythonpath question

2006-02-21 Thread Mark Fink
Hi there, I have a source file FailFixture.py in the folder D:\AUT_TEST\workspace\JyFIT\testutil. Now I want to import the file with import testutil.FailFixture. Unfortunately I could not figure out how to set this up. I am convinced that D:\AUT_TEST\workspace\JyFIT should be included in the

Re: jython socket sendall

2006-02-21 Thread Mark Fink
I used send instead. This should work. -Mark -- http://mail.python.org/mailman/listinfo/python-list

jython socket sendall

2006-02-18 Thread Mark Fink
Hi there, I am about to port a server application from Java to Jython. For the socket part I found some examples written in Python. I have problems to figure out the socket part of the application. In Jython 2.1 the sendall function is missing? def establishConnection(self):

Re: Jython socket typecasting problems

2006-02-13 Thread Mark Fink
thanks to the help of this group I moved a tiny step forward. Obviously it is not possible to resolve name localhost: Type copyright, credits or license for more information. import socket s=socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(localhost, 8080) Traceback (innermost last):

Re: Jython inherit from Java class

2006-02-13 Thread Mark Fink
Hi Kent, many thanks for your help! In the meantime I received my Jython Essentials book and hope that I have much fewer questions in the near future. One last question for this thread. I tried to inherit from a Java class and override on method. I figured that this approach was nonsense because

Re: Jython inherit from Java class

2006-02-11 Thread Mark Fink
Please enlighten me. This seemed so easy yust inherit from a Java class overwrite one method - done. At the moment I do not know how to proceed :-(( Jython or jythonc? == In general is it better to run programms with the jython interpreter or is it better to compile them first? I

Jython socket typecasting problems

2006-02-11 Thread Mark Fink
I try to port a server application to Jython. At the moment I use Jython21\Lib\socket.py Currently I do face problems with casting the string localhost to the desired value: D:\AUT_TEST\workspace\JyFITjython fit/JyFitServer2.py localhost 1234 23 ['fit/JyFitServer2.py', 'localhost', '1234', '23']

Re: Jython inherit from Java class

2006-02-10 Thread Mark Fink
Alan, Kent, many thanks this really helped! But there is still a problem I guess with inheritance. I use the java testsuit supplied with the original to test the server. If I use the Java FitServer the testsuite can be completed. I commented everything out from my class and it does not work??

Re: Jython inherit from Java class

2006-02-10 Thread Mark Fink
I observed something strange when I tried to compile the jython class: D:\AUT_TEST\workspace\JyFIT\fitjythonc JyFitServer.py processing JyFitServer Required packages: fitnesse.util java.io java.net fitnesse.components* Creating adapters: Creating .java files: JyFitServer module

Jython inherit from Java class

2006-02-07 Thread Mark Fink
: self.exception(e) Please help, Mark Fink -- http://mail.python.org/mailman/listinfo/python-list

jython newbee general question docu / os.fstat

2006-02-05 Thread Mark Fink
Hi there, unfortunately I am new to Jython and my Jython Essentials book is still in the mail. I looked into the Jython API Doc but could not find the information. I am porting a Python library to Jython and some parts are missing. My question basically is where do I find information on what to

rexec in jython??

2006-02-05 Thread Mark Fink
Hi there, I at the moment port a library from Python to Jython (at lease I try to do so :-))). The library uses the Rexec to form a type adapter to cast parameters given as text into the according Jython type. I learned rexec is not available in Jython. Is something that is commonly used in Jython

rexec in jython??

2006-02-05 Thread Mark Fink
Hi there, I at the moment port a library from Python to Jython (at lease I try to do so :-))). The library uses the Rexec to form a type adapter to cast parameters given as text into the according Jython type. I learned rexec is not available in Jython. Is something that is commonly used in Jython

Re: rexec in jython??

2006-02-05 Thread Mark Fink
sorry for the double post! It is the r_eval() functionality of the rexec module I am looking forward to replace -- http://mail.python.org/mailman/listinfo/python-list

Re: rexec in jython??

2006-02-05 Thread Mark Fink
this is really funny... I tried to use eval(String) as an replacement. It works now but the calculation results from my tests are not as expected: 2 + 3 = 23 !!! 2 - 3 = 2-3... I have the feeling that there is a really easy solution for this. Unfortunately I have no enough experience --

Re: rexec in jython??

2006-02-05 Thread Mark Fink
This is the original code section of the library including the comments: class AutoAdapter(TypeAdapter): This adapter returns a type based on the format of the table cell contents, following python's rules for literals (plus a few others). We could fall back on this when we don't

Re: rexec in jython??

2006-02-05 Thread Mark Fink
:-))) it works! I replaced it to return eval(s) and the results look extremely well guess I should get one of this crystal balls myself. one minor issue is still left: correct me if I am wrong: result of 2/-3 is 0 (at least this is how it is defined in the testcase) In Jython 2.1.3: 2/-3 -1

jython how to use Fit and Fitnesse

2006-01-26 Thread Mark Fink
that it is possible to use Fitnesse and Java Fit and involve Jython testcases with this configuration but I do not know how. Perhaps someone from this group has done this before and wants to share some tipps with me. Cheers, Mark Fink http://www.mark-fink.de -- http://mail.python.org/mailman