Talk Python to Me with GvR

2017-02-26 Thread Terry Reedy

https://player.backtracks.fm/talkpython/m/100-guido-van-rossum

Both audio and transcript.  There is more discussion of Guido's 
pre-Python work than I have read before.


Discussion of Python 3 migration starts at 37:05.  Guido says harder 
than expected because Python was more popular than he was aware of at 
the time.


--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list


Re: Python (and me) getting confused finding keys

2009-12-23 Thread John

 The lesson of this? Do not make mutable classes hashable.

That could be it! I'll try. Thanks a lot!

 The obvious follow-up is to ask how to make an immutable class.
 
 http://northernplanets.blogspot.com/2007/01/immutable-instances-in-python.h
 tml
 
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python (and me) getting confused finding keys

2009-12-22 Thread Robin Becker

On 22/12/2009 16:33, John wrote:

Hi there,

I have a rather lengthy program that troubles me for quite some time. After
some debugging, I arrived at the following assertion error:

for e in edges.keys():
assert edges.has_key(e)

Oops!? Is there ANY way that something like this can possibly happen?

Cheers,
John
another thread can remove the key prior to the has_key call; or perhaps edges 
isn't a real dictionary?


--
Robin Becker

--
http://mail.python.org/mailman/listinfo/python-list


Re: Python (and me) getting confused finding keys

2009-12-22 Thread Tim Golden

John wrote:

Hi there,

I have a rather lengthy program that troubles me for quite some time. After 
some debugging, I arrived at the following assertion error:


for e in edges.keys():
assert edges.has_key(e)

Oops!? Is there ANY way that something like this can possibly happen?


Three ways that I can think of. Doubtless there are more.

1) Mutating the dictionary within the loop:

edges = dict.fromkeys (range (10))
for e in edges.keys ():
 assert edges.has_key (e), edges does not have %s % e
 del edges[e + 1]


2) A race condition (sort of generalisation of (1)): 
some other thread removes something from edges during the iteration



3) edges isn't a dictionary but a dictalike structure which
doesn't do what you expect for .keys and .has_key.

TJG
--
http://mail.python.org/mailman/listinfo/python-list


Re: Python (and me) getting confused finding keys

2009-12-22 Thread Christian Heimes
John schrieb:
 Hi there,
 
 I have a rather lengthy program that troubles me for quite some time. After 
 some debugging, I arrived at the following assertion error:
 
 for e in edges.keys():
   assert edges.has_key(e)
 
 Oops!? Is there ANY way that something like this can possibly happen?

Yes, it happens when another part of your program -- most likely a
thread -- modifies edges while you are iterating over its keys. The
keys() method of a dict returns a *copy* of its keys. If you had uses
for e in edges you'd have seen a RuntimeError dictionary changed size
during iteration. With keys() you see the snapshot of edges's keys when
keys() is called.

Christian

PS: Use e in edges instead of edges.has_key(e). It's faster.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python (and me) getting confused finding keys

2009-12-22 Thread John
 another thread can remove the key prior to the has_key call; or perhaps
  edges isn't a real dictionary?
 

of course. But unless there is a way of using threading without being aware of 
it, this is not the case. Also, edges is definitely a dict (has been declared 
some lines before, and no obscure functions have been called in the meantime, 
just some adding to edges). Python would also fail on edges.keys() if edges 
wasn't a dict...


cheers,
john
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python (and me) getting confused finding keys

2009-12-22 Thread Zac Burns
On Tue, Dec 22, 2009 at 8:56 AM, John j...@nurfuerspam.de wrote:

  another thread can remove the key prior to the has_key call; or perhaps
   edges isn't a real dictionary?
 

 of course. But unless there is a way of using threading without being aware
 of
 it, this is not the case. Also, edges is definitely a dict (has been
 declared
 some lines before, and no obscure functions have been called in the
 meantime,
 just some adding to edges). Python would also fail on edges.keys() if edges
 wasn't a dict...


 cheers,
 john
 --
 http://mail.python.org/mailman/listinfo/python-list


Perhaps e doesn't have a consistent hash value.

--
Zachary Burns
(407)590-4814
Aim - Zac256FL
Production Engineer (Digital Overlord)
Zindagi Games
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python (and me) getting confused finding keys

2009-12-22 Thread Tim Golden

John wrote:

another thread can remove the key prior to the has_key call; or perhaps
 edges isn't a real dictionary?



of course. But unless there is a way of using threading without being aware of 
it, this is not the case. Also, edges is definitely a dict (has been declared 
some lines before, and no obscure functions have been called in the meantime, 
just some adding to edges). Python would also fail on edges.keys() if edges 
wasn't a dict...


Well of course you only showed us three lines of code which
means that all possibilities are open. And edges.keys () would certainly
be valid for something like this (random) class:


code

class Edges (object):
 def __init__ (self):
   self._keys = range (10)
 def keys (self):
   return [k * k for k in self._keys]
 def has_key (self, key):
   return False
 def __getitem__ (self, key):
   return self._keys.index (key)

edges = Edges ()

for e in edges.keys ():
 assert edges.has_key (e)

/code


A bizarre example, certainly, but one which illustrates what
*might* be happening especially if you only show peephole
code.

TJG
--
http://mail.python.org/mailman/listinfo/python-list


Re: Python (and me) getting confused finding keys

2009-12-22 Thread Gabriel Genellina

En Tue, 22 Dec 2009 13:56:36 -0300, John j...@nurfuerspam.de escribió:


another thread can remove the key prior to the has_key call; or perhaps
 edges isn't a real dictionary?



of course. But unless there is a way of using threading without being  
aware of
it, this is not the case. Also, edges is definitely a dict (has been  
declared
some lines before, and no obscure functions have been called in the  
meantime,
just some adding to edges). Python would also fail on edges.keys() if  
edges

wasn't a dict...


Ok, then your edges are mutable:

py class Edge:
...   def __init__(self, x):
... self.x = x
...   def __eq__(self, other):
... return self.x==other.x
...   def __hash__(self):
... return hash(self.x)
...
py e1 = Edge(1)
py e2 = Edge(2)
py e3 = Edge(3)
py edges = {e1:None, e2:None, e3:None}
py e2.x = 5
py for e in edges.keys():
...   assert edges.has_key(e)
...
Traceback (most recent call last):
  File stdin, line 2, in module
AssertionError
py for e in edges:
...   assert e in edges
...
Traceback (most recent call last):
  File stdin, line 2, in module
AssertionError

Once you compute an object's hash, it must remain immutable. Is this your  
problem?


--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list


Re: Python (and me) getting confused finding keys

2009-12-22 Thread Lie Ryan

On 12/23/2009 3:33 AM, John wrote:

Hi there,

I have a rather lengthy program that troubles me for quite some time. After
some debugging, I arrived at the following assertion error:

for e in edges.keys():
assert edges.has_key(e)

Oops!? Is there ANY way that something like this can possibly happen?


