Re: Java to Python autoconverters

2015-06-12 Thread Mark Lawrence
On 12/06/2015 12:36, Sebastian M Cheung via Python-list wrote: Are these available? Any good ones to recommend? Yes and no. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence --

Re: Java to Python autoconverters

2015-06-12 Thread Stefan Behnel
that should be reasonably maintainable. If you want to integrate Python code with Java code, take a look at Jython instead. If that's not what you want, then feel free to unveil your intentions. Stefan -- https://mail.python.org/mailman/listinfo/python-list

Java to Python autoconverters

2015-06-12 Thread Sebastian M Cheung via Python-list
Are these available? Any good ones to recommend? -- https://mail.python.org/mailman/listinfo/python-list

Re: Java to Python autoconverters

2015-06-12 Thread Ian Kelly
, whereas you now (hopefully) have somewhat idiomatic Java code that should be reasonably maintainable. If you want to integrate Python code with Java code, take a look at Jython instead. If that's not what you want, then feel free to unveil your intentions. I've also found Jpype useful

Re: Java to Python autoconverters

2015-06-12 Thread Michael Torrie
On 06/12/2015 05:36 AM, Sebastian M Cheung via Python-list wrote: Are these available? Any good ones to recommend? The only use case for such a program that I can think of is a compiler that is just using another language as an intermediate step, and that language is usually going to be compiled

Pyrolite - a lightweight interface library to connect java to python

2011-07-16 Thread Irmen de Jong
Hi, What's a java interface library doing in comp.lang.python, you might ask. Well, this one, called 'Pyrolite' is meant to be a lightweight library (50kb) to interface your java application to Python in a very easy and straightforward way. Pyrolite uses the Pyro protocol to call methods

Re: Passing array from java to python

2011-06-03 Thread Marco Nawijn
problem, some bi-directional communication between Java and Python. Several options were discussed between me and my fellow programmer. In the end we settled for XML- rpc. It works remarkably well in our case. We use it to pass test and simulation data to GUI code. XML-rpc is very well supported

Passing array from java to python

2011-06-02 Thread loial
I need to pass some sort of array or hashmap from Java and read the data in a python script (which will be called by the java class). Is there any neater way to do this other than just passing strings? -- http://mail.python.org/mailman/listinfo/python-list

Re: Passing array from java to python

2011-06-02 Thread Chris Rebert
On Thu, Jun 2, 2011 at 2:54 AM, loial jldunn2...@gmail.com wrote: I need to pass some sort of array or hashmap from Java and read the data in a python script (which will be called by the java class). Is there any neater way  to do this other than just passing strings? Jython?:

Re: Passing array from java to python

2011-06-02 Thread loial
Unfortunately using jpython or json are not options at the moment -- http://mail.python.org/mailman/listinfo/python-list

Re: Passing array from java to python

2011-06-02 Thread Nitin Pawar
can you execute the java code from python and get the result stored as python variable os.system() On Thu, Jun 2, 2011 at 4:17 PM, loial jldunn2...@gmail.com wrote: Unfortunately using jpython or json are not options at the moment -- http://mail.python.org/mailman/listinfo/python-list

Re: Passing array from java to python

