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

Re: Java to Python autoconverters

2015-06-12 Thread Ian Kelly
On Jun 12, 2015 6:53 AM, "Stefan Behnel" wrote: > > Sebastian M Cheung via Python-list schrieb am 12.06.2015 um 13:36: > > Are these available? Any good ones to recommend? > > I recommend not doing that. You'd end up with ugly and unidiomatic Python > code that's impossible to maintain, whereas yo

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 -- https://mail.python.org/mailman/listinfo/pyt

Re: Java to Python autoconverters

2015-06-12 Thread Stefan Behnel
Sebastian M Cheung via Python-list schrieb am 12.06.2015 um 13:36: > Are these available? Any good ones to recommend? I recommend not doing that. You'd end up with ugly and unidiomatic Python code that's impossible to maintain, whereas you now (hopefully) have somewhat idiomatic Java code that sho

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

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 on r

Re: Passing array from java to python

2011-06-03 Thread Marco Nawijn
On Jun 2, 11:54 am, loial 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? I recently had to deal with the same problem, some bi-d

Re: Passing array from java to python

2011-06-02 Thread Ian Kelly
On Thu, Jun 2, 2011 at 4:47 AM, loial 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: Passing array from java to python

2011-06-02 Thread Chris Rebert
On Thu, Jun 2, 2011 at 3:47 AM, loial 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 -- http://mail.pyt

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 wrote: > Unfortunately using jpython or json are not options at the moment > -- > http://mail.python.org/mailman/listinfo/python-list > -- Nitin Pawar --

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 Chris Rebert
On Thu, Jun 2, 2011 at 2:54 AM, loial 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?: http://www.jython.org/ Or dependi

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: Converting getCSS Count Code from java to python

2011-02-17 Thread SMERSH009
On Feb 17, 10:25 pm, SMERSH009 wrote: > On Feb 17, 9:51 pm, Stefan Behnel 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 f

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); cs

Re: Converting getCSS Count Code from java to python

2011-02-17 Thread SMERSH009
On Feb 17, 9:51 pm, Stefan Behnel 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. > > > Traceba

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 "D:\Temp\1TestingApps\Selenium\Sc

Re: Converting getCSS Count Code from java to python

2011-02-17 Thread SMERSH009
On Feb 2, 7:03 am, Duncan Booth wrote: > Stefan Behnel 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): > >    

Re: Converting getCSS Count Code from java to python