in a multithreaded program, it's possible another thread erased 'e' 
after the for-loop grabbed it but before the suite is executed.


but often you'll get something like this:
RuntimeError: dictionary changed size during iteration
--
http://mail.python.org/mailman/listinfo/python-list


Re: Python (and me) getting confused finding keys

2009-12-22 Thread Terry Reedy

On 12/22/2009 11:33 AM, John wrote:

Hi there,

I have a rather lengthy program that troubles me for quite some time. After
some debugging, I arrived at the following assertion error:

for e in edges.keys():
assert edges.has_key(e)


If you are claiming that the above *did* raise AssertionError, then you 
should show a complete, standalone example, including the code that 
created edges. That includes the class statement since the above would 
not happen with a builtin dict. Unless, of oourse, playing guessing 
games is your intention ;-).


tjr

--
http://mail.python.org/mailman/listinfo/python-list


Re: Python (and me) getting confused finding keys

2009-12-22 Thread Steven D'Aprano
On Tue, 22 Dec 2009 17:47:14 +0100, Christian Heimes wrote:

 John schrieb:
 Hi there,
 
 I have a rather lengthy program that troubles me for quite some time.
 After some debugging, I arrived at the following assertion error:
 
 for e in edges.keys():
  assert edges.has_key(e)
 
 Oops!? Is there ANY way that something like this can possibly happen?
 
 Yes, it happens when another part of your program -- most likely a
 thread -- modifies edges while you are iterating over its keys. The
 keys() method of a dict returns a *copy* of its keys. If you had uses
 for e in edges you'd have seen a RuntimeError dictionary changed size
 during iteration.

To be pedantic, you *might* have seen a RuntimeError, as the heuristic 
for detecting modifications during iteration is fairly simple and can 
only detect changes that change the size of the dict.

 d = {1: 'a', 2: 'b', 3: 'c'}
 n = 1
 for key in d:
... del d[n]
... d[str(n)] = None
... n += 1
...
 d
{'1': None, '2': None, '3': None}



-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python (and me) getting confused finding keys

2009-12-22 Thread Steven D'Aprano
On Tue, 22 Dec 2009 17:33:04 +0100, John wrote:

 Hi there,
 
 I have a rather lengthy program that troubles me for quite some time.
 After some debugging, I arrived at the following assertion error:
 
 for e in edges.keys():
   assert edges.has_key(e)
 
 Oops!? Is there ANY way that something like this can possibly happen?

In another post, you assert that:

(1) You aren't knowingly using threads, so it's not likely that another 
thread is modifying edges.

(2) edges is a regular dictionary, not a custom mapping class.


In that case, I would say that the most likely culprit is that the edges 
are mutable but given a hash function. I can reproduce the problem like 
this:


 class Edge:
... def __init__(self, start, finish):
... self.ends = (start, finish)
... def __eq__(self, other):
... return self.ends == other.ends
... def __hash__(self):
... return hash(self.ends)
...
 edges = {Edge(1, 5): None}
 for e in edges:
... assert e in edges  # same as edges.has_key(e)
... e.ends = (5, 6)
... assert e in edges, and now it's gone
...
Traceback (most recent call last):
  File stdin, line 4, in module
AssertionError: and now it's gone



So the likely problem is that your edge type is mutable and being mutated.

Now, if your code snippet above:

for e in edges.keys():
assert edges.has_key(e)


is a literal copy-and-paste from the failing code, I can only assume that 
the edge type __eq__ or __hash__ method mutates self.

The lesson of this? Do not make mutable classes hashable.

The obvious follow-up is to ask how to make an immutable class.

http://northernplanets.blogspot.com/2007/01/immutable-instances-in-python.html



-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python (and me) getting confused finding keys

2009-12-22 Thread Alf P. Steinbach

* Steven D'Aprano:



[snip]

The obvious follow-up is to ask how to make an immutable class.

http://northernplanets.blogspot.com/2007/01/immutable-instances-in-python.html


Thanks, I've been wondering about that.

By the way, the link at the bottom in the article you linked to, referring to an 
earlier posting by Alex Martelli, was broken.


I believe it was the posting available here: url: 
http://www.opensubscriber.com/message/python-list@python.org/2659890.html.



Cheers,

- Alf
--
http://mail.python.org/mailman/listinfo/python-list


Re: Looking for a dream language: sounds like Python to me.

2009-07-30 Thread ray
 Where can I find a Python functionality like simulink  ?

Stef,

I saw this at:
http://showmedo.com/videotutorials/video?name=743fromSeriesID=743

Ray
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Looking for a dream language: sounds like Python to me.

2009-07-28 Thread ray
On Jul 27, 10:39 am, David Cournapeau courn...@gmail.com wrote:
 On Tue, Jul 28, 2009 at 12:28 AM, Dotan Cohendotanco...@gmail.com wrote:
  It is neither efficient or inefficient: it is just a distribution
  tool, to deploy python software in a form familiar to most windows
  users. It does not make it any faster than running the software under
  a python prompt.

  As much as I like python for scientific programming, I would say
  python is pretty far from the stated requirements in the posted blog
  post. It is difficult to deploy software written with python (much
  better than the alternatives, though), and it is slow if you can't
  leverage numpy/scipy (where vectorization does not apply).

  It remains to be seen whether it will be true in practice, but
  something like F#, with its integration in VS 2010, seems much closer
  IMHO. It is compiled, high level language, and backed by the biggest
  software vendor in the world.

  The blog post is not looking to distribute his code, but he would like
  it to be cross platform for his own reasons. VB is not cross platform.

 I understand his efficient binary as Ansi C partially as a
 deployment requirement, and independent of cross-platform issues. As a
 scientist, being able to share my software with colleagues is a non
 trivial matter. Python does not make this easy today.

 F# has nothing to do with VB: F# is a ML-language inspired from OCAML,
 and run on top of the CLR. It can thus leverage the huge .net
 framework (lack of non numerical API is one of the biggest matlab
 hindrance, and comparatively big advantage of python + numpy/scipy),
 and benefits from the much more efficient implementation compared to
 python (under the currently CPython implementation at least).

 Some recent F# versions are compatible with mono, making it compatible
 on most platforms that matter today for research (but of course, you
 lose the IDE integration outside windows).

 David- Hide quoted text -

 - Show quoted text -
I wish . . .

For comparisons, Mathcad has the symbolic notation appropriate for
mathematical communications.  I like features of Mathematica and Maple
but Mathcad provides for the user to 'stay' with mathematical
symbolism longer.  I prefer Matlab execution environment.  So I
develop concepts in Mathcad, prove them in Matlab and then compile to
through C where direct performance is required.  Maple and Matlab have
this type of relation.

Matlab, from The Mathworks, has a companion product called Simulink.
This allows the user to graphically build ‘algorithms’ in block form.
There is a similar Python function.

Each of these components would best be served if allowed to exist
independently but supported with transparent integration.  I would
like to develop in a stable user environment - a stable GUI.  And then
allow efficient algorithms behind the scenes.