2011-06-02 Thread Chris Rebert
On Thu, Jun 2, 2011 at 3:47 AM, loial jldunn2...@gmail.com wrote: Unfortunately using jpython or json are not options at the moment What rules out JSON that does not also rule out the just passing strings approach? What about (*shudder*) XML? (Can't believe I just said that...) Cheers, Chris

Re: Passing array from java to python

2011-06-02 Thread Ian Kelly
On Thu, Jun 2, 2011 at 4:47 AM, loial jldunn2...@gmail.com wrote: Unfortunately using jpython or json are not options at the moment How about JPype? Or do the Java and Python need to be in separate processes? -- http://mail.python.org/mailman/listinfo/python-list

Re: Converting getCSS Count Code from java to python

2011-02-17 Thread SMERSH009
On Feb 2, 7:03 am, Duncan Booth duncan.bo...@invalid.invalid wrote: Stefan Behnel stefan...@behnel.de wrote: You are using Selenium RC here. I have no idea if there is a Python API to it or what that API looks like. The rest is just trivial code that you can map 1:1 to Python:      def

Re: Converting getCSS Count Code from java to python

2011-02-17 Thread Stefan Behnel
SMERSH009, 17.02.2011 22:46: am still stuck with the following error when I try to print self.count_css_matches('css=[id=listGuests]') I've also included the Selenium code below. Any further help would be appreciated. Traceback (most recent call last): File

Re: Converting getCSS Count Code from java to python

2011-02-17 Thread SMERSH009
On Feb 17, 9:51 pm, Stefan Behnel stefan...@behnel.de wrote: SMERSH009, 17.02.2011 22:46: am still stuck with the following error when I try to print self.count_css_matches('css=[id=listGuests]') I've also included the Selenium code below. Any further help would be appreciated.

Re: Converting getCSS Count Code from java to python

2011-02-17 Thread Stefan Behnel
SMERSH009, 18.02.2011 07:25: On Feb 17, 9:51 pm, Stefan Behnel wrote: SMERSH009, 17.02.2011 22:46: class Untitled(unittest.TestCase): def count_css_matches(self, css_locator): java_script_code = ''' var cssMatches = eval_css(%s, window.document);

Re: Converting getCSS Count Code from java to python

2011-02-17 Thread SMERSH009
On Feb 17, 10:25 pm, SMERSH009 smersh0...@gmail.com wrote: On Feb 17, 9:51 pm, Stefan Behnel stefan...@behnel.de wrote: SMERSH009, 17.02.2011 22:46: am still stuck with the following error when I try to print self.count_css_matches('css=[id=listGuests]') I've also included the

Re: Converting getCSS Count Code from java to python

2011-02-02 Thread Jon Clements
On Feb 1, 4:23 am, SMERSH009 smersh0...@gmail.com wrote: Hi, I'd love some help converting this code to the python equivalent: private int getCSSCount(String aCSSLocator){     String jsScript = var cssMatches = eval_css(\%s\, window.document);cssMatches.length;;     return

Re: Converting getCSS Count Code from java to python

2011-02-02 Thread Stefan Behnel
SMERSH009, 01.02.2011 05:23: Hi, I'd love some help converting this code to the python equivalent: private int getCSSCount(String aCSSLocator){ String jsScript = var cssMatches = eval_css(\%s\, window.document);cssMatches.length;; return

Re: Converting getCSS Count Code from java to python

2011-02-02 Thread Duncan Booth
Stefan Behnel stefan...@behnel.de wrote: You are using Selenium RC here. I have no idea if there is a Python API to it or what that API looks like. The rest is just trivial code that you can map 1:1 to Python: def count_css_matches(css_locator): java_script_code = '''

Converting getCSS Count Code from java to python

2011-01-31 Thread SMERSH009
Hi, I'd love some help converting this code to the python equivalent: private int getCSSCount(String aCSSLocator){ String jsScript = var cssMatches = eval_css(\%s\, window.document);cssMatches.length;; return Integer.parseInt(selenium.getEval(String.format(jsScript, aCSSLocator))); }

Re: Anything like Effective Java for Python?

2010-03-12 Thread Neo
I have learned java for half a year and now I want to learn Python, should I learn python 3k or the traditional version? On Wed, Mar 10, 2010 at 7:19 AM, kj no.em...@please.post wrote: Subject line pretty much says it all: is there a book like Effective Java for Python. I.e. a book

Re: Anything like Effective Java for Python?

2010-03-12 Thread Steve Holden
- the differences are small enough that you can relatively easily fall back to 2 if you need to get access to non-ported libraries. regards Steve On Wed, Mar 10, 2010 at 7:19 AM, kj no.em...@please.post wrote: Subject line pretty much says it all: is there a book like Effective Java

Re: Anything like Effective Java for Python?

2010-03-12 Thread Gabriel Rossetti
kj wrote: Subject line pretty much says it all: is there a book like Effective Java for Python. I.e. a book that assumes that readers are experienced programmers that already know the basics of the language, and want to focus on more advanced programming issues? ~K Effective Java

Re: Anything like Effective Java for Python?

2010-03-12 Thread John Bokma
Gabriel Rossetti gabriel.rosse...@arimaz.com writes: kj wrote: Subject line pretty much says it all: is there a book like Effective Java for Python. I.e. a book that assumes that readers are experienced programmers that already know the basics of the language, and want to focus on more

Re: Anything like Effective Java for Python?

2010-03-11 Thread James Harris
On 10 Mar, 15:19, kj no.em...@please.post wrote: Subject line pretty much says it all: is there a book like Effective Java for Python.  I.e. a book that assumes that readers are experienced programmers that already know the basics of the language, and want to focus on more advanced programming

Re: Anything like Effective Java for Python?

2010-03-11 Thread Stefan Behnel
James Harris, 11.03.2010 09:30: On 10 Mar, 15:19, kjno.em...@please.post wrote: Subject line pretty much says it all: is there a book like Effective Java for Python. I.e. a book that assumes that readers are experienced programmers that already know the basics of the language, and want

Re: Anything like Effective Java for Python?

2010-03-11 Thread Steve Howell
after digesting this book. I'll second that. I much prefer Python to Java, but Effective Java is an excellent book. Many of its topics would be applicable to Python, although the solutions in Python would obviously be different. Eliminate obsolete object references (use None to break reference

Re: Anything like Effective Java for Python?

2010-03-11 Thread Kevin Walzer
On 3/10/10 10:19 AM, kj wrote: Subject line pretty much says it all: is there a book like Effective Java for Python. I.e. a book that assumes that readers are experienced programmers that already know the basics of the language, and want to focus on more advanced programming issues? ~K I

Re: Anything like Effective Java for Python?

2010-03-11 Thread mk
kj wrote: Subject line pretty much says it all: is there a book like Effective Java for Python. I.e. a book that assumes that readers are experienced programmers that already know the basics of the language, and want to focus on more advanced programming issues? I'm surprised nobody

Anything like Effective Java for Python?

2010-03-10 Thread kj
Subject line pretty much says it all: is there a book like Effective Java for Python. I.e. a book that assumes that readers are experienced programmers that already know the basics of the language, and want to focus on more advanced programming issues? ~K -- http://mail.python.org/mailman

Re: Anything like Effective Java for Python?

2010-03-10 Thread Simon Brunning
On 10 March 2010 15:19, kj no.em...@please.post wrote: Subject line pretty much says it all: is there a book like Effective Java for Python.  I.e. a book that assumes that readers are experienced programmers that already know the basics of the language, and want to focus on more advanced

Re: Anything like Effective Java for Python?

2010-03-10 Thread Chris Withers
kj wrote: Subject line pretty much says it all: is there a book like Effective Java oxymoronic, no? Sorry, couldn't resist ;-) Chris -- Simplistix - Content Management, Batch Processing Python Consulting - http://www.simplistix.co.uk --

Re: Anything like Effective Java for Python?

2010-03-10 Thread Stefan Behnel
Chris Withers, 10.03.2010 17:46: kj wrote: Subject line pretty much says it all: is there a book like Effective Java oxymoronic, no? Sorry, couldn't resist ;-) Nothing to excuse for. I thought exactly the same thing. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Java-to-Python?

2009-12-18 Thread Virgil Stokes
I have a rather large Java package for the analysis of networks that I would like to convert to Python. Many of the classes in the Java package are Serializable. Any recommendations on Java-to-Python (2.6) would be appreciated. --V -- http://mail.python.org/mailman/listinfo/python-list

Re: Java-to-Python?

2009-12-18 Thread Tim Wintle
On Fri, 2009-12-18 at 15:44 +0100, Virgil Stokes wrote: I have a rather large Java package for the analysis of networks that I would like to convert to Python. Many of the classes in the Java package are Serializable. Any recommendations on Java-to-Python (2.6) would be appreciated. I

Re: Java-to-Python?

2009-12-18 Thread Luis M . González
On Dec 18, 11:44 am, Virgil Stokes v...@it.uu.se wrote: I have a rather large Java package for the analysis of networks that I would like to convert to Python. Many of the classes in the Java package are Serializable. Any recommendations on Java-to-Python (2.6) would be appreciated. --V

Re: Performance java vs. python

2009-05-21 Thread Duncan Booth
namekuseijin namekusei...@gmail.com wrote: I find it completely unimaginable that people would even think suggesting the idea that Java is simpler. It's one of the most stupidly verbose and cranky languages out there, to the point you can't really do anything of relevance without an IDE

Re: Performance java vs. python

2009-05-21 Thread Sion Arrowsmith
sorted out, and then translated it. Even given the optimisations of manual translation, and being able to dispose of one portion of the Python which Java supplied the functionality for out of the box (thread timeout, I think it was), the code grew by 200%. That was a very unproductive day. -- \S

Re: Performance java vs. python

2009-05-21 Thread Lie Ryan
requirements dictated a pure Java solution for, I coded up a fully functional prototype in Python to get the logic sorted out, and then translated it. Even given the optimisations of manual translation, and being able to dispose of one portion of the Python which Java supplied the functionality for out

Re: Performance java vs. python

2009-05-21 Thread Sion Arrowsmith
Lie Ryan lie.1...@gmail.com wrote: Sion Arrowsmith wrote: Once, when faced with a rather hairy problem that client requirements dictated a pure Java solution for, I coded up a fully functional prototype in Python to get the logic sorted out, and then translated it. [And it wasn't pleasant.]

Re: Performance java vs. python

2009-05-21 Thread namekuseijin
On May 21, 7:47 am, s...@viridian.paintbox (Sion Arrowsmith) wrote: Duncan Booth  duncan.bo...@suttoncourtenay.org.uk wrote: namekuseijin namekusei...@gmail.com wrote: I find it completely unimaginable that people would even think suggesting the idea that Java is simpler.  It's one of the

Re: Performance java vs. python

2009-05-20 Thread namekuseijin
/third_edition/html/j3TOC.html Then compare with the summary for Python 3.0 language reference: http://docs.python.org/3.0/reference/ Like comparing a mammoth to a zebra. Besides, how is: for( int i=0; i10; i++ ) simpler than: for i in (range(10)) ? Scripting languages like Python eventually led

Re: Performance java vs. python

2009-05-20 Thread Ant
... BufferedReader reader = new BufferedReader(new FileReader (myfile.txt)); String line = reader.readLine(); while (line != null) { System.out.println(line); } ... And that's without all of the class/main method boilerplate or try catch block required due to checked exceptions. I've taught both Java

Re: Performance java vs. python

2009-05-20 Thread namekuseijin
Ant escreveu: # Python fh = open(myfile.txt) for line in fh: print line // Java ... BufferedReader reader = new BufferedReader(new FileReader (myfile.txt)); String line = reader.readLine(); while (line != null) { System.out.println(line); } ... And that's without all of the

Re: Performance java vs. python

2009-05-20 Thread Aahz
In article gv1nor$10u...@adenine.netfront.net, namekuseijin namekusei...@gmail.com wrote: I find it completely unimaginable that people would even think suggesting the idea that Java is simpler. It's one of the most stupidly verbose and cranky languages out there, to the point you can't

Performance java vs. python

2009-05-19 Thread Mohan Parthasarathy
static class model forces you into. I am new to Python. I am slowly realizing that Python might be a better choice when compared to java on the server side. Is there any performance comparison between Java and Python ? For example, if I use the J2EE solution vs. python (Django etc.) on the server side

Re: Performance java vs. python

2009-05-19 Thread Daniel Fetchinson
comparison between Java and Python ? For example, if I use the J2EE solution vs. python (Django etc.) on the server side, would one perform better over the other ? Benchmarks always test for a given feature. The available benchmarks will most likely not test the feature relevant for your particular

Re: Performance java vs. python

2009-05-19 Thread Krishnakant
for returning a connection object. This again is a major reason for me to stick to python. In addition python also can do the kind of work, j2ME can do and so I don't think there is any serious reason for choosing java over python. I am currently developing a major application and it is currently using

Re: Performance java vs. python

2009-05-19 Thread Mohan Parthasarathy
that Python might be a better choice when compared to java on the server side. Is there any performance comparison between Java and Python ? For example, if I use the J2EE solution vs. python (Django etc.) on the server side, would one perform better over the other ? Benchmarks always

Re: Performance java vs. python

2009-05-19 Thread CTO
++) would make a difference in environments where CPU, memory and power are a big constraint. Given the context, do we know how Python compares with Java or even native programming. What is the overhead of Python's interpreted code ? Some standard benchmarks would help compare apples to apples

Re: Performance java vs. python

2009-05-19 Thread namekuseijin
someone said: If you took a look at Java, you would notice that the core language syntax is much simpler than Python's. thanks for the laughs whoever you are! -- a game sig: http://tinyurl.com/d3rxz9 -- http://mail.python.org/mailman/listinfo/python-list

Re: Performance java vs. python

2009-05-19 Thread David Stanek
On Tue, May 19, 2009 at 5:43 PM, namekuseijin namekusei...@gmail.com wrote: someone said: If you took a look at Java, you would notice that the core language syntax is much simpler than Python's. thanks for the laughs whoever you are! I'm no Java fan, but I do agree that the core language

Re: Performance java vs. python

2009-05-19 Thread Chris Rebert
On Tue, May 19, 2009 at 3:21 PM, David Stanek dsta...@dstanek.com wrote: On Tue, May 19, 2009 at 5:43 PM, namekuseijin namekusei...@gmail.com wrote: someone said: If you took a look at Java, you would notice that the core language syntax is much simpler than Python's. thanks for the laughs

Re: Performance java vs. python

2009-05-19 Thread Gunter Henriksen
general statements about Java vs Python, because there is so much dependency on how a particular library interacts with the operating system or with a remote server. For example a database driver which is doing a lot of conversion between the data representation of the database and the native

Java to Python

2009-02-07 Thread zaheer . agadi
Hi I have a following class that is written Java and makes use of apache http client library,I am new to python can any one suggest me a python equivalent of this following class, Thanks , public class Authenticate{ private String storageUserName=null; private String storagePassword=null;

Re: Java to Python

2009-02-07 Thread Banibrata Dutta
Jython is not an option ? On Sat, Feb 7, 2009 at 9:54 PM, zaheer.ag...@gmail.com wrote: Hi I have a following class that is written Java and makes use of apache http client library,I am new to python can any one suggest me a python equivalent of this following class, Thanks , public

Re: Java to Python

2009-02-07 Thread zaheer agadi
Hi Thanks for replying .. I am actually looking for the pure Python options Are there any equivalent clasees for the following import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.HttpException; import

Re: Java to Python

2009-02-07 Thread Aleksandar Radulovic
Hi, This looks like a perfect job for httplib and urllib2 modules. On Sat, Feb 7, 2009 at 4:49 PM, zaheer agadi zaheer.ag...@gmail.com wrote: Hi Thanks for replying .. I am actually looking for the pure Python options Are there any equivalent clasees for the following import

Re: Java to Python

2009-02-07 Thread Aleksandar Radulovic
Hi, On Sat, Feb 7, 2009 at 5:28 PM, zaheer agadi zaheer.ag...@gmail.com wrote: Thanks Alex, Can you provide me more details on httplib and urllib ? The details can be found in Python documentation (http://python.org/doc), on these pages: http://docs.python.org/library/httplib.html I'm sure

Importing java within python

2008-01-17 Thread Osthaus, Christopher (Mission Systems)
Hi All, This is an easy one - I'm new to Python and working on a script where I need to use some java swing classes. I'm running Python on Windows. I've got an import statement that looks something like: from java.lang import System from javax.swing import JPasswordField from javax.swing

Re: Importing java within python

2008-01-17 Thread Henry Chang
www.jython.org On Jan 17, 2008 8:06 AM, Osthaus, Christopher (Mission Systems) [EMAIL PROTECTED] wrote: Hi All, This is an easy one - I'm new to Python and working on a script where I need to use some java swing classes. I'm running Python on Windows. I've got an import statement that

Re: Importing java within python

2008-01-17 Thread Laurent Pointal
? I realize this is probably very obvious but I can't seem to figure it out :) Thanks everyone... -- http://mail.python.org/mailman/listinfo/python-list To complement Henry Chang reply, you can also take a look at: http://jpype.sourceforge.net/ (Java To Python Integration) http

Moving from java to python.

2007-11-12 Thread [EMAIL PROTECTED]
Hi, I have recently been learning python, and coming from a java background there are many new ways of doing things that I am only just getting to grips with. I wondered if anyone could take a look at a few pieces of code I have written to see if there are any places where I am still using java-

Re: Moving from java to python.

2007-11-12 Thread Jarek Zgoda
[EMAIL PROTECTED] napisał(a): def getConnected(self): return self._connected No need to use accessors. Just plain attribute lookup is sufficient. -- Jarek Zgoda Skype: jzgoda | GTalk: [EMAIL PROTECTED] | voice: +48228430101 We read Knuth so you don't have to. (Tim

Re: Moving from java to python.

2007-11-12 Thread Paul Hankin
On Nov 12, 3:25 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, I have recently been learning python, and coming from a java background there are many new ways of doing things that I am only just getting to grips with. I wondered if anyone could take a look at a few pieces of code I have

Re: Moving from java to python.

2007-11-12 Thread Hrvoje Niksic
[EMAIL PROTECTED] [EMAIL PROTECTED] writes: def __init__(self, connections = None, uid = None): You can use connections=(), so you don't need the if below. In fact, you can further write: for node, weight in connections: self._connected.append(node)

Re: Moving from java to python.

2007-11-12 Thread Tim Chase
def __init__(self, connections = None, uid = None): Args: [connections - a list of (connected node, weight) tuples. ] [uid - an identifier for comparisons.] self._connected = [] self._weights = [] if connections: for i in

Re: Moving from java to python.

2007-11-12 Thread Larry Bates
Paul Hankin wrote: On Nov 12, 3:25 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, I have recently been learning python, and coming from a java background there are many new ways of doing things that I am only just getting to grips with. I wondered if anyone could take a look at a few

Re: Translating some Java to Python

2007-05-21 Thread Herman Slagman
Daniel Gee [EMAIL PROTECTED] schreef in bericht news:[EMAIL PROTECTED] class Foo: def statAdd(self,a): return a+5 or do you drop the 'self' bit and just use a 1 variable parameter list? class Foo: @staticmethod def statAdd(a): return a+5 HTH Herman --

Re: Translating some Java to Python

2007-05-21 Thread Ant
On May 20, 9:24 pm, Daniel Gee [EMAIL PROTECTED] wrote: ... The Java version has static methods for common roll styles (XdY and XdY +Z) for classes that just want a result but don't want to bother keeping an object around for later. So the question is, assuming that I wanted to keep the

Re: Translating some Java to Python

2007-05-21 Thread Herman Slagman
Ant [EMAIL PROTECTED] schreef in bericht news:[EMAIL PROTECTED] Herman has shown you *how* to do static methods in Python, but typically they are not used. Since Python has first class functions, and they can be defined at the module level, there is no need to use static methods. Hmm, As

Re: Translating some Java to Python

2007-05-21 Thread Diez B. Roggisch
use any class or instance related data. Why so? If they _don't_ use that class, whatfor? I use classmethods for factory-methods. But that at least needs the _class_ as argument somehow, and grouping it namespace-wise below the class makes sense. Otherwise, all they do is allowing for java

Re: Translating some Java to Python

2007-05-21 Thread Gabriel Genellina
En Mon, 21 May 2007 07:39:09 -0300, Unknown [EMAIL PROTECTED] escribió: Ant [EMAIL PROTECTED] schreef in bericht news:[EMAIL PROTECTED] Herman has shown you *how* to do static methods in Python, but typically they are not used. Since Python has first class functions, and they can be

Re: Translating some Java to Python

2007-05-21 Thread Herman Slagman
Gabriel Genellina [EMAIL PROTECTED] schreef in bericht news:[EMAIL PROTECTED] En Mon, 21 May 2007 07:39:09 -0300, Unknown [EMAIL PROTECTED] escribió: Ant [EMAIL PROTECTED] schreef in bericht news:[EMAIL PROTECTED] Herman has shown you *how* to do static methods in Python, but typically

Re: Translating some Java to Python

2007-05-21 Thread Gabriel Genellina
En Mon, 21 May 2007 09:26:19 -0300, Unknown [EMAIL PROTECTED] escribió: One example that comes to mind is a class that is a proxy for a database class, say Person. The Person.Load(id) method doesn't use any instance or class data, it instantiates a Person and populates it from the database.

Translating some Java to Python

2007-05-20 Thread Daniel Gee
A while ago I wrote a class in Java for all kinds of dice rolling methods, as many sides as you want, as many dice as you want, only count values above or below some number in the total, things like that. Now I'm writing a project in Python that needs to be able to make use of that kind of a

Re: Translating some Java to Python

2007-05-20 Thread Arnaud Delobelle
On May 20, 9:24 pm, Daniel Gee [EMAIL PROTECTED] wrote: A while ago I wrote a class in Java for all kinds of dice rolling methods, as many sides as you want, as many dice as you want, only count values above or below some number in the total, things like that. Now I'm writing a project in

Re: Translating some Java to Python

2007-05-20 Thread Daniel Gee
Alright, sounds good. I'm just not as familiar with the preferred designs of python. As to wanting to have them in a class, sometimes I do. Persisting a roll in a class is only for the slightly more complicated rolls such as 3d6+5d4-1d12 or 4d6 (drop the lowest and re-roll ones), things of that

Re: Looking for resources for making the jump from Java to Python easier and more productive

2006-04-27 Thread Lawrence D'Oliveiro
In article [EMAIL PROTECTED], bruno at modulix [EMAIL PROTECTED] wrote: Lawrence D'Oliveiro wrote: In article [EMAIL PROTECTED], bruno at modulix [EMAIL PROTECTED] wrote: Lawrence D'Oliveiro wrote: (snip) I suppose this is an instance of the more general rule: using OO when you don't

Re: Looking for resources for making the jump from Java to Python easier and more productive

2006-04-25 Thread bruno at modulix
Lawrence D'Oliveiro wrote: In article [EMAIL PROTECTED], bruno at modulix [EMAIL PROTECTED] wrote: Lawrence D'Oliveiro wrote: (snip) I suppose this is an instance of the more general rule: using OO when you don't have to. Lawrence, I'm afraid you're confusing OO with statically-typed

Re: Looking for resources for making the jump from Java to Python easier and more productive

2006-04-25 Thread ToddLMorgan
Thanks for those ... just by looking at the colour of the links in my browser I'd only found 4 of those already so I appreciate the heads up :- ) -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for resources for making the jump from Java to Python easier and more productive

2006-04-25 Thread Bruno Desthuilliers
bruno at modulix a écrit : Lawrence D'Oliveiro wrote: In article [EMAIL PROTECTED], bruno at modulix [EMAIL PROTECTED] wrote: Lawrence D'Oliveiro wrote: (snip) I suppose this is an instance of the more general rule: using OO when you don't have to. Lawrence, I'm afraid you're

Re: Looking for resources for making the jump from Java to Python easier and more productive

2006-04-24 Thread bruno at modulix
Lawrence D'Oliveiro wrote: In article [EMAIL PROTECTED], ToddLMorgan [EMAIL PROTECTED] wrote: I'm looking for the common types of mistakes that say a Java/C# or even C++ developer may commonly make. Using subclassing when you don't have to. For instance, you might have a Java method

Re: Looking for resources for making the jump from Java to Python easier and more productive

2006-04-24 Thread gene tani
Ant wrote: Take a look at the newgroup archives over the last week or two - there seem to have been a glut of people coming from Java to Python and asking the same sort of questions. There were some links to a bunch of Python 'gotcha' pages which will be useful. Here's a few gotchas which i

Re: Looking for resources for making the jump from Java to Python easier and more productive

2006-04-24 Thread Harry George
Lawrence D'Oliveiro [EMAIL PROTECTED] writes: In article [EMAIL PROTECTED], ToddLMorgan [EMAIL PROTECTED] wrote: Are there python specific equivalents to the common Patterns, Anti-Patterns and Refactoring books that are so prevalent as reccomended reading in C++ and Java? I don't think

Re: Looking for resources for making the jump from Java to Python easier and more productive

2006-04-24 Thread Mike Orr
Lawrence D'Oliveiro wrote: ToddLMorgan [EMAIL PROTECTED] wrote: Are there python specific equivalents to the common Patterns, Anti-Patterns and Refactoring books that are so prevalent as reccomended reading in C++ and Java? I don't think they exist. Such books are targeted more towards

Re: Looking for resources for making the jump from Java to Python easier and more productive

2006-04-24 Thread Lawrence D'Oliveiro
In article [EMAIL PROTECTED], gene tani [EMAIL PROTECTED] wrote: http://www.ferg.org/projects/python_gotchas.html Amazing. Backslashes are listed as not one, but _two_ items on the list. The problem is not with Python at all, it is with the MS-DOS foundations of Windows. When directory

Re: Looking for resources for making the jump from Java to Python easier and more productive

2006-04-24 Thread Lawrence D'Oliveiro
In article [EMAIL PROTECTED], bruno at modulix [EMAIL PROTECTED] wrote: Lawrence D'Oliveiro wrote: In article [EMAIL PROTECTED], ToddLMorgan [EMAIL PROTECTED] wrote: I'm looking for the common types of mistakes that say a Java/C# or even C++ developer may commonly make. Using subclassing

Re: Looking for resources for making the jump from Java to Python easier and more productive

2006-04-24 Thread Lawrence D'Oliveiro
In article [EMAIL PROTECTED], Mike Orr [EMAIL PROTECTED] wrote: Lawrence D'Oliveiro wrote: ToddLMorgan [EMAIL PROTECTED] wrote: Are there python specific equivalents to the common Patterns, Anti-Patterns and Refactoring books that are so prevalent as reccomended reading in C++ and Java? I

Re: Looking for resources for making the jump from Java to Python easier and more productive

2006-04-23 Thread ToddLMorgan
/PythonComparedToJava The site owner (Irmen de Jong) appears to be be compiling a decent migration path from Java to Python on a Moin-Moin Wiki so perhaps he'll be harvesting more useful information from here and other places in the near future as the pages only appears a few days ago. There was also a follow up

Looking for resources for making the jump from Java to Python easier and more productive

2006-04-22 Thread ToddLMorgan
really cool and alien to me at the same time. That's the sort of stuff I'm interested in. At this point in time I'd say my python code is more coding Java in python than doing it in a pythonic way. Perhaps there some good/great examples of Python scripts or projects that I could look at to get

Re: Looking for resources for making the jump from Java to Python easier and more productive

2006-04-22 Thread Lawrence D'Oliveiro
In article [EMAIL PROTECTED], ToddLMorgan [EMAIL PROTECTED] wrote: I'm looking for the common types of mistakes that say a Java/C# or even C++ developer may commonly make. Using subclassing when you don't have to. For instance, you might have a Java method which takes an argument of type

Re: Looking for resources for making the jump from Java to Python easier and more productive

2006-04-22 Thread Lawrence D'Oliveiro
In article [EMAIL PROTECTED], ToddLMorgan [EMAIL PROTECTED] wrote: Are there python specific equivalents to the common Patterns, Anti-Patterns and Refactoring books that are so prevalent as reccomended reading in C++ and Java? I don't think they exist. Such books are targeted more towards

Re: Looking for resources for making the jump from Java to Python easier and more productive

2006-04-22 Thread Anton Vredegoor
ToddLMorgan wrote: I'm just starting out with python, after having a long history with Java. I was wondering if there were any resources or tips from anyone out there in Python-land that can help me make the transition as successfully as possible? Perhaps you've made the transition yourself

Re: Looking for resources for making the jump from Java to Python easier and more productive

2006-04-22 Thread Chris Lambacher
http://dirtsimple.org/2004/12/python-is-not-java.html http://dirtsimple.org/2004/12/java-is-not-python-either.html http://dirtsimple.org/2004/12/python-interfaces-are-not-java.html This link seems to be down at the moment. http://naeblis.cx/rtomayko/2004/12/15/the-static-method-thing The above

Re: Looking for resources for making the jump from Java to Python easier and more productive

2006-04-22 Thread Ant
Take a look at the newgroup archives over the last week or two - there seem to have been a glut of people coming from Java to Python and asking the same sort of questions. There were some links to a bunch of Python 'gotcha' pages which will be useful. For my part, I came from Java to Python

Re: fairly large webapp: from Java to Python. experiences?

2006-02-07 Thread bruno at modulix
itself is pretty usable, but the whole CMF part is a monstruosity IMHO. Could one reasonably expect to have an easier time with maintainence and future modifications with using Python over Java? Err... It of course depends on first having well written code and a sensible design, but when it comes

Re: fairly large webapp: from Java to Python. experiences?

2006-02-06 Thread Fabio Zadrozny
I agree that python code is usually smaller... but what you did is too unfair (the code below would be more suitable for the comparrison). python: print %10.2f % 10 java: System.out.println(String.format(%10.2f, 10.0)); -- altough for me it would be the same, as I have defined a print

  1   2   >