2011-02-02 Thread Duncan Booth
Stefan Behnel 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 = ''' > var cs

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 Integer.parseInt(selenium.getEval(String.for

Re: Converting getCSS Count Code from java to python

2011-02-02 Thread Jon Clements
On Feb 1, 4:23 am, SMERSH009 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 Integer.parseInt(selenium.get

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: Java-to-Python?

2009-12-18 Thread Luis M . González
On Dec 18, 11:44 am, 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 a

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 (

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

The TimingAnalyzer -- project to convert from Java to Python

2009-07-03 Thread chewie
velop similar type cad programs. My plan is to convert the TimingAnalyzer Java to Python with mostly a scripting interface for building complex timing diagrams, doing timing analysis, creating testbenches and testvectors from waveform diagrams, and creating timing diagrams from simulation VCD

Re: Java to Python

2009-02-07 Thread Aleksandar Radulovic
Hi, On Sat, Feb 7, 2009 at 5:28 PM, zaheer agadi 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 you can figure out t

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 wrote: > 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.

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 org.apache.commons.httpclient.contrib.ssl.EasySSLProtocolSock

Re: Java to Python

2009-02-07 Thread Banibrata Dutta
Jython is not an option ? On Sat, Feb 7, 2009 at 9:54 PM, 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 class Authenticat

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: 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 ta

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: >

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) self._weigh

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 c

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 Pet

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: 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 data

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 Py

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 the

Re: Translating some Java to Python

2007-05-21 Thread Diez B. Roggisch
> > Hmm, > > As an experienced developer I'm rather new to Python, so please forgive me > any non-Pythonic babbling. > From a language point you're probably right, but from a design point I'd > like to have methods that are clearly associated with a class as methods > of that class, even if they

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. Hm

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
"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 -- http://mail.pyth

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: 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

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 class.

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:

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". >

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 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 wi

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

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

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 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 to

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?

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. &

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

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

2006-04-23 Thread ToddLMorgan
ython/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 fo

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 P

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 a

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 yoursel

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 towar

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 typ

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

2006-04-22 Thread ToddLMorgan
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 or just have experience wi

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

2006-02-07 Thread bruno at modulix
[EMAIL PROTECTED] wrote: (snip) > Does anyone here have any experience with large(ish) webapps in Python? Depends on the definition of "large(ish)". If you use KLOC as a metric, you can expect a Python solution to be 5 to 10 time smaller, so what's a 'large' app in Java may end up as a small/med

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

2006-02-06 Thread George Sakkis
> Any tips, stories, recommendations, and/or experiences are most > welcome. Just one suggestion, read the article "Things You Should Never Do, Part I" first ( http://www.joelonsoftware.com/articles/fog69.html). Quoting from the article: (Netscape made) "the *single worst strategic mistak

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

2006-02-06 Thread Fabio Zadrozny
Kent Johnson wrote: >Fabio Zadrozny wrote: > > >>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)); >>

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

2006-02-06 Thread Kent Johnson
Fabio Zadrozny wrote: > 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)); Though String.format() is new in

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 meth

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

2006-02-05 Thread AdSR
Giovanni Bajo wrote: > Also Python code is pretty bare-metal, so that > file.write or socket.write go to the syscall immediately. Try that in Java and > you'll find 30 layers of complex abstractions for doubtful benefits and > obvious > slowness. +1 QOTW (I'd recommend the whole post but it might

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

2006-02-04 Thread John M. Gabriele
Shalabh Chaturvedi wrote: > [EMAIL PROTECTED] wrote: > > A class-to-class and method-to-method rewrite will give some but likely > not the full benefit of moving to Python. A redesign might be necessary > - making it more 'Pythonic' in the process. In my experience, many cruft > classes that ex

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

2006-02-04 Thread Shalabh Chaturvedi
[EMAIL PROTECTED] wrote: > I've got a fairly substantial webapp written in Java (plus Tomcat, > Hibernate, Struts, JSP, MySQL) that is a bit of a bear to work with. I > didn't write it. Much of it is only very sparsely documented (if at > all). No design docs anywhere. It's a large webapp with many

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

2006-02-04 Thread Giovanni Bajo
John M. Gabriele wrote: >> But once it is >> there, Python is a good choice for web apps. Java is slow > > Slow? They're both dynamic languages, but Java is statically > typed (with less work to do at runtime). For long-running processes, > I'd guess that Java bytecode executes faster than Python

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

2006-02-04 Thread Scott David Daniels
John M. Gabriele wrote: > [EMAIL PROTECTED] wrote: >> But once it is >> there, Python is a good choice for web apps. Java is slow > > Slow? They're both dynamic languages, but Java is statically > typed (with less work to do at runtime). For long-running processes, > I'd guess that Java bytecode e

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

2006-02-03 Thread John M. Gabriele
it to Python. Well, I figured it might be better to use the previous webapp as a *model* to learn from, rather than to directly translate code from Java to Python. > But once it is > there, Python is a good choice for web apps. Java is slow Slow? They're both dynamic languages, but Ja

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

2006-02-03 Thread [EMAIL PROTECTED]
To replace a large framework you will probably need a framework. Take a look at http://www.djangoproject.com or http://www.turbogears.org. They both use some of the tools you mention but operate on a higher level. I find Python fairly easy to maintain. Unfortunatly, I do not find it easy to take a

fairly large webapp: from Java to Python. experiences?

2006-02-03 Thread john_sips_tea
I've got a fairly substantial webapp written in Java (plus Tomcat, Hibernate, Struts, JSP, MySQL) that is a bit of a bear to work with. I didn't write it. Much of it is only very sparsely documented (if at all). No design docs anywhere. It's a large webapp with many classes and fairly deep inherita

Re: Java to Python - how to??

2005-06-13 Thread George Sakkis
[EMAIL PROTECTED] wrote: > Hello > > I just start programing in Python. > I've got a qestion, how translate the example code writen in Java to > Python?? > > > public class ConnectionManager { > > public ConnectionManager() { > super(); >

Java to Python - how to??

2005-06-13 Thread ka_czor
Hello I just start programing in Python. I've got a qestion, how translate the example code writen in Java to Python?? public class ConnectionManager { public ConnectionManager() { super(); } public void sendAgent(Agent anAgent, WorkplaceAddress anAddress) { } }