By separating the functionality of the workspace, the user can be
given (or create at will) a GUI that suites her desires and provides
for the creativity and productivity she chooses.  The functionality
under the GUI should then be pluggable.  Developers can provide
solutions from many directions, compete for varying performance
requirements, enhance functional features technology changes, and
still not disturb the fragile user interface.

Allow the user the comfort of home.  Let them keep whatever GUI suits
them and provide for their deployment (if any) needs behind the
scenes.

Ray




-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Looking for a dream language: sounds like Python to me.

2009-07-28 Thread Stef Mientki



Matlab, from The Mathworks, has a companion product called Simulink.
This allows the user to graphically build ‘algorithms’ in block form.
There is a similar Python function.
  

Where can I find a Python functionality like simulink  ?

thanks,
Stef Mientki



--
http://mail.python.org/mailman/listinfo/python-list


Re: Looking for a dream language: sounds like Python to me.

2009-07-27 Thread Piet van Oostrum
 Dotan Cohen dotanco...@gmail.com (DC) wrote:

DC Referring to this article:
DC 
http://math-blog.com/2009/07/20/complex-algorithm-research-and-development-harder-than-many-think/

DC The author, who is specifically looking for math-related functions, writes:
DC 
DC The dream algorithm RD tool would be similar to Matlab or Mathematica
DC but could be compiled to fast, efficient binaries similar to ANSI C
DC and would be available for all platforms. An integrated GUI builder
DC similar to Visual Basic and integrated network support would be
DC helpful.
DC 

DC It looks to me like he is looking for Python.

No fast, efficient binaries yet, and no integrated GUI builder.
-- 
Piet van Oostrum p...@cs.uu.nl
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Looking for a dream language: sounds like Python to me.

2009-07-27 Thread Mohammad Tayseer
You can generate binaries using py2exe, and you can create UI using Tkinter 
(which is very easy) or wxPython (which have GUI builders)

 Mohammad Tayseer
http://spellcoder.com/blogs/tayseer






From: Piet van Oostrum p...@cs.uu.nl
To: python-list@python.org
Sent: Monday, July 27, 2009 11:18:20 AM
Subject: Re: Looking for a dream language: sounds like Python to me.

 Dotan Cohen dotanco...@gmail.com (DC) wrote:

DC Referring to this article:
DC 
http://math-blog.com/2009/07/20/complex-algorithm-research-and-development-harder-than-many-think/

DC The author, who is specifically looking for math-related functions, writes:
DC 
DC The dream algorithm RD tool would be similar to Matlab or Mathematica
DC but could be compiled to fast, efficient binaries similar to ANSI C
DC and would be available for all platforms. An integrated GUI builder
DC similar to Visual Basic and integrated network support would be
DC helpful.
DC 

DC It looks to me like he is looking for Python.

No fast, efficient binaries yet, and no integrated GUI builder.
-- 
Piet van Oostrum p...@cs.uu.nl
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
-- 
http://mail.python.org/mailman/listinfo/python-list



  -- 
http://mail.python.org/mailman/listinfo/python-list


Re: Looking for a dream language: sounds like Python to me.

2009-07-27 Thread Ethan Furman

[corrected top posting]

Mohammad Tayseer wrote:

*From:* Piet van Oostrum p...@cs.uu.nl
*To:* python-list@python.org
*Sent:* Monday, July 27, 2009 11:18:20 AM
*Subject:* Re: Looking for a dream language: sounds like Python to me.

  Dotan Cohen dotanco...@gmail.com mailto:dotanco...@gmail.com 
(DC) wrote:


 DC Referring to this article:
DC 

http://math-blog.com/2009/07/20/complex-algorithm-research-and-development-harder-than-many-think/

 DC The author, who is specifically looking for math-related 
functions, writes:

 DC 
 DC The dream algorithm RD tool would be similar to Matlab or Mathematica
 DC but could be compiled to fast, efficient binaries similar to ANSI C
 DC and would be available for all platforms. An integrated GUI builder
 DC similar to Visual Basic and integrated network support would be
 DC helpful.
 DC 

 DC It looks to me like he is looking for Python.

No fast, efficient binaries yet, and no integrated GUI builder.
--
Piet van Oostrum p...@cs.uu.nl mailto:p...@cs.uu.nl
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org mailto:p...@vanoostrum.org
--
http://mail.python.org/mailman/listinfo/python-list


 You can generate binaries using py2exe, and you can create UI using
 Tkinter (which is very easy) or wxPython (which have GUI builders)

 Mohammad Tayseer
 http://spellcoder.com/blogs/tayseer

Creating binaries is not the same as creating /fast, efficient/ 
binaries.  Py2Exe bundles it all together, but does not make it any faster.


~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list


Re: Looking for a dream language: sounds like Python to me.

2009-07-27 Thread Dotan Cohen
 Creating binaries is not the same as creating /fast, efficient/ binaries.
  Py2Exe bundles it all together, but does not make it any faster.


How inefficient is py2exe. I was under the impression that it's really
not that bad.

-- 
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Looking for a dream language: sounds like Python to me.

2009-07-27 Thread Jean-Paul Calderone

On Mon, 27 Jul 2009 18:12:09 +0300, Dotan Cohen dotanco...@gmail.com wrote:

Creating binaries is not the same as creating /fast, efficient/ binaries.
 Py2Exe bundles it all together, but does not make it any faster.



How inefficient is py2exe. I was under the impression that it's really
not that bad.



py2exe doesn't really change the performance characteristics of a Python
application at all - for better or for worse.

Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list


Re: Looking for a dream language: sounds like Python to me.

2009-07-27 Thread David Cournapeau
On Tue, Jul 28, 2009 at 12:12 AM, Dotan Cohendotanco...@gmail.com wrote:
 Creating binaries is not the same as creating /fast, efficient/ binaries.
  Py2Exe bundles it all together, but does not make it any faster.


 How inefficient is py2exe.

It is neither efficient or inefficient: it is just a distribution
tool, to deploy python software in a form familiar to most windows
users. It does not make it any faster than running the software under
a python prompt.

As much as I like python for scientific programming, I would say
python is pretty far from the stated requirements in the posted blog
post. It is difficult to deploy software written with python (much
better than the alternatives, though), and it is slow if you can't
leverage numpy/scipy (where vectorization does not apply).

It remains to be seen whether it will be true in practice, but
something like F#, with its integration in VS 2010, seems much closer
IMHO. It is compiled, high level language, and backed by the biggest
software vendor in the world.

David
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Looking for a dream language: sounds like Python to me.

2009-07-27 Thread Grant Edwards
On 2009-07-27, Dotan Cohen dotanco...@gmail.com wrote:
 Creating binaries is not the same as creating /fast, efficient/ binaries.
 ??Py2Exe bundles it all together, but does not make it any faster.

 How inefficient is py2exe.

[Assuming that was a question.]

