Re: [Tutor] Translating R Code to Python-- reading in csv files, writing out to csv files

2012-05-20 Thread Massimo Di Stefano
Maybe this doc.

http://mathesaurus.sourceforge.net/matlab-python-xref.pdf

can help ?

i found it useful.

Massimo.


Il giorno May 20, 2012, alle ore 2:42 AM, Martin A. Brown ha scritto:

> 
> Benjamin,
> 
> : Thanks Martin-- this is really great.  My major question now is 
> : that I need to transition to Python for a project and I need to 
> : learn how to think in Python instead of in R.  The two strategies 
> : I have used so far are: a) going through the description and 
> : exercises in  http://www.openbookproject.net/thinkcs/python/english2e/
> : and b) trying to convert my R code into Python.
> 
> I haven't seen that before, but, of course, there ar scads of 
> resources out there for anybody learning these days.
> 
> : On a high-level, do you have any other suggestions for how I 
> : could go about becoming more proficient in Python?
> 
> Well, here is my list.  Others probably have some suggestions, too:
> 
>  * solve a specific and immediate real problem in Python, but solve 
>the problem as generally as possible; apply
> 
>  * lurk here (and on other lists) and watch how experienced Python 
>practitioners help others face a problem in Python; absorb
> 
>  * join domain-specific Python groups that discuss libraries,
>tools or techniques that apply in your area of interest; inquire
> 
>  * learn Python's common datatypes well, you will encounter them 
>often: str, int, float, list, dict, set; study
> 
>  * learn Pythonic programming idioms, and, importantly, learn 
>why they are considered Pythonic (that will give you insight 
>into thinking in Python); gain relevant experience
> 
>  * browse the standard library occasionally to learn a new module
>http://docs.python.org/py-modindex.html
> 
>  * learn how to make modules; build your code into modules (if 
>appropriate and where possible)
> 
>  * read a book (lots of options here); I'm a 'learn by example' 
>sort so I liked the O'Reilly _Python Cookbook_ [0]
> 
>  * read PEP 8 http://www.python.org/dev/peps/pep-0008/
> 
> Good luck and enjoy Python,
> 
> -Martin
> 
> [0] http://shop.oreilly.com/product/9780596007973.do
> 
> -- 
> Martin A. Brown
> http://linux-ip.net/
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Translating R Code to Python-- reading in csv files, writing out to csv files

2012-05-20 Thread Joel Goldstick
On Sun, May 20, 2012 at 6:30 AM, Massimo Di Stefano
 wrote:
> Maybe this doc.
>
> http://mathesaurus.sourceforge.net/matlab-python-xref.pdf
>
> can help ?
>
> i found it useful.
>
> Massimo.
>
>
> Il giorno May 20, 2012, alle ore 2:42 AM, Martin A. Brown ha scritto:
>
>>
>> Benjamin,
>>
>> : Thanks Martin-- this is really great.  My major question now is
>> : that I need to transition to Python for a project and I need to
>> : learn how to think in Python instead of in R.  The two strategies
>> : I have used so far are: a) going through the description and
>> : exercises in  http://www.openbookproject.net/thinkcs/python/english2e/
>> : and b) trying to convert my R code into Python.
>>
>> I haven't seen that before, but, of course, there ar scads of
>> resources out there for anybody learning these days.
>>
>> : On a high-level, do you have any other suggestions for how I
>> : could go about becoming more proficient in Python?
>>
>> Well, here is my list.  Others probably have some suggestions, too:
>>
>>  * solve a specific and immediate real problem in Python, but solve
>>    the problem as generally as possible; apply
>>
>>  * lurk here (and on other lists) and watch how experienced Python
>>    practitioners help others face a problem in Python; absorb
>>
>>  * join domain-specific Python groups that discuss libraries,
>>    tools or techniques that apply in your area of interest; inquire
>>
>>  * learn Python's common datatypes well, you will encounter them
>>    often: str, int, float, list, dict, set; study
>>
>>  * learn Pythonic programming idioms, and, importantly, learn
>>    why they are considered Pythonic (that will give you insight
>>    into thinking in Python); gain relevant experience
>>
>>  * browse the standard library occasionally to learn a new module
>>    http://docs.python.org/py-modindex.html
>>
>>  * learn how to make modules; build your code into modules (if
>>    appropriate and where possible)
>>
>>  * read a book (lots of options here); I'm a 'learn by example'
>>    sort so I liked the O'Reilly _Python Cookbook_ [0]
>>
>>  * read PEP 8 http://www.python.org/dev/peps/pep-0008/
>>
>> Good luck and enjoy Python,
>>
>> -Martin
>>
>> [0] http://shop.oreilly.com/product/9780596007973.do
>>
>> --
>> Martin A. Brown
>> http://linux-ip.net/
>> ___
>> Tutor maillist  -  Tutor@python.org
>> To unsubscribe or change subscription options:
>> http://mail.python.org/mailman/listinfo/tutor
>
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor


