learning python

2013-05-05 Thread leonardo selmi
hi guys i need to find a good book to learn python with exercises and solutions, any suggestions? thanks! best regards leonardo-- http://mail.python.org/mailman/listinfo/python-list

Re: learning python

2013-05-05 Thread DRJ Reddy
A byte of python with learning python by Mark Lutz is a good combination. -- http://mail.python.org/mailman/listinfo/python-list

Re: [Python-Help] learning python

2013-05-05 Thread Eric Brunson
to be an excellent introduction: http://www.diveintopython.net/ as well as Think Python: How to Think Like a Computer Scientist: http://www.greenteapress.com/thinkpython/html/ If you want something you can hold in your hand and has paper pages, I can recommend Learning Python by Mark Lutz

Re: [Python-Help] learning python

2013-05-05 Thread leonardo selmi
/ If you want something you can hold in your hand and has paper pages, I can recommend Learning Python by Mark Lutz: http://shop.oreilly.com/product/9780596158071.do followed by The Python Cookbook, by Alex Martelli and David Ascher: http://shop.oreilly.com/product/9780596001674.do

Learning python by reading

2012-06-28 Thread Sergi Pasoev
Hello Do you know some python programs that make good reading to learn the language by studying and modifying the source code ? I often try to understand things in the standard library, and apart from doing this kind of search myself, I would be glad to hear some ideas from more experienced

Re: Guide to: Learning Python Decorators

2012-02-12 Thread Jack Diederich
just google jack diederich decorators it costs nothing and you get a free pycon talk out of it. -Jack -- http://mail.python.org/mailman/listinfo/python-list

Re: Guide to: Learning Python Decorators

2012-02-10 Thread 88888 Dihedral
I prefer to decorate a function not a method. I prefer to decorate an object to own a new method from the existed ones inherited in all the class levels. I do not decorate a class if not necessary. I believe this is more pythonic to add functionalities to objects in classes by aggregated

Re: Guide to: Learning Python Decorators

2012-02-09 Thread Ian
On 09/02/2012 21:41, Aaron France wrote: How many pages is that? The amazon page conveniently left that off. There is an average of 5.1 chars per word in English, and usually about 350 words an A4 page. The 215K file is a) Compressed - typically by 60% b) Contains simple html and images as

Re: Guide to: Learning Python Decorators

2012-02-09 Thread Terry Reedy
On 2/9/2012 5:43 PM, Ian wrote: On 09/02/2012 21:41, Aaron France wrote: How many pages is that? The amazon page conveniently left that off. There is an average of 5.1 chars per word in English, and usually about 350 words an A4 page. The 215K file is a) Compressed - typically by 60% b)

Re: Guide to: Learning Python Decorators

2012-02-09 Thread sajuptpm
Hi, Thanks for replay, I am looking for PDF version of same book. Please share if you can. http://www.amazon.com/gp/product/B006ZHJSIM/ref=as_li_tf_tl?ie=UTF8tag=8012-20linkCode=as2camp=1789creative=9325creativeASIN=B006ZHJSIM -- http://mail.python.org/mailman/listinfo/python-list

Re: Learning Python 2.4

2011-12-21 Thread DJC
On 21/12/11 02:13, Ashton Fagg wrote: I got the impression the OP was learning programming in general (i.e. from scratch) and not merely learning Python. If this is the case it shouldn't matter if they're merely learning the concepts as you can always get up to speed on the differences later

Re: Learning Python 2.4

2011-12-21 Thread Kevin Walzer
On 12/20/11 7:31 PM, Rick Johnson wrote: Anything before Python 3.0 is now obsolete. We are currently at 3.2.2 for a stable release. 2.7 is still a supported production release of Python. It has not been end-of-lifed. -- Kevin Walzer Code by Kevin http://www.codebykevin.com --

Re: Learning Python 2.4

2011-12-21 Thread Ashton Fagg
On 21 December 2011 20:06, DJC djc@news.invalid wrote: In which case the most important thing is the quality of the book as a text on Programming. If you find the the author's style to your taste, then use that book rather than struggle with a text based on a recent version that you

Re: Learning Python 2.4

2011-12-21 Thread Andreas Perstinger
On 2011-12-20 19:31, kimma wrote: I am about to learn python with how to think like a computer scientist. This book is just available for python 2.4. Does it matter for programming? There is also a online-version for Python 3 but there are some differences:

Learning Python 2.4

2011-12-20 Thread kimma
Hi there, I am about to learn python with how to think like a computer scientist. This book is just available for python 2.4. Does it matter for programming? Greetz -- http://mail.python.org/mailman/listinfo/python-list

Re: Learning Python 2.4

2011-12-20 Thread Ian Kelly
On Tue, Dec 20, 2011 at 11:31 AM, kimma kimm...@gmail.com wrote: Hi there, I am about to learn python with how to think like a computer scientist. This book is just available for python 2.4. Does it matter for programming? Greetz Python 2.4 is pretty old at this point. A lot has been added

Re: Learning Python 2.4

2011-12-20 Thread Steven D'Aprano
On Tue, 20 Dec 2011 19:31:56 +0100, kimma wrote: Hi there, I am about to learn python with how to think like a computer scientist. This book is just available for python 2.4. Does it matter for programming? Python 2.4 is pretty old, and missing a lot of really cool features that came out

Re: Learning Python 2.4

2011-12-20 Thread Rick Johnson
On Dec 20, 12:31 pm, kimma kimm...@gmail.com wrote: Hi there, I am about to learn python with how to think like a computer scientist. This book is just available for python 2.4. Does it matter for programming? Greetz Kimma, don't listen to either of these guys. Anything before Python 3.0

Re: Learning Python 2.4

2011-12-20 Thread Maverick JS
I'd recommend starting with http://learnpythonthehardway.org/book/ by Zed Shaw or Beginning Python Using Python 2.6 and Python 3.1 by James Payne I'd say learning Python 2.6 would be better than 2.4, since it's really old. -- http://mail.python.org/mailman/listinfo/python-list

Re: Learning Python 2.4

2011-12-20 Thread Ashton Fagg
, THEN he is a fool and should be banished from not only this community, but from the Internets also. I got the impression the OP was learning programming in general (i.e. from scratch) and not merely learning Python. If this is the case it shouldn't matter if they're merely learning the concepts

Re: Learning Python 2.4

2011-12-20 Thread Rick Johnson
On Dec 20, 8:13 pm, Ashton Fagg ash...@fagg.id.au wrote: On 21 December 2011 10:31, Rick Johnson rantingrickjohn...@gmail.com wrote: I got the impression the OP was learning programming in general (i.e. from scratch) and not merely learning Python. If this is the case it shouldn't matter

Re: Learning Python 2.4

2011-12-20 Thread Chris Angelico
On Wed, Dec 21, 2011 at 1:50 PM, Rick Johnson rantingrickjohn...@gmail.com wrote: I currently have Python 2.7 and Python 3.2.2 installed on my machine. I don't use Python 2.7 because i am a member of some secret Python Historical Commission Shun 3.2.2, it's way too old. The ONLY version of

Re: Learning python reading software source code

2011-08-26 Thread Chetan Harjani
Thanks Michael :) . I will keep your suggestions in mind. On Fri, Aug 26, 2011 at 9:01 AM, Chetan Harjani chetan.harj...@gmail.comwrote: Hello friends, I have learned the basic syntax of python through the book HOW TO THINK LIKE A COMPUTER SCIENTIST n by reading first 10-11 chapters of

Learning python reading software source code

2011-08-25 Thread Chetan Harjani
Hello friends, I have learned the basic syntax of python through the book HOW TO THINK LIKE A COMPUTER SCIENTIST n by reading first 10-11 chapters of Apress-BEGINNING PROGRAMMING FROM NOVICE TO PROFESSIONAL. (btw it was really very boring) I am looking forward to learn further by understanding

Re: Learning python reading software source code

2011-08-25 Thread Michael Hunter
On Thu, Aug 25, 2011 at 8:31 PM, Chetan Harjani chetan.harj...@gmail.com wrote: [read book, picked miro to read through] So I am looking for suggestions on how one can understand the code better. Any specific references I should look in as I stumble upon libraries n functions while reading or

Re: Learning Python

2011-08-24 Thread Johnny Venter
http://greenteapress.com/thinkpython/ On Aug 23, 2011, at 10:46 PM, User wrote: Hello all, Does anyone have any good resources for learning Python? I know basic Java and basic Python (loops, data types, if-then statements, etc), but I want to delve into Python further. If anyone knows