py2exe just bundles up the files needed to run the program.
The result runs pretty much the same as it did when it was
unbundled.  By default, py2exe combines some stuff in a zip
file, so that might slow down startup by a tiny amount. If
you don't like that, you can tell py2exe not to zip things
up, and then the program runs pretty much identically as did
the unbundled version.

 I was under the impression that it's really not that bad.

py2exe doesn't really have any impact on the program's
perfromance.  It's still the same Python VM running the same
bytecode using the same library files.

-- 
Grant Edwards   grante Yow! I'm totally DESPONDENT
  at   over the LIBYAN situation
   visi.comand the price of CHICKEN
   ...
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Looking for a dream language: sounds like Python to me.

2009-07-27 Thread Dotan Cohen
 It is neither efficient or inefficient: it is just a distribution
 tool, to deploy python software in a form familiar to most windows
 users. It does not make it any faster than running the software under
 a python prompt.

 As much as I like python for scientific programming, I would say
 python is pretty far from the stated requirements in the posted blog
 post. It is difficult to deploy software written with python (much
 better than the alternatives, though), and it is slow if you can't
 leverage numpy/scipy (where vectorization does not apply).

 It remains to be seen whether it will be true in practice, but
 something like F#, with its integration in VS 2010, seems much closer
 IMHO. It is compiled, high level language, and backed by the biggest
 software vendor in the world.


The blog post is not looking to distribute his code, but he would like
it to be cross platform for his own reasons. VB is not cross platform.


-- 
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Looking for a dream language: sounds like Python to me.

2009-07-27 Thread David Cournapeau
On Tue, Jul 28, 2009 at 12:28 AM, Dotan Cohendotanco...@gmail.com wrote:
 It is neither efficient or inefficient: it is just a distribution
 tool, to deploy python software in a form familiar to most windows
 users. It does not make it any faster than running the software under
 a python prompt.

 As much as I like python for scientific programming, I would say
 python is pretty far from the stated requirements in the posted blog
 post. It is difficult to deploy software written with python (much
 better than the alternatives, though), and it is slow if you can't
 leverage numpy/scipy (where vectorization does not apply).

 It remains to be seen whether it will be true in practice, but
 something like F#, with its integration in VS 2010, seems much closer
 IMHO. It is compiled, high level language, and backed by the biggest
 software vendor in the world.


 The blog post is not looking to distribute his code, but he would like
 it to be cross platform for his own reasons. VB is not cross platform.

I understand his efficient binary as Ansi C partially as a
deployment requirement, and independent of cross-platform issues. As a
scientist, being able to share my software with colleagues is a non
trivial matter. Python does not make this easy today.

F# has nothing to do with VB: F# is a ML-language inspired from OCAML,
and run on top of the CLR. It can thus leverage the huge .net
framework (lack of non numerical API is one of the biggest matlab
hindrance, and comparatively big advantage of python + numpy/scipy),
and benefits from the much more efficient implementation compared to
python (under the currently CPython implementation at least).

Some recent F# versions are compatible with mono, making it compatible
on most platforms that matter today for research (but of course, you
lose the IDE integration outside windows).

David
-- 
http://mail.python.org/mailman/listinfo/python-list


Looking for a dream language: sounds like Python to me.

2009-07-26 Thread Dotan Cohen
Referring to this article:
http://math-blog.com/2009/07/20/complex-algorithm-research-and-development-harder-than-many-think/

The author, who is specifically looking for math-related functions, writes:

The dream algorithm RD tool would be similar to Matlab or Mathematica
but could be compiled to fast, efficient binaries similar to ANSI C
and would be available for all platforms. An integrated GUI builder
similar to Visual Basic and integrated network support would be
helpful.


It looks to me like he is looking for Python.

-- 
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is Python for me?

2007-02-09 Thread [EMAIL PROTECTED]
On Feb 9, 5:08 am, jiddu [EMAIL PROTECTED] wrote:
 I'm planning to create a poker calculator, I learned some basic in
 highschool years ago and I was told for beginners Python is a good
 language to start.

Be sure to check out the Python411 podcast
http://awaretek.com/python/index.html

Take care,
Davy

http://www.latedecember.co.uk/sites/personal/davy/?clp

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is Python for me?

2007-02-09 Thread Neil Cerutti
On 2007-02-09, jiddu [EMAIL PROTECTED] wrote:
 Hi,

 I'm planning to create a poker calculator, I learned some basic
 in highschool years ago and I was told for beginners Python is
 a good language to start.

Python *is* a good language to start.

 What I wanted to do is to first write a program which will be
 able to run through all the possible combinations of cards
 dealt out and use some counters to calculate different
 probabilities at different stages. Since that is a lot of data
 I think I have to store it in some kind of database or
 spreadsheet type thing? 

Unfortunately, that is a very *difficult* problem; no programming
library (save a hypothetical poker probability library) can make
it easy.

 Then I wanted to write a simple user interface so I could use
 my mouse to make selections of cards that I am dealt and that
 come on the flop and how many opponents and have the program
 find the calculated information and display it on the screen.

 I am wondering if I learn to use Python will I be able to write
 something like this? My friend studied some C in college so I
 thought I'd learn C++, turns out it is a very complicated
 language so I thought maybe I should try something else before
 I commit more time to the language.

Python can help you with creating an user interface, and with
several simple, powerful data structures. I think you ought to
lower your ambition a bit, at first. Firts write a program to
rank complete sets of poker hands. That should hold you for a
while.

-- 
Neil Cerutti
The recording I listened to had Alfred Brendel doing the dirty work of
performing this sonata (Liszt B minor) --Music Lit Essay
-- 
http://mail.python.org/mailman/listinfo/python-list


Is Python for me?

2007-02-08 Thread jiddu
Hi,

I'm planning to create a poker calculator, I learned some basic in
highschool years ago and I was told for beginners Python is a good
language to start.

What I wanted to do is to first write a program which will be able to run
through all the possible combinations of cards dealt out and use some
counters to calculate different probabilities at different stages. Since
that is a lot of data I think I have to store it in some kind of database
or spreadsheet type thing? 

Then I wanted to write a simple user interface so I could use my mouse to
make selections of cards that I am dealt and that come on the flop and how
many opponents and have the program find the calculated information and
display it on the screen.

I am wondering if I learn to use Python will I be able to write something
like this? My friend studied some C in college so I thought I'd learn C++,
turns out it is a very complicated language so I thought maybe I should try
something else before I commit more time to the language.

Thank you very much in advance 

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is Python for me?

2007-02-08 Thread James Stroud
jiddu wrote:
 Hi,
 
 I'm planning to create a poker calculator, I learned some basic in
 highschool years ago and I was told for beginners Python is a good
 language to start.
 
 What I wanted to do is to first write a program which will be able to run
 through all the possible combinations of cards dealt out and use some
 counters to calculate different probabilities at different stages. Since
 that is a lot of data I think I have to store it in some kind of database
 or spreadsheet type thing? 
 
 Then I wanted to write a simple user interface so I could use my mouse to
 make selections of cards that I am dealt and that come on the flop and how
 many opponents and have the program find the calculated information and
 display it on the screen.
 
 I am wondering if I learn to use Python will I be able to write something
 like this? My friend studied some C in college so I thought I'd learn C++,
 turns out it is a very complicated language so I thought maybe I should try
 something else before I commit more time to the language.
 
 Thank you very much in advance 
 