So, with the example file you showed previously, sit down and write
some code.  It probably will take less than a screen size full of code
-- maybe 20 lines or so.  See what you get for output.  You will
certainly get errors -- syntax and runtime.  When you get stuck, cut
and paste the code and the trace-back that python gives you to your
email, and people will help you move forward.




-- 
Joel Goldstick
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Translating R Code to Python-- reading in csv files, writing out to csv files

2012-05-20 Thread Dave Angel
Please don't top-post.  You lose the context of what was written before,
since it's now out of order.  When replying to a message, quote the
parts you're replying to, and put your comments AFTER the quotes.


On 05/19/2012 05:07 PM, Benjamin G wrote:
> Thanks, Joel.  Here is a simple example of the input data (top row is
> column headers in the input file)
> Patient ID Sample Type  Survival Time(months)
> unique_patient_ID1Tumor   12
> unique_patient_ID2Normal  5
> unique_patient_ID3Normal  60
> unique_patient_ID4Tumor   2
> unique_patient_ID5Tumor   13
But your subject line said you have comma-separated files.  Just how are
these files defined?  The csv module can handle other separators, but I
don't see any separator at all, just fixed columns.



-- 

DaveA

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] print 'hello world' - invalid syntax

2012-05-20 Thread Quidam S-enfuit
I have installed python on the windows 7 machine. (Tried 64 bit version also; 
same error).
I tried print "Hello world" and  print 'hello world'.  It stated syntax 
error!?...
Thanks.
===copied from python (interactive command) /pasted below==
Python 3.2.3 (default, Apr 11 2012, 07:15:24) [MSC v.1500 32 bit (Intel)] on win

32

Type "help", "copyright", "credits" or "license" for more information.

>>> print 'hello world'

  File "", line 1

    print 'hello world'

  ^

SyntaxError: invalid syntax






==end

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] print 'hello world' - invalid syntax

2012-05-20 Thread boB Stepp
On Sun, May 20, 2012 at 1:08 PM, Quidam S-enfuit
 wrote:
>
> I have installed python on the windows 7 machine. (Tried 64 bit version
> also; same error).
> I tried print "Hello world" and  print 'hello world'.  It stated syntax
> error!?...
> Thanks.
> ===copied from python (interactive command) /pasted
> below==
> Python 3.2.3 (default, Apr 11 2012, 07:15:24) [MSC v.1500 32 bit (Intel)]
> on win
> 32
> Type "help", "copyright", "credits" or "license" for more information.
> >>> print 'hello world'
>   File "", line 1
>     print 'hello world'
>   ^
> SyntaxError: invalid syntax
>
> ==end
I am starting to learn Python as well. Apparently one of the
significant changes from Python 2.x versions to the new Python 3.x
versions is that print is now treated as a function. So instead try:

print('hello world')

I think that should work for your version of Python.


--
Cheers!
boB
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] print 'hello world' - invalid syntax

2012-05-20 Thread brian arb
http://docs.python.org/release/3.0.1/whatsnew/3.0.html

The print statement has been replaced with a
print()
function,
with keyword arguments to replace most of the special syntax of the
oldprint statement
(*PEP 3105* ).

try
print('hello world')

On Sun, May 20, 2012 at 2:08 PM, Quidam S-enfuit
wrote:

> I have installed python on the windows 7 machine. (Tried 64 bit version
> also; same error).
> I tried print "Hello world" and  print 'hello world'.  It stated syntax
> error!?...
> Thanks.
> ===copied from python (interactive command) /pasted
> below==
> Python 3.2.3 (default, Apr 11 2012, 07:15:24) [MSC v.1500 32 bit (Intel)]
> on win
> 32
> Type "help", "copyright", "credits" or "license" for more information.
> >>> print 'hello world'
>   File "", line 1
> print 'hello world'
>   ^
> SyntaxError: invalid syntax
>
>
>
>
>
>
> ==end
>
>
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] print 'hello world' - invalid syntax