Re: Learning Python

2011-08-24 Thread becky_lewis
http://diveintopython.org/ is where you can get an online version of the dive into python book. I found it useful when learning python :) Becky Lewis On Aug 24, 3:46 am, User u...@example.net wrote: Hello all, Does anyone have any good resources for learning Python? I know basic Java

Re: Learning Python

2011-08-24 Thread Muresan Alexandru Mihai
http://www.youtube.com/watch?v=tKTZoB2Vjuk On Wed, Aug 24, 2011 at 11:53 AM, becky_lewis bex.le...@gmail.com wrote: http://diveintopython.org/ is where you can get an online version of the dive into python book. I found it useful when learning python :) Becky Lewis On Aug 24, 3:46 am, User

Re: Learning Python

2011-08-24 Thread Den
On Aug 23, 7:46 pm, User u...@example.net wrote: Hello all, Does anyone have any good resources for learning Python? I know basic Java and basic Python (loops, data types, if-then statements, etc), but I want to delve into Python further. If anyone knows of any good books, video tutorials

Re: Learning Python

2011-08-24 Thread kangshufan
Hi all could some one help me? there is a piece of code: def fib(x): if x==0 or x==1: return 1 else: return fib(x-1) + fib(x-2) Could some one explain it for me? I can't understand how it works. -- http://mail.python.org/mailman/listinfo/python-list

Re: Learning Python

2011-08-24 Thread John Gordon
In 770aff9e-0879-40f5-ac86-f5098b9fd...@b9g2000prd.googlegroups.com kangshu...@hotmail.com writes: Hi all could some one help me=EF=BC=9F there is a piece of code: def fib(x): if x=3D=3D0 or x=3D=3D1: return 1 else: return fib(x-1) + fib(x-2) Could some one explain it for me? I

Learning Python

2011-08-23 Thread User
Hello all, Does anyone have any good resources for learning Python? I know basic Java and basic Python (loops, data types, if-then statements, etc), but I want to delve into Python further. If anyone knows of any good books, video tutorials, etc it would be greatly appreciated. Thanks, User

Re: Learning Python

2011-08-23 Thread Steven D'Aprano
On Wed, 24 Aug 2011 12:46 pm User wrote: Hello all, Does anyone have any good resources for learning Python? http://duckduckgo.com/?q=python+tutorial -- Steven -- http://mail.python.org/mailman/listinfo/python-list

how to go on learning python