Yes, use python, you will get the most return on your learning effort, 
though some learning is required. Start at python.org - docs - tutorial.

James
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is Python for me?

2007-02-08 Thread azrael
i hope you know that for this task, if you want it to be successfull,
you need a really big database. it sounds very simple to this. it
sounds like go through all possible permutations. before you start
writing any code take a pencil and a big paper and do some maths. i
sugesst you read and practise this for about a year about data
structures, algorithms and graph theory (just for the begining). Then
take a look on data mining and then incpect the era model so you can
design a good database.
Tic Tac Toe is a much easier problem and there are a lot of possible
different games (9*8*7*6*5*4*3*2*1=362 880  i dont consider the
rotations).

it's true that you learn best by solving a problem, but if stoped on
basic on higjschool, then you will need a lot of time to solve this
problem. If you remember basic than you should learn python according
to basic's possibillities in maximum a month. depending on talent and
spare time.

i sugesst you take some a a little bit easier problem to learn
python.

For this speciffic problem it shold be good to learn on other games. I
started about 7 years ago on tic tac toe and then with reversi.

You are from USA? I come from a differtent continent so i don't know
what you learn in schools. But if you didn't learn it, take a look on
statistics. very usefull. you should at least know what specific terms
mean althought python has them in the numpy module.

don't be afraid of all that i said. keep learning and it will pay off.
at the end when you crack the poker machine :-)
that's the life of a geek. learn , learn, learn and one day comes the
jackpot.




--
and no, I am not a junkee, I'm addicted to Python

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is Python for me?

2007-02-08 Thread azrael
i forgot a query language. something like postgre or mysql


On Feb 9, 7:37 am, azrael [EMAIL PROTECTED] wrote:
 i hope you know that for this task, if you want it to be successfull,
 you need a really big database. it sounds very simple to this. it
 sounds like go through all possible permutations. before you start
 writing any code take a pencil and a big paper and do some maths. i
 sugesst you read and practise this for about a year about data
 structures, algorithms and graph theory (just for the begining). Then
 take a look on data mining and then incpect the era model so you can
 design a good database.
 Tic Tac Toe is a much easier problem and there are a lot of possible
 different games (9*8*7*6*5*4*3*2*1=362 880  i dont consider the
 rotations).

 it's true that you learn best by solving a problem, but if stoped on
 basic on higjschool, then you will need a lot of time to solve this
 problem. If you remember basic than you should learn python according
 to basic's possibillities in maximum a month. depending on talent and
 spare time.

 i sugesst you take some a a little bit easier problem to learn
 python.

 For this speciffic problem it shold be good to learn on other games. I
 started about 7 years ago on tic tac toe and then with reversi.

 You are from USA? I come from a differtent continent so i don't know
 what you learn in schools. But if you didn't learn it, take a look on
 statistics. very usefull. you should at least know what specific terms
 mean althought python has them in the numpy module.

 don't be afraid of all that i said. keep learning and it will pay off.
 at the end when you crack the poker machine :-)
 that's the life of a geek. learn , learn, learn and one day comes the
 jackpot.

 --
 and no, I am not a junkee, I'm addicted to Python


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is Python for me?

2007-02-08 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED],
jiddu wrote:

 I'm planning to create a poker calculator, I learned some basic in
 highschool years ago and I was told for beginners Python is a good
 language to start.

There's a recipe in the Cookbook that might be interesting for you:

  http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/415504

And a library called `poker-eval` with Python bindings:

  http://pokersource.org/

Ciao,
Marc 'BlackJack' Rintsch
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is python for me?

2006-11-22 Thread cyberco
One resource you should always keep at hand is this extremely useful
Quick Reference:

http://rgruet.free.fr/PQR24/PQR2.4.html

Study it carefully, there is a lot in there that can teach you about
how Python works. Fire up IPython as well and start hacking!

2B

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is python for me?

2006-11-17 Thread Magnus Lycka
I think Python is for you.

lennart wrote:
 Can you define 'large'? Is that large in code, or large in database? I
 don't know which database is supported. If its a external db, like
 MySql, the query is performed through the software of MySql, am I
 right? If I'm correct, the 'slowness' comes from the amount of code in
 python itself, not from the database.

I'm afraid dakman's comment wasn't really very helpful.

Size is not a problem in itself. Ok, if the code modules are very
large, you will have a larger startup time, but this is probably
even worse in lower level languages such as C/C++. The python byte
code works at a higher level of abstraction than machine code, so
the byte code files are much more compact than corresponding
executable binaries from e.g. C/C++/Delphi.

The Python programming language, with its classes, modules,
packages etc is in my experience much better for writing large 
applications without causing a mess than e.g. C++. It's much
easier to make a mess with C/C++'s #include than with Python's
import. The lack of static typing means that some problems that
the compiler/linker would find in e.g. C++ development won't turn
up until you test your code in Python, but you'll get to testing
much faster with Python, and if you don't test well, you'll fail
with any larger development project however clever your compiler
and linker is.

Due to Python's very dynamic nature, there are a lot of operations
that will be much slower than in e.g. C or C++. For instance, if
you write a = b + c in C, the compiler knows at compile time what
types a, b and c are, and if they for example are ints, the addition
will be translated into a few very simple and quick machine code
instructions. In Python, the types typically won't be know until
runtime. This means that the objects need to be inspected during
execution to figure out what + means for these kinds of objects.
Python also handles memory allocation etc.

The consequence of this is that some kinds of programs that do
millions of trivial things, such as cryptography applications
where there are a lot of repeated multiplications and additions,
would be much, much slower in pure Python than in pure C. This
doesn't mean that Python is bad for a large group of applications.
It means that for a large group of applications, there are some
parts (for instance computationally intensive or e.g. interfacing
with some kind of devices or third party products) that should be
handled by extensions written in e.g. C.

Whatever you plan to do, it's likely that the extensions you need
already exists. There are such extensions for databases, networking,
maths, cryptography, XML parsing, etc etc. I'm a programmer working
with C, C++, Python, SQL etc, and despite 10 years of Python coding
I never actually needed to code any C extension myself yet. It's
very likely that you'll get away using 100% pure Python too. Note
that large parts of your programs will be C code, but C code you
didn't have to write yourself, and as far as your programming is
concerned it could as well have been Python, it's just that things
will run faster than if it had been pure Python...

Have fun!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is python for me?