2012-05-20 Thread Mark Lawrence

On 20/05/2012 19:08, Quidam S-enfuit wrote:

I have installed python on the windows 7 machine. (Tried 64 bit version also; 
same error).
I tried print "Hello world" and  print 'hello world'.  It stated syntax 
error!?...
Thanks.
===copied from python (interactive command) /pasted below==
Python 3.2.3 (default, Apr 11 2012, 07:15:24) [MSC v.1500 32 bit (Intel)] on win

32

Type "help", "copyright", "credits" or "license" for more information.


print 'hello world'


   File "", line 1

 print 'hello world'

   ^

SyntaxError: invalid syntax


==end

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Print is a function in Python 3, so you need print('hello world').

--
Cheers.

Mark Lawrence.

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] print 'hello world' - invalid syntax

2012-05-20 Thread Alan Gauld

On 20/05/12 19:08, Quidam S-enfuit wrote:

I have installed python on the windows 7 machine. (Tried 64 bit version
also; same error).
I tried print "Hello world" and print 'hello world'. It stated syntax
error!?...



As others have said you are using version 2 syntax with version 3 Python.

You need to "downgrade" to version 2.7 of Python or find a version 3 
tutorial.


If you have programmed before in another language you should probably 
stick with v3 and use the official tutorial on the Python web site.


If you are a complete beginner to programming and Python then you need 
to visit the beginners page and find a v3 tutor you like (you could try 
mine! :-)


Or downgrade to 2.7 and use any of the many v2 tutorials out there 
(including mine! :-)


--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] While learning Py: To IDE or not to IDE?

2012-05-20 Thread boB Stepp
Programming background;
1975-1978: FORTRAN, BASIC, some machine language/assembler.
1988: A summer of FORTRAN.
Post-1988: No programming until past 1.5 yr.

FORTRAN was used during pursuit of physics degree. Others while
playing around developing games for minicomputers. Structured
programming paradigm the only one I've used.

Currently have been doing scripting in a custom scripting environment
at work to make my life easier. This is on Solaris-based systems. Have
recently augmented the custom scripting environment with Perl
scripting to give me more power and error-checking capabilities
(Others have started to use my scripts. They don't always use them as
I intended.). Perl is a new language for me.

Goals: Learn Python. While learning Python, learn all of the good
C.Sc. stuff that I should have learned the first go-around, Learn Java
and C/C++. Reevaluate.

At home where I will be doing the brunt of my study, I am working on a
W7 laptop.

Currently continue to work on scripting projects at work, replacing
Perl scripts with Python scripts. My wife, who is a Montessori
teacher, has immediate need of programs for her students. Have
currently outlined a design for a program to drill spelling words,
which will have to have audio record/playback capabilities. Hope to
get this and others done this summer before the new school year
starts. I am certain that my wife will continue to have new projects
for me as I complete the current ones. Hope to have educational
software solutions to my wife's requests that are usable whether the
students are at home or in class.

Finally to the question: With the stated goals above, would it be
better to invest time now at the front-end in learning a powerful IDE,
or am I better served, while learning Python, to stick with IDLE and
the shell and worry about an IDE later? I am willing to invest time
now on learning an IDE if it will save me time overall. IF it would be
beneficial now to learn an IDE, then it begs the question as to
whether I should search for the best IDE for Python, then later the
best one for Java, etc., or, instead, look for the best one that can
handle all of the languages I plan to learn and use.

Thanks for any guidance you can provide!
-- 
Cheers!
boB
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Teaching an 8-year-old programming.

2012-05-20 Thread boB Stepp
This is, in a sense, a related question to the ones I just posted.
While observing me studying programming, my son has become interested
in learning how to program as well. I have given him a very old
Gateway PC to play around with. It was new when W95 came out. I have
started him out with QBASIC, which comes with W95. He seems to be
doing fine, but I am wondering if this is the best way to start him in
the world of programming? Any thoughts about this?

Thanks!
-- 
Cheers!
boB
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Teaching an 8-year-old programming.