2010-11-30 Thread Xavier Heruacles
I'm basically a c/c++ programmer and recently come to python for some web development. Using django and javascript I'm afraid I can develop some web application now. But often I feel I'm not good at python. I don't know much about generators, descriptors and decorators(although I can use some of

Re: how to go on learning python

2010-11-30 Thread Alice Bevan–McGregor
Howdy Xavier! [Apologies for the length of this; I didn't expect to write so much!] I've been a Python programmer for many years now (having come from a PHP, Perl, C, and Pascal background) and I'm constantly learning new idioms and ways of doing things that are more Pythonic; cleaner, more

Re: how to go on learning python

2010-11-30 Thread Terry Reedy
On 11/30/2010 9:37 AM, Xavier Heruacles wrote: I'm basically a c/c++ programmer and recently come to python for some web development. Using django and javascript I'm afraid I can develop some web application now. But often I feel I'm not good at python. I don't know much about generators,

Intro to Python slides, was Re: how to go on learning python

2010-11-30 Thread Dan Stromberg
On Tue, Nov 30, 2010 at 6:37 AM, Xavier Heruacles xheruac...@gmail.com wrote: I'm basically a c/c++ programmer and recently come to python for some web development. Using django and javascript I'm afraid I can develop some web application now. But often I feel I'm not good at python. I don't

Changing Lutz's mydir from Edition 2, Learning Python

2010-01-17 Thread W. eWatson
See Subject. The code is below with a few changes I made at the bottom by inserting import string import numpy module = raw_input(Enter module name: ) listing(module) I thought I'd see if I could convert this to a program instead, which asks the user for the module. As

Re: Changing Lutz's mydir from Edition 2, Learning Python

2010-01-17 Thread Arnaud Delobelle
W. eWatson wolftra...@invalid.com writes: See Subject. The code is below with a few changes I made at the bottom by inserting import string import numpy module = raw_input(Enter module name: ) replace this line with: module_name = raw_input(Enter module name: )

Re: Changing Lutz's mydir from Edition 2, Learning Python

2010-01-17 Thread Chris Rebert
On Sun, Jan 17, 2010 at 12:11 PM, W. eWatson wolftra...@invalid.com wrote: See Subject. The code is below with a few changes I made at the bottom by inserting    import string    import numpy    module = raw_input(Enter module name: )    listing(module) As the error says, strings have no

Re: Changing Lutz's mydir from Edition 2, Learning Python

2010-01-17 Thread W. eWatson
Chris Rebert wrote: On Sun, Jan 17, 2010 at 12:11 PM, W. eWatson wolftra...@invalid.com wrote: See Subject. The code is below with a few changes I made at the bottom by inserting import string import numpy module = raw_input(Enter module name: ) listing(module) As the error says,

New books: Learning Python, Python Pocket Reference 4th Eds

2009-09-26 Thread lutz
I'm happy to announce new, 4th editions of the O'Reilly books Learning Python and Python Pocket Reference. These new editions have been thoroughly updated and expanded to cover both Python 3.1 and 2.6, and fully present features that appear in each Python line. Whether you're using Python 2.X

New books: Learning Python, Python Pocket Reference 4th Eds

2009-09-25 Thread Mark Lutz
I'm happy to announce new, 4th editions of the O'Reilly books Learning Python and Python Pocket Reference. These new editions have been thoroughly updated and expanded to cover both Python 3.1 and 2.6, and fully present features that appear in each Python line. Whether you're using Python 2.X

Re: New books: Learning Python, Python Pocket Reference 4th Eds

2009-09-25 Thread Ishwor Gurung
Thanks Mark. 2009/9/26 Mark Lutz l...@rmi.net: I'm happy to announce new, 4th editions of the O'Reilly books Learning Python and Python Pocket Reference. [] It was pleasant and such a fun going through LP(2nd ed for me). Python Cook book was a nice complement too. I miss those days when I

Re: Learning Python advanced features

2009-08-30 Thread Michel Claveau - MVP
Bonsoir ! Tu aurais peut-être dû répondre en anglais (pour certains, advanced features, c'est mieux que concepts sophistiqués). @+ MCI -- http://mail.python.org/mailman/listinfo/python-list

the best book for learning python !?

2009-08-29 Thread Momen
-- http://mail.python.org/mailman/listinfo/python-list

Re: Learning Python advanced features

2009-08-28 Thread jvpic
Bruno Desthuilliers a écrit : jvpic a écrit : Hi, Learning Python, I understand the mechanism of : closure, __new__, descriptors, decorators and __metaclass__, but I interrogate myself on the interest of those technics ? May somebody explain me the interest ? Didn't like my answers

Re: Learning Python advanced features

2009-08-28 Thread Bruno Desthuilliers
jvpic a écrit : Bruno Desthuilliers a écrit : jvpic a écrit : Hi, Learning Python, I understand the mechanism of : closure, __new__, descriptors, decorators and __metaclass__, but I interrogate myself on the interest of those technics ? May somebody explain me the interest ? Didn't like

Re: Learning Python advanced features

2009-08-28 Thread Bruno Desthuilliers
Jonathan Gardner a écrit : On Aug 27, 5:13 am, jvpic jv...@free.fr wrote: Hi, Learning Python, I understand the mechanism of : closure, __new__, descriptors, decorators and __metaclass__, but I interrogate myself on the interest of those technics ? May somebody explain me the interest ? I

Learning Python advanced features

2009-08-27 Thread jvpic
Hi, Learning Python, I understand the mechanism of : closure, __new__, descriptors, decorators and __metaclass__, but I interrogate myself on the interest of those technics ? May somebody explain me the interest ? Many thanks ! Jackes Bihan -- http://mail.python.org/mailman/listinfo/python

Re: Learning Python advanced features

2009-08-27 Thread Bruno Desthuilliers
jvpic a écrit : Hi, Learning Python, I understand the mechanism of : closure, __new__, descriptors, decorators and __metaclass__, but I interrogate myself on the interest of those technics ? May somebody explain me the interest ? Didn't like my answers on f.c.l.py ?-) -- http

Re: Learning Python advanced features

2009-08-27 Thread Jonathan Gardner
On Aug 27, 5:13 am, jvpic jv...@free.fr wrote: Hi, Learning Python, I understand the mechanism of : closure, __new__, descriptors, decorators and __metaclass__, but I interrogate myself on the interest of those technics ? May somebody explain me the interest ? I assume you are asking, Why

Re: scoping problem with list comprehension // learning Python

2009-05-21 Thread Diez B. Roggisch
Adrian Dragulescu schrieb: I just started to learn python (first posting to the list). I have a list of dates as strings that I want to convert to a list of datetime objects. Here is my debugging session from inside a method. (Pdb) formatIndex '%Y-%m-%d' (Pdb) [datetime.strptime(i,

scoping problem with list comprehension // learning Python

2009-05-20 Thread Adrian Dragulescu
I just started to learn python (first posting to the list). I have a list of dates as strings that I want to convert to a list of datetime objects. Here is my debugging session from inside a method. (Pdb) formatIndex '%Y-%m-%d' (Pdb) [datetime.strptime(i, formatIndex) for i in

Re: scoping problem with list comprehension // learning Python

2009-05-20 Thread Benjamin Peterson
Adrian Dragulescu adrian_d at eskimo.com writes: I just started to learn python (first posting to the list). I have a list of dates as strings that I want to convert to a list of datetime objects. Here is my debugging session from inside a method. (Pdb) formatIndex '%Y-%m-%d'

Re: Learning Python the quick way

2009-04-25 Thread Martin P. Hellwig
mercur...@googlemail.com wrote: Hi guys, I have decided to learn Python a little more than I already do. Very good! But I found few problems, I am not sure what will happen if I do the programing in python the find the program doesn't deliver the desired performance due to lack of a good

Re: Learning Python the quick way

2009-04-25 Thread Lie
On Apr 25, 11:13 am, mercur...@googlemail.com wrote: Hi guys, I have decided to learn Python a little more than I already do. But I found few problems, I am not sure what will happen if I do the programing in python the find the program doesn't deliver the desired performance due to lack

Re: Learning Python the quick way

2009-04-25 Thread Esmail
Tim Chase wrote: 2) if it's slow, profile it and check your algorithm(s), recoding if you're using some algorithm with a bad big-oh profile .. However the first rule: profile first! Tim, Do you have a favorite profiling tool? What should someone new to Python (but not programming)

Re: Learning Python the quick way

2009-04-25 Thread Tim Chase
Esmail wrote: Tim Chase wrote: However the first rule: profile first! Do you have a favorite profiling tool? What should someone new to Python (but not programming) use? I personally use the cheapo method of dropping in a few print statements to dump where I currently am in the app, and

Re: Learning Python the quick way

2009-04-25 Thread Esmail
Thanks Tim, Esmail -- http://mail.python.org/mailman/listinfo/python-list

Learning Python the quick way

2009-04-24 Thread mercurish
Hi guys, I have decided to learn Python a little more than I already do. But I found few problems, I am not sure what will happen if I do the programing in python the find the program doesn't deliver the desired performance due to lack of a good compiler. So I wanted to learn more about the

Re: Learning Python the quick way

2009-04-24 Thread Tim Chase
I am not sure what will happen if I do the programing in python the find the program doesn't deliver the desired performance due to lack of a good compiler. I've rarely found this to be a problem unless you're doing CPU-intensive work. However, the usual workflow involves: 1) code it in

Explanation for trailing comma in example from Learning Python?

2009-02-19 Thread Carl Schumann
Hi, I am surprised at the trailing comma in the following example from Learning Python: Python 2.3.4 (#1, Dec 10 2007, 15:05:56) [GCC 3.4.5 20051201 (Red Hat 3.4.5-2)] on linux2 Type help, copyright, credits or license for more information. def f(*args): print args ... f() () f(1) (1,) f

Re: Explanation for trailing comma in example from Learning Python?

2009-02-19 Thread Christian Heimes
Carl Schumann wrote: I could see the logic in always or never having a trailing comma. What I don't understand here is why only the single element case has a trailing comma. Any explanations please? Does this code shad some light on the trailing comma? :) (1) == 1 True (1,) == 1 False

Re: Explanation for trailing comma in example from Learning Python?

2009-02-19 Thread alex goretoy
Thank you for clerification Christian, when using trailing comma with print statement/function, does it not mean to output newline after printed data? -Alex Goretoy http://www.goretoy.com On Thu, Feb 19, 2009 at 2:54 PM, Christian Heimes li...@cheimes.de wrote: Carl Schumann wrote: I could

Re: Explanation for trailing comma in example from Learning Python?

2009-02-19 Thread ma
A comma is what generates a tuple. It's not the parenthesis;) http://docs.python.org/library/stdtypes.html#typesseq A single item tuple must have a trailing comma, such as (d,). On Thu, Feb 19, 2009 at 3:57 PM, alex goretoy aleksandr.gore...@gmail.comwrote: Thank you for clerification

Re: Explanation for trailing comma in example from Learning Python?

2009-02-19 Thread Chris Rebert
On Thu, Feb 19, 2009 at 2:54 PM, Christian Heimes li...@cheimes.de wrote: Carl Schumann wrote: I could see the logic in always or never having a trailing comma. What I don't understand here is why only the single element case has a trailing comma. Any explanations please? Does this

Re: Explanation for trailing comma in example from Learning Python?

2009-02-19 Thread Steve Holden
alex goretoy wrote: Thank you for clerification Christian, when using trailing comma with print statement/function, does it not mean to output newline after printed data? It does (in Python before 3.0) - but that has nothing to do with the original question. You will find you get quite

Re: A java hobbyist programmer learning python

2009-01-26 Thread Tim Rowe
I like the latter two styles, particularly the last one. That way you can see at a glance that those member variables are defined in the super class. I like the second style because it makes it leaves the 2-d implementation hidden, which is the whole point of encapsulation. But then I am a

Re: A java hobbyist programmer learning python

2009-01-26 Thread Scott David Daniels
Tim Rowe wrote: ... I like the second style because it makes it leaves the 2-d implementation hidden, which is the whole point of encapsulation. I like the second as well, in that it it allows the parent to update any related data structures (for example, updating a display). However, I am a

Re: A java hobbyist programmer learning python

2009-01-25 Thread TheFlyingDutchman
        If you're building an extension tree, you'll either have to supply layers of getter/setter methods, or hand-mangle references to attributes defined in the superclass.         Say you start with a Point2D class, and make the X, Y coordinates double underscore.         Now extend it

Re: A java hobbyist programmer learning python

2009-01-24 Thread TheFlyingDutchman
On Jan 23, 8:57 am, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: On Fri, 23 Jan 2009 01:48:32 -0800 (PST), TheFlyingDutchman zzbba...@aol.com declaimed the following in comp.lang.python: abstraction. In Python, all class attributes are public but names may be mangled to discourage

Re: A java hobbyist programmer learning python

2009-01-23 Thread TheFlyingDutchman
* No getters and setters. Python takes a very permissive approach to class attributes, taking the philosophy we're all adults here. It's easy to change a public attribute to a private attribute with a getter/ setter if you need to, so there's nothing to be gained by writing getters for

Re: A java hobbyist programmer learning python

2009-01-22 Thread Aahz
In article 7xy6x9nzwd@ruckus.brouhaha.com, Paul Rubin http://phr...@nospam.invalid wrote: Chris Rebert c...@rebertia.com writes: attribution deleted by Paul Rubin: class Calculator(): ... Delete the 3 Java-ish accessor methods; good Python style just uses the attributes directly (i.e.

Re: A java hobbyist programmer learning python

2009-01-19 Thread Rhodri James
On Sun, 18 Jan 2009 02:24:51 -, Steven D'Aprano st...@remove-this-cybersource.com.au wrote: Let me re-write your code in a more Pythonic way. This is not the only way to do this, and it probably isn't the best way, but it may give you a flavour for the way Python is usually written.

A java hobbyist programmer learning python

2009-01-17 Thread elhombre
Hello, below is my first fragment of working python code. As you can see it is very java like as that is all I know. Is this the right approach to be taking? Should I be taking a different approach? Thanks in advance. import sys class Calculator(): def __init__(self): self.operator

Re: A java hobbyist programmer learning python

2009-01-17 Thread Chris Rebert
On Sat, Jan 17, 2009 at 5:11 PM, elhombre elhm...@ozemail.com.au wrote: Hello, below is my first fragment of working python code. As you can see it is very java like as that is all I know. Is this the right approach to be taking? Should I be taking a different approach? Thanks in advance.

Re: A java hobbyist programmer learning python

2009-01-17 Thread Paul Rubin
Chris Rebert c...@rebertia.com writes: class Calculator(): ... Delete the 3 Java-ish accessor methods; good Python style just uses the attributes directly (i.e. self.operator instead of self.getOperator()). I think I would get rid of the whole Calculator class unless there was a good reason

Re: A java hobbyist programmer learning python

2009-01-17 Thread Chris Rebert
On Sat, Jan 17, 2009 at 5:53 PM, Paul Rubin http://phr.cx@nospam.invalid wrote: Chris Rebert c...@rebertia.com writes: Rather than have a long if-elif-else chain like this, you can use a dictionary with functions as values. For example: def add(x, y): return x + y These functions are

Re: A java hobbyist programmer learning python

2009-01-17 Thread John Machin
On Jan 18, 12:11 pm, elhombre elhm...@ozemail.com.au wrote: Hello, below is my first fragment of working python code. As you can see it is very java like as that is all I know. Is this the right approach to be taking? Should I be taking a different approach? Thanks in advance. import sys

Re: A java hobbyist programmer learning python

2009-01-17 Thread Steven D'Aprano
On Sun, 18 Jan 2009 11:11:45 +1000, elhombre wrote: Hello, below is my first fragment of working python code. As you can see it is very java like as that is all I know. Is this the right approach to be taking? You might find it very useful to read:

Re: A java hobbyist programmer learning python

2009-01-17 Thread elhombre
Chris Rebert c...@rebertia.com wrote in message news:mailman.7468.1232242083.3487.python-l...@python.org... On Sat, Jan 17, 2009 at 5:11 PM, elhombre elhm...@ozemail.com.au wrote: ... Rather than have a long if-elif-else chain like this, you can use a dictionary with functions as values. For

Re: A java hobbyist programmer learning python

2009-01-17 Thread elhombre
Paul Rubin http://phr...@nospam.invalid wrote in message news:7xy6x9nzwd@ruckus.brouhaha.com... Chris Rebert c...@rebertia.com writes: class Calculator(): ... Delete the 3 Java-ish accessor methods; good Python style just uses the attributes directly (i.e. self.operator instead of

Re: A java hobbyist programmer learning python

2009-01-17 Thread elhombre
John Machin sjmac...@lexicon.net wrote in message news:5d2c588a-9b01-4a85-85b2-b132754e6...@o40g2000prn.googlegroups.com... On Jan 18, 12:11 pm, elhombre elhm...@ozemail.com.au wrote: Hello, below is my first fragment of working python code. As you can see it is very java like as that is all I

Re: A java hobbyist programmer learning python

2009-01-17 Thread elhombre
Steven D'Aprano st...@remove-this-cybersource.com.au wrote in message news:0182896d$0$8693$c3e8...@news.astraweb.com... On Sun, 18 Jan 2009 11:11:45 +1000, elhombre wrote: Hello, below is my first fragment of working python code. As you can see it is very java like as that is all I know. Is

Re: Learning Python now coming from Perl

2008-12-09 Thread Nick Craig-Wood
Roy Smith [EMAIL PROTECTED] wrote: In article [EMAIL PROTECTED], Nick Craig-Wood [EMAIL PROTECTED] wrote: My favourite mistake when I made the transition was calling methods without parentheses. In perl it is common to call methods without parentheses - in python this does

Re: Learning Python now coming from Perl

2008-12-09 Thread Roy Smith
Nick Craig-Wood [EMAIL PROTECTED] wrote: On the other hand, leaving out the parens returns the function itself, which you can then call later. I've often used this to create data-driven logic. I didn't say it wasn't useful, just that if you came from Perl like I did, it is an easy

Re: Learning Python now coming from Perl

2008-12-09 Thread J. Cliff Dyer
On Sun, 2008-12-07 at 11:05 +0900, Bertilo Wennergren wrote: Aahz wrote: In article [EMAIL PROTECTED], Bertilo Wennergren [EMAIL PROTECTED] wrote: I don't suppose there is any introductory material out there that is based on Python 3000 and that is also geared at people with a

Re: Learning Python now coming from Perl

2008-12-08 Thread Nick Craig-Wood
Bertilo Wennergren [EMAIL PROTECTED] wrote: I'm planning to start learning Python now, using Python 3000. I have no previous Python skills, but I now Perl pretty well. I'm also well experienced with JavaScript. Any pointers and tips how I should go about getting into Python? Read Dive

Re: Learning Python now coming from Perl

2008-12-08 Thread Roy Smith
In article [EMAIL PROTECTED], Nick Craig-Wood [EMAIL PROTECTED] wrote: My favourite mistake when I made the transition was calling methods without parentheses. In perl it is common to call methods without parentheses - in python this does absolutely nothing! pychecker does warn about it

Learning Python now coming from Perl

2008-12-06 Thread Bertilo Wennergren
I'm planning to start learning Python now, using Python 3000. I have no previous Python skills, but I now Perl pretty well. I'm also well experienced with JavaScript. Any pointers and tips how I should go about getting into Python? -- Bertilo Wennergren http://bertilow.com -- http

Re: Learning Python now coming from Perl

2008-12-06 Thread Roy Smith
In article [EMAIL PROTECTED], Bertilo Wennergren [EMAIL PROTECTED] wrote: I'm planning to start learning Python now, using Python 3000. I have no previous Python skills, but I now Perl pretty well. I'm also well experienced with JavaScript. Any pointers and tips how I should go about

Re: Learning Python now coming from Perl

2008-12-06 Thread Bertilo Wennergren
Roy Smith wrote: Bertilo Wennergren [EMAIL PROTECTED] wrote: I'm planning to start learning Python now, using Python 3000. I have no previous Python skills, but I now Perl pretty well. I'm also well experienced with JavaScript. Any pointers and tips how I should go about getting

Re: Learning Python now coming from Perl

2008-12-06 Thread Colin J. Williams
Bertilo Wennergren wrote: Roy Smith wrote: Bertilo Wennergren [EMAIL PROTECTED] wrote: I'm planning to start learning Python now, using Python 3000. I have no previous Python skills, but I now Perl pretty well. I'm also well experienced with JavaScript. Any pointers and tips how I should

Re: Learning Python now coming from Perl

2008-12-06 Thread Steven D'Aprano
On Sat, 06 Dec 2008 08:50:20 -0500, Roy Smith wrote: For your first project, pick something that's small enough that you think you could tackle it in under 50 lines of Perl. Is there anything which *can't* be written in under 50 lines of Perl? :-) One of the very first things you'll

Re: Learning Python now coming from Perl

2008-12-06 Thread Aahz
In article [EMAIL PROTECTED], Bertilo Wennergren [EMAIL PROTECTED] wrote: I don't suppose there is any introductory material out there that is based on Python 3000 and that is also geared at people with a Perl background? Too early for that I guess.. Honestly, the differences between 2.x and

Re: Learning Python now coming from Perl

2008-12-06 Thread News123
whenever you're stuck with a 'missing' feature, (though mostly the features aren't missing, but just a little different) bye N Roy Smith wrote: In article [EMAIL PROTECTED], Bertilo Wennergren [EMAIL PROTECTED] wrote: I'm planning to start learning Python now, using Python 3000. I have

Re: Learning Python now coming from Perl

2008-12-06 Thread Roy Smith
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Aahz) wrote: In article [EMAIL PROTECTED], Bertilo Wennergren [EMAIL PROTECTED] wrote: I don't suppose there is any introductory material out there that is based on Python 3000 and that is also geared at people with a Perl background? Too

Re: Learning Python now coming from Perl

2008-12-06 Thread Martin P. Hellwig
News123 wrote: What's more painful is to learn which functianilty is in which library and which library exists. cut Yes and one mistake I still often find myself doing is, when confronted with a particular problem, that I write some helper code to deal with it. Of course later on I discover

Re: Learning Python now coming from Perl

2008-12-06 Thread Roy Smith
In article [EMAIL PROTECTED], Steven D'Aprano [EMAIL PROTECTED] wrote: On Sat, 06 Dec 2008 08:50:20 -0500, Roy Smith wrote: For your first project, pick something that's small enough that you think you could tackle it in under 50 lines of Perl. Is there anything which *can't* be

<    1   2   3   4   5   6   >