2006-11-16 Thread [EMAIL PROTECTED]
Yes of course python can handle of these things, but have you actually
compared them to something written in C? Even if the app was converted
into bytecode, it's still not as fast as an executable, that's all I am
saying.
Bruno Desthuilliers wrote:
 [EMAIL PROTECTED] wrote:
  By large I mean an application with intensive operations, such as a
  fancy GUI maybe a couple of threads, accessing a database, etc.
 

 Threads are handled by the OS. GUI are (usually) handled by a
 lower-level lib like GTK or such. DB access mostly rely on the
 particular RDBMS. So we're left with the application code itself - the
 glue between all these componants. There's usually nothing really
 intensive here, and I wouldn't bet using C++ instead of Python would
 make a huge difference here - wrt/ perceived performances at least.

 My 2 cents...
 --
 bruno desthuilliers
 python -c print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
 p in '[EMAIL PROTECTED]'.split('@')])

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is python for me?

2006-11-15 Thread rodmc
[EMAIL PROTECTED] wrote:

 By large I mean an application with intensive operations, such as a
 fancy GUI maybe a couple of threads, accessing a database, etc.

I am still fairly new to Python, I only started using it at the start
of this year and then stopped for a while. However the project I
undertook at the start of the year built a system using the
technologies above, in addition it used SVG graphics, Jabber Instant
messaging and the windows API. All of these were built within threads
and used a client/server architecture.  I have also built some small
wxPython based GUI's.

Overall I found Python ideal for the task, both in terms of development
time and reliability - although my knowledge of the Windows API was not
what it should have been (I mainly used Linux/Mac OS X user) so I
experienced a few problems. Also there was a lack of good online docs
about Python based Windows API calls.

You can interface to a few databases very easily including MySQL and
SQLite. I have been using the latter recently for my task and it works
very well. Also I have found that using Stackless Python drastically
improves the reliability of thread based applications. Also performance
can be substantially improved by using the Psyco library, although I
have know it to make things worse.

Overall my experience of Python was very positive and this was in no
small part due to the help I received from people here.

I hope this helps.

Best,

Rod

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is python for me?

2006-11-15 Thread Bruno Desthuilliers
[EMAIL PROTECTED] wrote:
 By large I mean an application with intensive operations, such as a
 fancy GUI maybe a couple of threads, accessing a database, etc.
 

Threads are handled by the OS. GUI are (usually) handled by a
lower-level lib like GTK or such. DB access mostly rely on the
particular RDBMS. So we're left with the application code itself - the
glue between all these componants. There's usually nothing really
intensive here, and I wouldn't bet using C++ instead of Python would
make a huge difference here - wrt/ perceived performances at least.

My 2 cents...
-- 
bruno desthuilliers
python -c print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in '[EMAIL PROTECTED]'.split('@')])
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is python for me?

2006-11-14 Thread Mark Woodward
On Mon, 13 Nov 2006 09:11:13 -0800, lennart wrote:

 Hi,
 
 I'm planning to learn a language for 'client' software. Until now, i
 'speak' only some web based languages, like php. As a kid i programmed
 in Basic (CP/M, good old days :'-) ) Now i want to start to learn a
 (for me) new computer language.
 
 I like Python. Its free, easy to learn and some favorite programs of my
 are written in Python / can understand Python (like OpenOffice) etc.
 
 But I'm not a full-time programmer. I know, that I've only time 
 possibility to learn one (= 1) language good. So i ask myself is python
 the language I'm looking for?
...

I've been hesitant to write this in the past but seems like a good time.

I'm at the same stage, but (and this is NOT a troll) I'm tossing up
between Python and Ruby. I know this has been discussed numerous times but
I'd like to come at it from a different angle. 

I've been 'playing' with both languages and to be honest it's a case of 6
of one, half a dozen of the other. If I'm using python I 'think' python
and if I'm using Ruby I 'think' ruby (if that makes sense). Ie I don't
find I'm more productive in one over the other to any great extent (pretty
unproductive in both ATM to be honest ;-)) .