2012-05-20 Thread Devin Jeanpierre
I've heard remarkable things about http://www.programbydesign.org/ ,
but it's aimed at students a little older. Its design might help you;
although, it also probably depends on motivation / what you want to
teach.

Anyway, that's the best I can offer. Good luck! It sounds like you're
in for a fun time. :)

-- Devin
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Teaching an 8-year-old programming.

2012-05-20 Thread boB Stepp
On Sun, May 20, 2012 at 4:15 PM, Devin Jeanpierre
 wrote:
> I've heard remarkable things about http://www.programbydesign.org/ ,
> but it's aimed at students a little older. Its design might help you;
> although, it also probably depends on motivation / what you want to
> teach.
>
> Anyway, that's the best I can offer. Good luck! It sounds like you're
> in for a fun time. :)
>
> -- Devin

Thanks for the link. It looks interesting, but I'm not sure it is the
way to go currently for my son. However, it gives me some ideas for my
wife's class, which covers 7th through 9th grades in a single
classroom.

There seem to be many, ... , many thoughts on how to best teach
programming to kids!

I am currently thinking about "Invent Your Own Computer Games with
Python" by Al Sweigart. His thought is to give kids complete, workable
code for a real game and let them fool around with it. This might
work! I did something similar starting out with my son using QBASIC,
giving him a brief program that played music. He seemed to have quite
a lot of fun fooling around with different permutations of the
commands. Later, when I introduced him to some new commands, like
generating random numbers, he combined a number guessing game with his
self-composed musical theme.

Has anyone experience using this book?

-- 
Cheers!
boB
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] While learning Py: To IDE or not to IDE?

2012-05-20 Thread Brian van den Broek
On 20 May 2012 23:04, "boB Stepp"  wrote:



> Goals: Learn Python. While learning Python, learn all of the good
> C.Sc. stuff that I should have learned the first go-around, Learn Java
> and C/C++. Reevaluate.
>



> Finally to the question: With the stated goals above, would it be
> better to invest time now at the front-end in learning a powerful IDE,
> or am I better served, while learning Python, to stick with IDLE and
> the shell and worry about an IDE later? I am willing to invest time
> now on learning an IDE if it will save me time overall. IF it would be
> beneficial now to learn an IDE, then it begs the question as to
> whether I should search for the best IDE for Python, then later the
> best one for Java, etc., or, instead, look for the best one that can
> handle all of the languages I plan to learn and use.
>
> Thanks for any guidance you can provide!
> --
> Cheers!
> boB

Hi boB,

These are close to religious questions :-)

With you polyglot agenda, I would say you would be much better off to learn
a powerful multipurpose editor well than to try to find the best of breed
of each class of special purpose tool.

There are three basic choice: emacs, vi or vim, and everything else. There
is widespread, though not uniform, consensus that The One True Editor is
one of emacs and vi. After that, the rest is flamewars.

I am an emacist, myself. But some of my best friends are vimists.

Good luck,

Brian vdB
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] While learning Py: To IDE or not to IDE?

2012-05-20 Thread boB Stepp
On Sun, May 20, 2012 at 4:44 PM, Brian van den Broek
 wrote:

> These are close to religious questions :-)
>
> With you polyglot agenda, I would say you would be much better off to learn
> a powerful multipurpose editor well than to try to find the best of breed of
> each class of special purpose tool.
>
> There are three basic choice: emacs, vi or vim, and everything else. There
> is widespread, though not uniform, consensus that The One True Editor is one
> of emacs and vi. After that, the rest is flamewars.
>
> I am an emacist, myself. But some of my best friends are vimists.

I gather, then, that you feel my time would be well-spent now to learn
a good editor/IDE now, rather than continue with IDLE?

I did not intend to start a holy war on the best editor/IDE with my
questions! ~(:>))

But since you brought it up, I'll ask a somewhat more general
question: Why do you prefer an editor instead of a graphical IDE? I
have limited experience with Emacs as I finally installed it on my PC
at work to avoid having Windows-style end-of-line characters messing
up my scripts which were to run in an UNIX environment. I can see
potential there, but as my future projects get larger and more
involved will it be able to do everything I would want it to do? Would
I find myself wanting a full-fledged IDE? I don't have enough
technical knowledge to answer these questions right now. Your
thoughts?

Cheers!
boB
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Teaching an 8-year-old programming.

2012-05-20 Thread Mark Lybrand
Have you considered this book:

