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
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
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
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
Are these available? Any good ones to recommend?
--
https://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
--
Unfortunately using jpython or json are not options at the moment
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
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
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):
> >
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
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
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
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)));
}
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
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 (
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
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
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
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.
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
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
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;
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
> 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:
>
"[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
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
[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
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-
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
"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
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
>
> 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
"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
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
"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
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
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
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.
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:
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".
>
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
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
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 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
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
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
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?
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.
&
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
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
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
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
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
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
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
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
[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
> 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
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));
>>
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
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
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
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
[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
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
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
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
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
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
[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();
>
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) {
}
}
80 matches
Mail list logo