In the foreseeable future I suspect I'll stick with one and just use it
for things I personally will use/need. But (and here's where I finally get
to a question) I use Linux, I love the whole idea of open source and
contributing in some way. So if I ever get to the stage where I can give
something back is one preferred over the other? I would have thought no
but I read on the Ubuntu site somewhere that they prefer contributions
written in Python/ pyGTK?? Is this just a 'preference' or because python
is installed by default? (whereas Ruby isn't)? Is it just Ubuntu or Linux
distros in general?

I hope you can see where I'm coming from here. I don't want to start a
Python/Ruby flame war. That's not the question. The question is is one
preferred over the other when contributing software and is this just a
particular distros preference?


cheers,


-- 
Mark
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is python for me?

2006-11-14 Thread Steve Holden
Mark Woodward wrote:
 On Mon, 13 Nov 2006 09:11:13 -0800, lennart wrote:
 
 Hi,

 I'm planning to learn a language for 'client' software. Until now, i
 'speak' only some web based languages, like php. As a kid i programmed
 in Basic (CP/M, good old days :'-) ) Now i want to start to learn a
 (for me) new computer language.

 I like Python. Its free, easy to learn and some favorite programs of my
 are written in Python / can understand Python (like OpenOffice) etc.

 But I'm not a full-time programmer. I know, that I've only time 
 possibility to learn one (= 1) language good. So i ask myself is python
 the language I'm looking for?
 
 
 I've been hesitant to write this in the past but seems like a good time.
 
 I'm at the same stage, but (and this is NOT a troll) I'm tossing up
 between Python and Ruby. I know this has been discussed numerous times but
 I'd like to come at it from a different angle. 
 
 I've been 'playing' with both languages and to be honest it's a case of 6
 of one, half a dozen of the other. If I'm using python I 'think' python
 and if I'm using Ruby I 'think' ruby (if that makes sense). Ie I don't
 find I'm more productive in one over the other to any great extent (pretty
 unproductive in both ATM to be honest ;-)) .
 
 In the foreseeable future I suspect I'll stick with one and just use it
 for things I personally will use/need. But (and here's where I finally get
 to a question) I use Linux, I love the whole idea of open source and
 contributing in some way. So if I ever get to the stage where I can give
 something back is one preferred over the other? I would have thought no
 but I read on the Ubuntu site somewhere that they prefer contributions
 written in Python/ pyGTK?? Is this just a 'preference' or because python
 is installed by default? (whereas Ruby isn't)? Is it just Ubuntu or Linux
 distros in general?
 
 I hope you can see where I'm coming from here. I don't want to start a
 Python/Ruby flame war. That's not the question. The question is is one
 preferred over the other when contributing software and is this just a
 particular distros preference?
 
Ubuntu is pretty much a Python-oriented distribution. A lot of people 
like it because you always get a fairly up-to-date Python with lots of 
extras available.

I don't know that much about Ruby, but the best approach to software 
development has always been to choose the best language for solving the 
problem, so you seem to be doing OK.

regards
  Steve
-- 
Steve Holden   +44 150 684 7255  +1 800 494 3119
Holden Web LLC/Ltd  http://www.holdenweb.com
Skype: holdenweb   http://holdenweb.blogspot.com
Recent Ramblings http://del.icio.us/steve.holden

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is python for me?

2006-11-14 Thread [EMAIL PROTECTED]
By large I mean an application with intensive operations, such as a
fancy GUI maybe a couple of threads, accessing a database, etc.

lennart wrote:
 [EMAIL PROTECTED] schreef:

  As stated above python is capable of all those things, however on
  larger applications like that it can tend to slow down a bit. And the
  executables do need a little bit of work, because it's bassicly a dll
  and a library of all your .pyc files. However python is still a great
  language and I would recomend it. And most of these things will
  probably be fixed in Python 3000!
 
  snip
   Python very quickly.

 Can you define 'large'? Is that large in code, or large in database? I
 don't know which database is supported. If its a external db, like
 MySql, the query is performed through the software of MySql, am I
 right? If I'm correct, the 'slowness' comes from the amount of code in
 python itself, not from the database.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is python for me?

2006-11-14 Thread Tim Chase
 By large I mean an application with intensive operations, such
 as a fancy GUI maybe a couple of threads, accessing a
 database, etc.

I can't say I've had any python related problems on such matters.
  I've done some modestly large-sized apps, and the bottlenecks
are almost always I/O bound...disk, network, database (which is
regularly disk or network bound).  Some stuff has done some
fairly intense computation, and it's usually an algorithmic
problem, not a python problem (in my case, it was an O(n^2)
comparison of every element in one list with every element in
another list to find a closest string match to try and gently
merge two datasets on merely a person's ill-formatted name).

I'm not sure I'd write a hard-core nuclear-explosion simulator or
render intense 3d graphics within python.  But I'd readily use
python to glue together low-level optimized versions of libraries
such as OpenGL where performance counts...

-tkc




-- 
http://mail.python.org/mailman/listinfo/python-list


Is python for me?

2006-11-13 Thread lennart
Hi,

I'm planning to learn a language for 'client' software. Until now, i
'speak' only some web based languages, like php. As a kid i programmed
in Basic (CP/M, good old days :'-) ) Now i want to start to learn a
(for me) new computer language.

I like Python. Its free, easy to learn and some favorite programs of my
are written in Python / can understand Python (like OpenOffice) etc.

But I'm not a full-time programmer. I know, that I've only time 
possibility to learn one (= 1) language good. So i ask myself is python
the language I'm looking for?

In the future, i want to write the following applications:
[*] A database driven program, which can handle my clients, tasks and
places (= 3 tables, has to work relative with each other). I think,
this isn't a problem for Python
[*] As a photographer i like to build a picture management system (also
db) with raw support. Raw is the raw-data from the sensor of the
camera. My questions:
- can python encode raw?
- can python head for a utility like dcraw?
- or head for a utility like IrfanView (delphi?) or something like
that? 

Tnx for your help!

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is python for me?

2006-11-13 Thread Cameron Laird
In article [EMAIL PROTECTED],
lennart [EMAIL PROTECTED] wrote:
Hi,

I'm planning to learn a language for 'client' software. Until now, i
'speak' only some web based languages, like php. As a kid i programmed
in Basic (CP/M, good old days :'-) ) Now i want to start to learn a
(for me) new computer language.

I like Python. Its free, easy to learn and some favorite programs of my
are written in Python / can understand Python (like OpenOffice) etc.

But I'm not a full-time programmer. I know, that I've only time 
possibility to learn one (= 1) language good. So i ask myself is python
the language I'm looking for?

In the future, i want to write the following applications:
[*] A database driven program, which can handle my clients, tasks and
places (= 3 tables, has to work relative with each other). I think,
this isn't a problem for Python
[*] As a photographer i like to build a picture management system (also
db) with raw support. Raw is the raw-data from the sensor of the
camera. My questions:
- can python encode raw?
- can python head for a utility like dcraw?
- or head for a utility like IrfanView (delphi?) or something like
that? 
.
.
.
Yes.

Yes, Python is generally capable in all the roles you describe.
Perhaps most exciting, though, is that you can try out the
language yourself, TODAY, over the next few hours, and, in no
more time than that, get a realistic if limited idea how it's
likely to work for you.  With the right introduction URL:
http://docs.python.org/tut/  you can be coding usefully in
Python very quickly.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is python for me?

2006-11-13 Thread [EMAIL PROTECTED]
As stated above python is capable of all those things, however on
larger applications like that it can tend to slow down a bit. And the
executables do need a little bit of work, because it's bassicly a dll
and a library of all your .pyc files. However python is still a great
language and I would recomend it. And most of these things will
probably be fixed in Python 3000!
Cameron Laird wrote:
 In article [EMAIL PROTECTED],
 lennart [EMAIL PROTECTED] wrote:
 Hi,
 
 I'm planning to learn a language for 'client' software. Until now, i
 'speak' only some web based languages, like php. As a kid i programmed
 in Basic (CP/M, good old days :'-) ) Now i want to start to learn a
 (for me) new computer language.
 
 I like Python. Its free, easy to learn and some favorite programs of my
 are written in Python / can understand Python (like OpenOffice) etc.
 
 But I'm not a full-time programmer. I know, that I've only time 
 possibility to learn one (= 1) language good. So i ask myself is python
 the language I'm looking for?
 
 In the future, i want to write the following applications:
 [*] A database driven program, which can handle my clients, tasks and
 places (= 3 tables, has to work relative with each other). I think,
 this isn't a problem for Python
 [*] As a photographer i like to build a picture management system (also
 db) with raw support. Raw is the raw-data from the sensor of the
 camera. My questions:
 - can python encode raw?
 - can python head for a utility like dcraw?
 - or head for a utility like IrfanView (delphi?) or something like
 that?
   .
   .
   .
 Yes.

 Yes, Python is generally capable in all the roles you describe.
 Perhaps most exciting, though, is that you can try out the
 language yourself, TODAY, over the next few hours, and, in no
 more time than that, get a realistic if limited idea how it's
 likely to work for you.  With the right introduction URL:
 http://docs.python.org/tut/  you can be coding usefully in
 Python very quickly.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is python for me?

2006-11-13 Thread Dan Lenski
lennart wrote:
 But I'm not a full-time programmer. I know, that I've only time 
 possibility to learn one (= 1) language good. So i ask myself is python
 the language I'm looking for?

Yep!  Python is very much a jack-of-all-trades language.  I've used it
for similar tasks, including as a front-end for dcraw (I have a little
python script to slurp images from a camera with dcraw and convert them
all to JPEG).

Python has excellent libraries for image manipulation (for example
Python Imaging Library) and for abstracting an SQL database to an
object-oriented form that makes it a snap to work with (I love
SQLAlchemy).

You can learn Python really fast, and it sort of guides you in the
right direction by providing a correct way to do almost everything
without constraining you, so that your code will be consistent and
readable.  This, in my opinion, is Python's chief advantage over Perl,
which is the other highly popular dynamic jack-of-all-trades language.
I learned Perl about 10 years ago and loved it for a while, but it's
messy as heck and I find my own code from a few months ago nearly
unreadable... I also spend a lot more time debugging Perl code because
there are so many error-prone things that are silenty allowed rather
than flagged as errors.

I've been using Python for several months and it's just great for
everything.  I think it's an ideal first or only programming language!
I've had no reason to write a program in anything else since learning
Python, and I write a LOT of little throwaway programs.

Dan

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is python for me?

2006-11-13 Thread Carsten Haese
On Mon, 2006-11-13 at 10:14 -0800, Dan Lenski wrote:
 lennart wrote:
  So i ask myself is python the language I'm looking for?
 
 Yep!  Python is very much a jack-of-all-trades language.

I'll run the risk of being nitpicky, but the full phrase is Jack of all
trades, master of none, which doesn't do Python justice. Python is a
master of all trades!

But I agree with Dan's sentiment, Python is definitely the language
you're looking for.

-Carsten.


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is python for me?

2006-11-13 Thread lennart

Carsten Haese schreef:

 On Mon, 2006-11-13 at 10:14 -0800, Dan Lenski wrote:
  lennart wrote:
   So i ask myself is python the language I'm looking for?
 
  Yep!  Python is very much a jack-of-all-trades language.

 I'll run the risk of being nitpicky, but the full phrase is Jack of all
 trades, master of none, which doesn't do Python justice. Python is a
 master of all trades!

 But I agree with Dan's sentiment, Python is definitely the language
 you're looking for.

 -Carsten.

Tnx everyone for your response! It's just for me a big step to learn a
new language. Not because of the difficulty, but because of the time
and so.

Later, i remembered that Gimp can also work with python (scripts). So,
even for my second wish, there will be somewhere, somehow a way to do
it.

At least: i use the dutch portal http://python.startpagina.nl/ to start
with. Can you advice me a good Python interpreter, or a good startpage
(as in Python for dummys)?

Lennart

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is python for me?

2006-11-13 Thread lennart

[EMAIL PROTECTED] schreef:

 As stated above python is capable of all those things, however on
 larger applications like that it can tend to slow down a bit. And the
 executables do need a little bit of work, because it's bassicly a dll
 and a library of all your .pyc files. However python is still a great
 language and I would recomend it. And most of these things will
 probably be fixed in Python 3000!

 snip
  Python very quickly.

Can you define 'large'? Is that large in code, or large in database? I
don't know which database is supported. If its a external db, like
MySql, the query is performed through the software of MySql, am I
right? If I'm correct, the 'slowness' comes from the amount of code in
python itself, not from the database.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is python for me?

2006-11-13 Thread Stephen Eilert

Not to be picky, but any slowness in software is rarely because of code
size. Rather, it is the data size and algorithms that play the major
role. Only after you got the first two right is that you should worry
about implementation speed.

That said, you are correct. Only if you intend to do *heavy* processing
of the returned data, your major bottleneck should be the database.

*If* you find Python to be slow(for some specific operation, never for
a whole application), you could always rewrite that section using
another language (C/C++ come to mind), or call external libraries to do
the heavy-lifting. The easy integration between Python and C (compared
to a couple other popular platforms) is what drove me to Python.

Make it work first. Then optimize. And Python helps both.


Stephen

lennart escreveu:

 [EMAIL PROTECTED] schreef:

  As stated above python is capable of all those things, however on
  larger applications like that it can tend to slow down a bit. And the
  executables do need a little bit of work, because it's bassicly a dll
  and a library of all your .pyc files. However python is still a great
  language and I would recomend it. And most of these things will
  probably be fixed in Python 3000!
 
  snip
   Python very quickly.

 Can you define 'large'? Is that large in code, or large in database? I
 don't know which database is supported. If its a external db, like
 MySql, the query is performed through the software of MySql, am I
 right? If I'm correct, the 'slowness' comes from the amount of code in
 python itself, not from the database.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is python for me?

2006-11-13 Thread Cameron Laird
In article [EMAIL PROTECTED],
lennart [EMAIL PROTECTED] wrote:
.
.
.
At least: i use the dutch portal http://python.startpagina.nl/ to start
with. Can you advice me a good Python interpreter, or a good startpage
(as in Python for dummys)?

Lennart


Along with the URL: http://docs.python.org/tut/  I already sent you,
you can hardly do better than the Dutch-language page you mention above.
You might like URL:
http://en.wikibooks.org/wiki/Non-Programmer's_Tutorial_for_Python/Contents ;
note that I recommend this as no insult to you, even though you already
are a programmer.  
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is python for me?

2006-11-13 Thread jkn
Hi Carsten

 I'll run the risk of being nitpicky, but the full phrase is Jack of all
 trades, master of none, which doesn't do Python justice. Python is a
 master of all trades!

FYI that's only *one* version of 'the full phrase'. I, for instance, am
a 'Jack of all trades, master of many'. I regard Python in the same
light ;-).

jon N

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is python for me?

2006-11-13 Thread TiNo

 At least: i use the dutch portal http://python.startpagina.nl/ to start
 with. Can you advice me a good Python interpreter, or a good startpage
 (as in Python for dummys)?

 Lennart

 --
 http://mail.python.org/mailman/listinfo/python-list


check http://www.diveintopython.org/
pretty good book on all the basics, and it's freely available online.
for interpreters, try out SPE http://stani.be/python/spe/blog/ , it is
free, and has some nice features.
And see: http://spyced.blogspot.com/2006/02/pycon-python-ide-review.html
for a comparison of 4 ide's (including SPE)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is python for me?

2006-11-13 Thread Dan Lenski

Carsten Haese wrote:
 On Mon, 2006-11-13 at 10:14 -0800, Dan Lenski wrote:
  lennart wrote:
   So i ask myself is python the language I'm looking for?
 
  Yep!  Python is very much a jack-of-all-trades language.

 I'll run the risk of being nitpicky, but the full phrase is Jack of all
 trades, master of none, which doesn't do Python justice. Python is a
 master of all trades!

Indeed!  That's why I left out the master of none prt :-)  For me,
Python is jack of all trades, master of everything I've thrown at it
so far.

Dan

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is python for me?

2006-11-13 Thread SPE - Stani's Python Editor
lennart schreef:

 [*] As a photographer i like to build a picture management system

Cornice, a cross-platform image viewer, might be a good start.

Features
Here is a list of the main features of Cornice:

* Fully cross-platform: it should run wherever wxPython does;
* Detail and thumbnail view for images;
* Image preview;
* Automatic recognition of images, with a variety of formats
supported;
* Bookmarks;
* Full-screen view;
* Zooming and rotation;
* Slideshow;
* Good keyboard navigation (still not perfect, but this is true for
all the features ;-);
* Image loading from zip archives;
* i18n support (with Italian and French translations available);
* EXIF data support;
* Some more...

For more info, take a look at
http://wxglade.sourceforge.net/extra/cornice.html

Stani

--
http://pythonide.stani.be

-- 
http://mail.python.org/mailman/listinfo/python-list