http://www.amazon.com/Hello-World-Computer-Programming-Beginners/dp/1933988495

Mark

On Sun, May 20, 2012 at 2:41 PM, boB Stepp  wrote:
> On Sun, May 20, 2012 at 4:15 PM, Devin Jeanpierre
>  wrote:
>> I've heard remarkable things about http://www.programbydesign.org/ ,
>> but it's aimed at students a little older. Its design might help you;
>> although, it also probably depends on motivation / what you want to
>> teach.
>>
>> Anyway, that's the best I can offer. Good luck! It sounds like you're
>> in for a fun time. :)
>>
>> -- Devin
>
> Thanks for the link. It looks interesting, but I'm not sure it is the
> way to go currently for my son. However, it gives me some ideas for my
> wife's class, which covers 7th through 9th grades in a single
> classroom.
>
> There seem to be many, ... , many thoughts on how to best teach
> programming to kids!
>
> I am currently thinking about "Invent Your Own Computer Games with
> Python" by Al Sweigart. His thought is to give kids complete, workable
> code for a real game and let them fool around with it. This might
> work! I did something similar starting out with my son using QBASIC,
> giving him a brief program that played music. He seemed to have quite
> a lot of fun fooling around with different permutations of the
> commands. Later, when I introduced him to some new commands, like
> generating random numbers, he combined a number guessing game with his
> self-composed musical theme.
>
> Has anyone experience using this book?
>
> --
> Cheers!
> boB
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor



-- 
Mark :)
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] While learning Py: To IDE or not to IDE?

2012-05-20 Thread Leam Hall

On 05/20/2012 06:19 PM, boB Stepp wrote:

On Sun, May 20, 2012 at 4:44 PM, Brian van den Broek

I am an emacist, myself. But some of my best friends are vimists.


Will pray for your soul...


But since you brought it up, I'll ask a somewhat more general
question: Why do you prefer an editor instead of a graphical IDE?


Because I work on a Winderz desktop at work but have to connect to my 
servers via ssh. So terminal enabled programs are better for me.


Because my hardware at home is so old that your average Gameboy has more 
computing power and better graphics.


Because I'm too cheap to pay for much of anything I can't touch.

And mostly because I don't make myself program as much as I want to and 
spend what little time coding actually in the code. Since I claim to 
want to be a programmer I need to do programmer stuff.


Leam
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Teaching an 8-year-old programming.

2012-05-20 Thread Robert Sjoblom
>> I am currently thinking about "Invent Your Own Computer Games with
>> Python" by Al Sweigart.
[snip]
>> Has anyone experience using this book?

"Snake wrangling for kids" is pretty good for teaching Python; it's
also free (which is a bonus):
http://www.briggs.net.nz/snake-wrangling-for-kids.html

I've not had the chance to read "Invent your own computer games with
Python", so can't say anything about it.

-- 
best regards,
Robert S.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Teaching an 8-year-old programming.

2012-05-20 Thread David Abbott
On Sun, May 20, 2012 at 6:28 PM, Mark Lybrand  wrote:
> Have you considered this book:
>
> http://www.amazon.com/Hello-World-Computer-Programming-Beginners/dp/1933988495
>
> Mark
[snip]
Another great book I really enjoyed it;
http://www.amazon.com/Python-Programming-Absolute-Beginner-Edition/dp/1435455002
All the best,
David
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] While learning Py: To IDE or not to IDE?

2012-05-20 Thread Alan Gauld

On 20/05/12 21:01, boB Stepp wrote:

Programming background;
1975-1978: FORTRAN, BASIC, some machine language/assembler.

...


FORTRAN was used during pursuit of physics degree.


That makes you the same vintage as me :-)


Goals: Learn Python. While learning Python, learn all of the good
C.Sc. stuff that I should have learned the first go-around, Learn Java
and C/C++. Reevaluate.


There are a couple of tutorials that try to do that, although most
just teach Python without any of the CS theory. I'd humbly suggest
mine is one of the couple... :-)


Finally to the question: With the stated goals above, would it be
better to invest time now at the front-end in learning a powerful IDE,
or am I better served, while learning Python, to stick with IDLE and
the shell and worry about an IDE later?


I strongly recommend sticking to the basics. An IDE just becomes one 
extra variable to worry about. Even IDLE has some idiosyncrasies but at 
least they are well known!


