Enrico Franchi ha scritto:
spazza spa...@alum.com wrote:
...snip...
Non mi pare che al momento Python sia in grado di reggere tutto questo.
Scusa, proseguendo in questa maniera andiamo pesantemente OT.
Rimane pero' il problema di *dimostrare* la tua affermazione. Da quanto
leggo, mi sembra
On Dec 14, 11:53 am, Nirav Thaker [EMAIL PROTECTED] wrote:
Yo Group,
I'm excited to learn Python as new language coming year, I consider
myself good Java developer and, not so unusually, with very limited
experience with dynamic programming languages such as Python or Ruby.
I have started
Nirav Thaker a écrit :
Yo Group,
I'm excited to learn Python as new language coming year, I consider
myself good Java developer and, not so unusually, with very limited
experience with dynamic programming languages such as Python or Ruby.
Then you'll probably have to unlearn a few things...
Welcome to Python!
One way to get you up to speed fast (and fun) is take some java app
you've written and implement it in Jython. After you've done that, and
gotten over the pleasant surprise of how short and clean your code has
become, go over the source again and see where you can replace calls
Having a decent knowledge of Python's object model
As explained clearly here:
http://www.cafepy.com/article/python_types_and_objects/python_types_and_objects.html
http://www.cafepy.com/article/python_attributes_and_methods/python_attributes_and_methods.html
2B
--
Berco Beute a écrit :
Having a decent knowledge of Python's object model
As explained clearly here:
http://www.cafepy.com/article/python_types_and_objects/python_types_and_objects.html
http://www.cafepy.com/article/python_attributes_and_methods/python_attributes_and_methods.html
I'm not
Steve Holden [EMAIL PROTECTED] wrote:
Ed Jensen wrote:
Steve Holden [EMAIL PROTECTED] wrote:
Jython is an implementation of Python that compiles to Java bytecode,
but at the moment there's some version lag so it won't handle the mos
recent language enhancements. Probably worth a look,
Ed Jensen wrote:
Steve Holden [EMAIL PROTECTED] wrote:
Ed Jensen wrote:
Steve Holden [EMAIL PROTECTED] wrote:
Jython is an implementation of Python that compiles to Java bytecode,
but at the moment there's some version lag so it won't handle the mos
recent language enhancements. Probably
Sreelatha G wrote:
Hi
I am new to python .I need your help in solving my problem.
Is there any way to call python files in a java file .How is it possible?
Jython is an implementation of Python that compiles to Java bytecode,
but at the moment there's some version lag so it won't
On Apr 5, 7:18 am, Steve Holden [EMAIL PROTECTED] wrote:
Sreelatha G wrote:
Hi
I am new to python .I need your help in solving my problem.
Is there any way to call python files in a java file .How is it possible?
Your other option is to utilize a system exec call, and try and trap
Steve Holden [EMAIL PROTECTED] wrote:
Jython is an implementation of Python that compiles to Java bytecode,
but at the moment there's some version lag so it won't handle the mos
recent language enhancements. Probably worth a look, though.
http://www.jython.org/
Does Jython compile to
Ed Jensen wrote:
Steve Holden [EMAIL PROTECTED] wrote:
Jython is an implementation of Python that compiles to Java bytecode,
but at the moment there's some version lag so it won't handle the mos
recent language enhancements. Probably worth a look, though.
http://www.jython.org/
Does
Amir Michail a écrit :
Hi,
It seems to me that measuring productivity in a programming language
must take into account available tools and libraries.
Eclipse for example provides such an amazing IDE for java that it is no
longer obvious to me that one would be much more productive in
Amir Michail wrote:
Hi,
It seems to me that measuring productivity in a programming language
must take into account available tools and libraries.
Eclipse for example provides such an amazing IDE for java that it is no
longer obvious to me that one would be much more productive in
Hi,
Here's a blog post that is relevant to this discussion:
http://sixthandredriver.typepad.com/river_of_code/2006/01/automated_refac.html
Amir
--
http://mail.python.org/mailman/listinfo/python-list
:[EMAIL PROTECTED]
Behalf Of krishnakant Mane
Sent: Friday, December 01, 2006 6:19 AM
To: python-list@python.org
Subject: Re: python vs java eclipse
just used the py dev plugin for eclipse.
it is great.
auto indentation and intellisence.
and all other things.
so now how does it look from this end
On 1 Dec 2006 01:24:47 -0800, Amir Michail [EMAIL PROTECTED] wrote:
Eclipse for example provides such an amazing IDE for java that it is no
longer obvious to me that one would be much more productive in python
for medium sized projects.
Eclipse can generate a lot of the Java boilerplate code,
just used the py dev plugin for eclipse.
it is great.
auto indentation and intellisence.
and all other things.
so now how does it look from this end?
python + productivity and eclipse + productivity = double productivity!
only problem with the plugin is that I find it difficult to manage the
krishnakant Mane wrote:
just used the py dev plugin for eclipse.
it is great.
auto indentation and intellisence.
and all other things.
so now how does it look from this end?
python + productivity and eclipse + productivity = double productivity!
only problem with the plugin is that I find
Thomas Ploch schrieb:
Amir Michail schrieb:
Hi,
It seems to me that measuring productivity in a programming language
must take into account available tools and libraries.
Eclipse for example provides such an amazing IDE for java that it is no
longer obvious to me that one would be much
Thomas Ploch wrote:
Thomas Ploch schrieb:
Amir Michail schrieb:
Hi,
It seems to me that measuring productivity in a programming language
must take into account available tools and libraries.
Eclipse for example provides such an amazing IDE for java that it is no
longer obvious to me that
krishnakant Mane wrote:
just used the py dev plugin for eclipse.
it is great.
But isn't support for java better because the eclipse ide can take
advantage of explicit type declarations (e.g., for intellisense,
refactoring, etc.)?
Amir
auto indentation and intellisence.
and all other
Amir Michail escreveu:
krishnakant Mane wrote:
just used the py dev plugin for eclipse.
it is great.
But isn't support for java better because the eclipse ide can take
advantage of explicit type declarations (e.g., for intellisense,
refactoring, etc.)?
Amir
The support for Java is
Stephen Eilert wrote:
The support for Java is light-years ahead. Sometimes I feel that
Eclipse is coding for me (quickfix, for instance).
Eclipse may be quite a technical achievement, but I found it
irritating. Aside from the misuse of screen real-estate, I found that
typing two characters and
Paul Boddie wrote:
Eclipse may be quite a technical achievement, but I found it
irritating. Aside from the misuse of screen real-estate, I found
that typing two characters and having what seemed like half my
source file underlined in red, with multiple messages telling me
that I had yet to
hg wrote:
Thomas Ploch wrote:
Yes, thats true, but since eclipse is resource monster (it is still
using java), and some people (like me) don't have a super fresh and new
computer
If you compare eclipse to VS, it is not that memory hungry
And if you compare Saturn to Jupiter, it's not
[EMAIL PROTECTED] wrote:
...
Is there anything _useful_ that it'll bring that a good editor doesn't?
e.g. in vim I do get
* automatic syntax checking (if I type if a=1: and hit enter, it'll
immediately highlight the syntax error)
* omni-completion (because Intellisense is trademarked)
*
Amir Michail wrote:
[EMAIL PROTECTED] wrote:
...
Is there anything _useful_ that it'll bring that a good editor doesn't?
e.g. in vim I do get
* automatic syntax checking (if I type if a=1: and hit enter, it'll
immediately highlight the syntax error)
* omni-completion (because
may be emacs can provide code completion (intellicense)
I have not used it so far so can't say.
but the main reason I use eclipse is for the above feature.
and yes indentation happens in eclipse python-mode so that is not a
major feature eclipse offers any way.
syntax highlighting is a very common
Jason wrote:
Bruno Desthuilliers wrote:
With a GUI ? If so, you probably want to check out wxPython or PyGTK
(wxPython will also buy you MacOS X IIRC, and wil perhaps be easier to
install on Windows).
Just a warning: wxPython does operate slightly differently between Mac
OS X, Linux, and
2006/9/7, Bruno Desthuilliers [EMAIL PROTECTED]:
I don't think one could pretend writing a cross-platform application
without testing it on all targeted platforms.
E.g: while creating a free software, you may not have an Apple
computer but you may want to be *possible* to run your program
Felipe Almeida Lessa wrote:
2006/9/7, Bruno Desthuilliers [EMAIL PROTECTED]:
I don't think one could pretend writing a cross-platform application
without testing it on all targeted platforms.
E.g: while creating a free software, you may not have an Apple
computer but you may want to be
Aravind wrote:
hi,
some of my friends told that python and java are similar in the idea of
platform independency. Can anyone give me an idea as i'm a newbie to java
and python but used to C++. My idea is to develop an app which can run both
in windows and linux.
That's true to an extent.
Aravind wrote:
some of my friends told that python and java are similar in the idea of
platform independency.
Similar in goal, but quite different in approach.
Python supports lots of platforms and goes to great lengths to offer
facades around whatever features a platform does have, so as
On Wed, 6 Sep 2006 17:53:29 +0530, Aravind [EMAIL PROTECTED] wrote:
hi,
some of my friends told that python and java are similar in the idea of
platform independency. Can anyone give me an idea as i'm a newbie to java
and python but used to C++.
Well, what Java and Python (and some other
Aravind wrote:
hi,
some of my friends told that python and java are similar in the idea of
platform independency.
Well, not quite IMHO.
Java treats the problem by taking the autistic attitude of pretending
the underlying platform doesn't exists - which can be a major PITA.
Python is much
On 9/6/06, Aravind [EMAIL PROTECTED] wrote:
hi,some of my friends told that python and java are similar in the idea ofplatform independency. Can anyone give me an idea as i'm a newbie to javaand python but used to C++. My idea is to develop an app which can run both
in windows and linux.
IMHO i
http://www.ferg.org/projects/python_java_side-by-side.html
--
http://mail.python.org/mailman/listinfo/python-list
Bruno Desthuilliers wrote:
With a GUI ? If so, you probably want to check out wxPython or PyGTK
(wxPython will also buy you MacOS X IIRC, and wil perhaps be easier to
install on Windows).
Just a warning: wxPython does operate slightly differently between Mac
OS X, Linux, and Windows. The
Em Qua, 2006-03-22 às 00:47 +0100, Martin v. Löwis escreveu:
Caleb Hattingh wrote:
What does .readlines() do differently that makes it so much slower
than .read().splitlines(True)? To me, the one obvious way to do it
is .readlines().
[snip]
Anyway, decompressing the entire file at one
Felipe Almeida Lessa wrote:
def readlines(self, sizehint=None):
if sizehint is None:
return self.read().splitlines(True)
# ...
Is it okay? Or is there any embedded problem I couldn't see?
It's dangerous, if the file is really large - it might exhaust
your memory.
Hi Peter
Clearly I misunderstood what Martin was saying :)I was comparing
operations on lines via the file generator against first loading the
file's lines into memory, and then performing the concatenation.
What does .readlines() do differently that makes it so much slower
than
Caleb Hattingh wrote:
What does .readlines() do differently that makes it so much slower
than .read().splitlines(True)? To me, the one obvious way to do it
is .readlines().
readlines reads 100 bytes (at most) at a time. I'm not sure why it
does that (probably in order to not read further
Bill wrote:
The Java version of this code is roughly 2x-3x faster than the Python
version. I can get around this problem by replacing the Python
GzipFile object with a os.popen call to gzcat, but then I sacrifice
portability. Is there something that can be improved in the Python
version?
I tried this:
from timeit import *
#Try readlines
print Timer('import
gzip;lines=gzip.GzipFile(gztest.txt.gz).readlines();[i+1 for i in
lines]').timeit(200) # This is one line
# Try file object - uses buffering?
print Timer('import gzip;[i+1 for i in
gzip.GzipFile(gztest.txt.gz)]').timeit(200)
Caleb Hattingh wrote:
I tried this:
from timeit import *
#Try readlines
print Timer('import
gzip;lines=gzip.GzipFile(gztest.txt.gz).readlines();[i+1 for i in
lines]').timeit(200) # This is one line
# Try file object - uses buffering?
print Timer('import gzip;[i+1 for i in
Bill wrote:
I've written a small program that, in part, reads in a file and parses
it. Sometimes, the file is gzipped. The code that I use to get the
file object is like so:
if filename.endswith(.gz):
file = GzipFile(filename)
else:
file = open(filename)
Then I parse the
Bill wrote:
Is there something that can be improved in the Python version?
Seems like GzipFile.readlines is not optimized, file.readline works
better:
C:\pypython -c file('tmp.txt', 'w').writelines('%d This is a test\n'
% n for n in range(1))
C:\pypython -m timeit
Thanks for these suggestions. To be clear, we already have a Python
2.4 minimum requirement for other reasons, and we are looking for a
long-term solution so that as Python advances, the scripting solution
can keep up in a timely way.
Since the Java code is for a very large, complex application,
JKPeck wrote:
Suppose you have an application written in Java, and you want to enable
other applications or processes written in Python to communicate with
it, i.e., to use Python as a scripting language for the application.
On Windows you could do this with COM and various addons such as
JKPeck [EMAIL PROTECTED] writes:
Suppose you have an application written in Java, and you want to enable
other applications or processes written in Python to communicate with
it, i.e., to use Python as a scripting language for the application.
On Windows you could do this with COM and various
JKPeck [EMAIL PROTECTED] writes:
Suppose you have an application written in Java, and you want to enable
other applications or processes written in Python to communicate with
it, i.e., to use Python as a scripting language for the application.
On Windows you could do this with COM and various
JKPeck wrote:
Suppose you have an application written in Java, and you want to enable
other applications or processes written in Python to communicate with
it, i.e., to use Python as a scripting language for the application.
On Windows you could do this with COM and various addons such as
For most purposes Jython 2.1 is just fine. The lack of recent features
is not a show stopper. What do you need metaclasses? decorators? BTW,
there is Jython 2.2 as an alpha release.
There are a number of ways you can use Java code through Python.
Use JPype to start a Java VM
Peter Hansen wrote:
Alex Martelli wrote:
One great programming principle is Dont' Repeat Yourself: when you're
having to express the same thing over and over, there IS something
wrong. I believe the DYR phrasing is due to the so-called Pragmatic
Programmers, who are paladins of Ruby, but I
Mike Meyer wrote:
That doesn't sounds like hates to me. More like doesn't like the
baggage.
mike
Yet anonymous functions are nice.
Wouldn't it be possible to change the `def` statement to return a
reference to the function, and allow omitting the function name thereby
bypassing
Xavier Morel [EMAIL PROTECTED] wrote:
...
Wouldn't it be possible to change the `def` statement to return a
reference to the function, and allow omitting the function name thereby
bypassing the default binding (current behavior)?
It's _possible_ (doesn't introduce syntax ambiguities)
Alex Martelli wrote:
Xavier Morel [EMAIL PROTECTED] wrote:
...
Wouldn't it be possible to change the `def` statement to return a
reference to the function, and allow omitting the function name thereby
bypassing the default binding (current behavior)?
It's _possible_ (doesn't introduce
Xavier Morel [EMAIL PROTECTED] writes:
Mike Meyer wrote:
That doesn't sounds like hates to me. More like doesn't like the
baggage.
mike
Yet anonymous functions are nice.
Wouldn't it be possible to change the `def` statement to return a
reference to the function, and allow omitting
While on topic of custom contructs, the topic of syntactic macros has
come up in the past. Does anyone know if the dev team ever considered
for or against them? My interest in them was renewed when I came across
Logix
http://www.livelogix.net/logix/
It does not seem very active at the moment nor
In article [EMAIL PROTECTED],
James [EMAIL PROTECTED] wrote:
I keep asking myself why isn't this more popular especially when many
prominent Python devs seem to be well aware of Lisp where macros are
done right.
You have confused many Python devs with Guido. ;-) Guido hates
macros. Oddly
Guido's concerns about preserving simplicity resonate well with me.
Maybe I am just a kid excited with his new toy. I have always admired
macros. Quite a few functional languages have them now. But they have
always been in languages with sub-optimal community code base, which
meant I never went
In article [EMAIL PROTECTED],
James [EMAIL PROTECTED] wrote:
Do you have any specific comments towards Logix's implementation?
Nope. I do know that Guido is generally in favor of Python-like
languages, and one of the goals of the AST project was to make that
easier. Ditto PyPy.
--
Aahz
[EMAIL PROTECTED] (Aahz) writes:
In article [EMAIL PROTECTED],
James [EMAIL PROTECTED] wrote:
I keep asking myself why isn't this more popular especially when many
prominent Python devs seem to be well aware of Lisp where macros are
done right.
You have confused many Python devs with Guido.
In article [EMAIL PROTECTED], Mike Meyer [EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] (Aahz) writes:
In article [EMAIL PROTECTED],
James [EMAIL PROTECTED] wrote:
I keep asking myself why isn't this more popular especially when many
prominent Python devs seem to be well aware of Lisp where macros
On Tue, 03 Jan 2006 16:25:06 -0500,
Mike Meyer [EMAIL PROTECTED] wrote:
I vaguelly recall hearing that Guido thought about adding macros to
Python, and rejected the idea because he didn't want users to have to
deal with compile-time errors at run time. Or something to that
effect.
That would
Alex Martelli wrote:
One great programming principle is Dont' Repeat Yourself: when you're
having to express the same thing over and over, there IS something
wrong. I believe the DYR phrasing is due to the so-called Pragmatic
Programmers, who are paladins of Ruby, but I also believe it's a
[EMAIL PROTECTED] wrote:
Hi everyone,
I need to write a web app, that will support millions of user accounts,
template-based user pages and files upload. The client is going to be
written in Flash. I wondered if I coudl get your opinions - what do you
think is the best language to use for
Peter Hansen [EMAIL PROTECTED] wrote:
Alex Martelli wrote:
One great programming principle is Dont' Repeat Yourself: when you're
having to express the same thing over and over, there IS something
wrong. I believe the DYR phrasing is due to the so-called Pragmatic
Programmers, who are
In article [EMAIL PROTECTED],
Alex Martelli [EMAIL PROTECTED] wrote:
.
[much valuable and
correct detail that
somehow managed to
avoid mentioning
Forth or Smalltalk]
.
Cameron Laird [EMAIL PROTECTED] wrote:
...
c = d unless ...: it's possible to distinguish Python from
Ruby in another way. Python is arguably better for group work,
or at least more standard for team projects, because it more
consistently exposes one correct solution, while Ruby both
NOKs [EMAIL PROTECTED] writes:
Thanks! That's really useful. I'm not sure if I'm a dynamically typed
guy - coming form C#, very strict language, and C++, statically typed,
but i definetly searched and see the debate going strong. Not try to
start it here, but do you think that statically typed
On Mon, 02 Jan 2006 19:35:10 -0500, Mike Meyer wrote:
What SPARK papers I have
found concentrate more on correctness than productivity: IIRC, they
claim millions of lines of production code with no errors.
Writing error-free code is easy. That's just a matter of incremental
improvement of
Steven D'Aprano [EMAIL PROTECTED] writes:
On Mon, 02 Jan 2006 19:35:10 -0500, Mike Meyer wrote:
What SPARK papers I have
found concentrate more on correctness than productivity: IIRC, they
claim millions of lines of production code with no errors.
Writing error-free code is easy. That's just
Now I am curious. How do Python 2.5 and Ruby create new control
structures? Any code samples or links?
Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
James [EMAIL PROTECTED] wrote:
Now I am curious. How do Python 2.5 and Ruby create new control
structures? Any code samples or links?
A Ruby example of reimplementing while:
def WHILE(cond)
| return if not cond
| yield
| retry
| end
i=0; WHILE(i3) { print i; i+=1 }
Alex Martelli wrote:
A Ruby example of reimplementing while:
def WHILE(cond)
| return if not cond
| yield
| retry
| end
i=0; WHILE(i3) { print i; i+=1 }
Python's a bit less direct here, but:
def WHILE(cond):
if not cond(): return
yield None
In article [EMAIL PROTECTED], Mike Meyer [EMAIL PROTECTED] wrote:
.
[valuable remarks
on scientific
evidence and so on]
.
.
Finally, there's a camp that pushes static typing up
Hans Nowak [EMAIL PROTECTED] wrote:
...
Maybe I misunderstand, but shouldn't this be:
def WHILE(cond):
if not cond(): return
yield None
for x in WHILE(cond): yield x
After all, the original version only yields two things: None and a
generator.
(Or is this behavior
[EMAIL PROTECTED] wrote:
Hi everyone,
I need to write a web app, that will support millions of user accounts,
template-based user pages and files upload. The client is going to be
written in Flash. I wondered if I coudl get your opinions - what do you
think is the best language to use for
Thanks! That's really useful. I'm not sure if I'm a dynamically typed
guy - coming form C#, very strict language, and C++, statically typed,
but i definetly searched and see the debate going strong. Not try to
start it here, but do you think that statically typed - namely, if I
undertood
NOKs [EMAIL PROTECTED] wrote:
Thanks! That's really useful. I'm not sure if I'm a dynamically typed
guy - coming form C#, very strict language, and C++, statically typed,
C#'s pretty close to Java, typing-wise, and C++'s not that far away. I
did mention one GOOD statically typed language in
At a command prompt, do which python to see where the python binary
lives. Then specify the full path to python in your exec() call,
instead of just python. What probably happens is that you don't have
the python binary in your PATH when you run exec() from your Java code.
Grig
--
83 matches
Mail list logo