A good editor is a Godsend but they don't need to be super powerful.
You will of course get emacs and vim pushed-  both are great, I use them 
both for different tasks. But both are best on Unix. (vim is less 
powerful in vanilla form and so is better on Windows because its more of 
a pure editor than a text processing toolset like emacs). But tools like 
Scite or Notepad++ or even Kate and gedit will do the basics of syntax 
coloring etc.



now on learning an IDE if it will save me time overall.


Picking an IDE depends on what you are programming, some are better 
suited to particular tasks. If you only want a single IDE to cover Perl, 
Python, Java, C/C++ then Eclipse and Netbeans are the obvious choices. 
If you want to do GUI development in wxPython or Qt or. others might 
work better. And if you want database connectivity

then still others come into play.

The vim/emacs and a terminal approach works for everything of course
but are less GUI friendly.

More useful yet might be to learn a more advanced python shell. 
Ironpython is popular and adds several features to the simple >>> 
prompt. Coming from FORTRAN and even Perl its easy to miss the potential 
of the >>> prompt as a power tool for experimentally

building code. It is one of Python's best features.

If you are on Windows make sure you have turned all the CMD prompt 
options (> HELP CMD) to bring it up close to the standard of bash.


And of course ask questions here:
- post sample code that illustrates the problem, the shorter the better.
- always include full error text
- include sample data in and out if the question is data related


HTH

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Teaching an 8-year-old programming.

2012-05-20 Thread Alan Gauld

On 20/05/12 21:07, boB Stepp wrote:

This is, in a sense, a related question to the ones I just posted.
While observing me studying programming, my son has become interested
in learning how to program as well.


While its possible to write good code in QBASIC it's much easier to 
learn a lot of bad habits.


Learning Python will be better. Python was largely born as a tool to 
teach beginners to program while also usable in the real world. (There 
are many excellent child friendly languages to teach programming to kids 
but most are seriously limited beyond the basics - examples are Logo, 
Squeak/Robots/eToys etc.)


A good compromise is the excellent Turtle module in Python. It gives 
instant graphical results, teaches how to apply sequences, loops and 
branches and leads naturally into other programming challenges in Python.


Just

>>> import turtle
>>> help(turtle)

and experiment... remember that >>> prompt thing? :-)

You can also try my tutorial, I have had one 10 year old and one 14 year 
old complete it that I know of and it is/was used in a junior school 
computing class for a while. And of course, the author is readily 
available :-)


--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] While learning Py: To IDE or not to IDE?

2012-05-20 Thread Steven D'Aprano

boB Stepp wrote:


Finally to the question: With the stated goals above, would it be
better to invest time now at the front-end in learning a powerful IDE,


Depends on the powerful IDE. Personally, I haven't found an IDE that I like 
since I last used THINK Pascal on Apple Mac back in the 1990s.


Since you are using Solaris, I expect your options for IDEs are limited. 
You're probably best off using Unix as your IDE:


http://blog.sanctum.geek.nz/series/unix-as-ide/

which is my preferred solution. There's very little I can't do between my 
editor and a terminal window with a few tabs open.


If you can run KDE 3, I recommend "kate" (KDE Advanced Text Editor). Avoid KDE 
4, it is bloated and buggy and slow.




or am I better served, while learning Python, to stick with IDLE and
the shell and worry about an IDE later? I am willing to invest time
now on learning an IDE if it will save me time overall. IF it would be
beneficial now to learn an IDE, then it begs the question 


No it doesn't. It RAISES the question -- begging the question means to *assume 
the answer in the question*, and it is a logical fallacy.


"Notepad is the best editor, because no other editor is as good as Notepad" is 
begging the question.


http://begthequestion.info/
http://grammar.quickanddirtytips.com/begs-the-question.aspx



as to
whether I should search for the best IDE for Python, then later the
best one for Java, etc., or, instead, look for the best one that can
handle all of the languages I plan to learn and use.


That depends on the IDEs themselves. Good applications (whether an IDE or 
something else) should make it easy to discover functionality and as simple to 
learn as the task allows, so there's no disadvantage to exploring a number of 
good IDEs rather than committing to one early on and then sticking with it 
forever.




--
Steven
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] While learning Py: To IDE or not to IDE?

2012-05-20 Thread Steven D'Aprano

Brian van den Broek wrote:


There are three basic choice: emacs, vi or vim, and everything else. There
is widespread, though not uniform, consensus that The One True Editor is
one of emacs and vi. After that, the rest is flamewars.


That is insanity! There is only One True EDitor, ed! It is right there in the 
name, it's an EDitor! ed is the true unix editor:


http://www.gnu.org/fun/jokes/ed.msg.html



--
Steven

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Teaching an 8-year-old programming.

2012-05-20 Thread Jugurtha Hadjar

On 05/20/2012 09:07 PM, boB Stepp wrote:

This is, in a sense, a related question to the ones I just posted.
While observing me studying programming, my son has become interested
in learning how to program as well. I have given him a very old
Gateway PC to play around with. It was new when W95 came out. I have
started him out with QBASIC, which comes with W95. He seems to be
doing fine, but I am wondering if this is the best way to start him in
the world of programming? Any thoughts about this?

Thanks!


This sounds great! I started programming around 8 or 9 too with BASIC 
(QBasic, GWBasic,,,).


Your son is very lucky in two ways:

1- He is an english speaker: When I was his age, all I spoke were four 
languages (french, arabic, kabyle and algerian dialect) and none of them 
was english. English is the language to really access good resources on 
programming.


2- There is Internet in 2012: I didn't log in until I was a teenager and 
it was from an internet café because it was very expensive.


3- (I know I said two ways, but you shouldn't have believed me): He has 
a father who's an insider. It's a tremendous plus because you "get it".


The syntax is kind of merciful so he'd be up and running in no time, 
tackling what he really wants to do.


If I may suggest Zed Shaw's excellent series:

http://learnpythonthehardway.org/

The book can be found here (HTML):

http://learnpythonthehardway.org/book/

I'm biased, the guy has similar stuff for C too.


Later, he could do things with C/Python. I'm reading a book called "Real 
World Instrumentation with Python" where the author shows a combination 
between hardware level programming with C and wrapping/binding with 
Python. It's very interesting.



Good luck to both of you!

--
~Jugurtha Hadjar,
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Teaching an 8-year-old programming.

2012-05-20 Thread boB Stepp
On Sun, May 20, 2012 at 6:16 PM, Robert Sjoblom
 wrote:

> "Snake wrangling for kids" is pretty good for teaching Python; it's
> also free (which is a bonus):
> http://www.briggs.net.nz/snake-wrangling-for-kids.html
>

Thanks everyone for all of the good suggestions! After spending most
of the day looking at them I think that (for us) "Snake Wrangling for
Kids" is the winner. It is a very readable book that I think Jeremy
will be able to follow. It also incorporates the suggestions of Bill
and Alan in using Turtle Graphics, which I think (after playing with
it myself today) is pretty cool. Now I just have to get Jeremy some
updated hardware, so that he can both connect to the Internet and run
Python 3. This is an obvious opportunity to convince my wife to allow
me to update "my" hardware, so that both she and Jeremy can update
theirs.

-- 
Cheers!
boB
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] While learning Py: To IDE or not to IDE?

2012-05-20 Thread Modulok
> Since you are using Solaris, I expect your options for IDEs are limited.
> You're probably best off using Unix as your IDE:
>
> http://blog.sanctum.geek.nz/series/unix-as-ide/
>
> which is my preferred solution. There's very little I can't do between my
> editor and a terminal window with a few tabs open.


Apparently I'm not alone.

I've not found an IDE I liked much either. They all feel kind of
bloated with 37+
useless features I don't need. Instead, I use jEdit, a few choice plugins and
an ssh connection to a command shell on a FreeBSD file server. (The fact that
jEdit was written in java is irritating form a licensing perspective on some
OS's but the editor itself is top notch.)

A decent editor combined with a good command shell is all I've ever needed. If
I'm on the console alone, for minor editing I just use nano.

Personally, and this is just me, I've felt that big IDE's add a lot of
interface and fluff but not a lot of substance. One of the benefits of learning
a few basic editors and how to really use a command shell, is that it doesn't
matter what brand of linux/BSD/unix you're on, you're still pretty much at
home. That said, IDE's still have their place, especially when writing a lot
of GUI stuff.

Learning to use a command line at first feels really clunky and primitive, but
eventually it eclipses most GUI's and IDE's in terms of speed and the tools
available. You can also ooze right into system administration without much
effort.


But again, that's just me :p
-Modulok-
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor