Re: [Tutor] Coming from R, what's a good IDE editor? I've tried PyCharm and Spyder

2017-06-03 Thread Peter Otten
C W wrote:

> Dear Python list,
> 
> I am an R user learning Python. What is a good editor?
> 
> 1) Pycharm
> PyCharm evaluates the entire script, I just want to change a few lines in
> the script.
> For example,
> 
> import matplotlib.pyplot as plt
> import numpy as np
> 
> x = np.arange(0, 1,0.1)
> y = np.sin(2 * np.pi * x)
> 
> plt.figure(1)
> plt.clf()
> plt.plot(x, y)
> plt.show()
> 
> Now, I want to do a scatter plot, but don't want to generate the data
> again. I just want the "line by line" evaluation like in R and Matlab.
> Basically, you can type in console and add to the existing variables.

That sounds more like an interactive interpreter than an IDE.
There is one such interpreter with bells, whistles, and notebooks

https://ipython.org/

> 2) Spyder
> Spyder looks a lot like RStudio, I like it! But, it does not have an app
> icon in applications.  I am baffled. I do ~/anaconda/bin/spyder every
> time.
> 
> Am I missing something or is this the way it is?
> 
> Thank you very much!
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor


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


Re: [Tutor] Coming from R, what's a good IDE editor? I've tried PyCharm and Spyder

2017-06-03 Thread Zachary Ware
On Fri, Jun 2, 2017 at 12:46 PM, C W  wrote:
> Dear Python list,
>
> I am an R user learning Python. What is a good editor?
>
> 1) Pycharm
> PyCharm evaluates the entire script, I just want to change a few lines in
> the script.
> For example,
>
> import matplotlib.pyplot as plt
> import numpy as np
>
> x = np.arange(0, 1,0.1)
> y = np.sin(2 * np.pi * x)
>
> plt.figure(1)
> plt.clf()
> plt.plot(x, y)
> plt.show()
>
> Now, I want to do a scatter plot, but don't want to generate the data
> again. I just want the "line by line" evaluation like in R and Matlab.
> Basically, you can type in console and add to the existing variables.

>From the sound of it, you may be more interested in Jupyter Notebook
(jupyter.org) than a "proper editor".  Otherwise, I've been happy with
a combination of PyCharm and vim.

Hope this helps,
-- 
Zach
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Coming from R, what's a good IDE editor? I've tried PyCharm and Spyder

2017-06-03 Thread Mats Wichmann
On 06/02/2017 11:46 AM, C W wrote:
> Dear Python list,
> 
> I am an R user learning Python. What is a good editor?
> 
> 1) Pycharm
> PyCharm evaluates the entire script, I just want to change a few lines in
> the script.
> For example,
> 
> import matplotlib.pyplot as plt
> import numpy as np
> 
> x = np.arange(0, 1,0.1)
> y = np.sin(2 * np.pi * x)
> 
> plt.figure(1)
> plt.clf()
> plt.plot(x, y)
> plt.show()
> 
> Now, I want to do a scatter plot, but don't want to generate the data
> again. I just want the "line by line" evaluation like in R and Matlab.
> Basically, you can type in console and add to the existing variables.

If you just want an editor, use an editor, not an IDE. An IDE attempts
to understand the totality of your project so it can give you
suggestions on various things e.g. autocompletion for methods and so
forth - as you describe above - and if that's not what you want, don't
use one.

Sadly, vim, which is The Best Editor Ever (see 23 million flamewars for
why such statement can only be a feeble attempt at humor, not reality),
is now trying to behave like an IDE, and it's doing things badly wrong.
For example, if I type import in a "from" line, it helpfully inserts the
word import... meaning those end up with syntax errors, "from foo import
import bar".  I don't know who is responsible for that idiocy and
haven't taken the time to figure out how to shut off the misbehavior.

You're not really talking about an editor with the rest of your
description, though.  You want to type something and have it acted on
right away. The IDEs, and even the almost-IDE programs, can run the
script with a quick key sequence, which is fairly close to what you're
talking about.  Sublime Text and Atom are two that are more editor than
IDE, but still have IDE-like behavior.

All this is just opinions...

Another opinion is Jupyter notebook (formerly iPython notebook) might be
closer to what you're looking for.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] New blog that has solution for python programs

2017-06-03 Thread Mats Wichmann

> I don't think "what the authors might want" is the only factor here. 
> Personally, I think these programming challenge sites probably do more 
> harm than good, discouraging people that they're not good enough to be a 
> programmer because they can't solve the (often exceedingly tricky) 
> problems on their own. I think they're often dick-measuring contests, 
> for elite programmers to show off and sneer at "lesser mortals" who 
> can't solve the problems.
> 
> In the real world, nobody has to solve these sorts of problems under the 
> constraints given. In real life programming, you get to look for 
> existing solutions, you get to consult with your colleagues, pass ideas 
> back and forth, etc. If you need a solution to X, and your colleague 
> already solved it for another project, you say "Hey Fred, I'm stealing 
> your code" and if Fred gets upset you talk to his project manager who 
> tells Fred to cooperate.

Indeed... they're a slightly tamer variant of the even worse "clickbait"
articles like "how to answer the 10 top Python interview questions", not
a single one I've ever seen being something I'd expect to be part of a
competent interview process.

However, I still don't like the idea of answering people's quizzes. I
won't violently disagree with Steven's viewpoint, however.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Coming from R, what's a good IDE editor? I've tried PyCharm and Spyder

2017-06-03 Thread Mike C
Hi Ben,

I have not used Vim or Emacs for a very long time. I am spoiled by the friendly 
interface of RStudio.

There is a high demand for Python in the industry, but there has not been a 
good IDE. I find that strange.


_
From: Ben Finney mailto:ben+pyt...@benfinney.id.au>>
Sent: Saturday, June 3, 2017 1:50 AM
Subject: Re: [Tutor] Coming from R, what's a good IDE editor? I've tried 
PyCharm and Spyder
To: mailto:tutor@python.org>>


C W mailto:tmrs...@gmail.com>> writes:

> I am an R user learning Python. What is a good editor?

Either of Vim or Emacs – together with a good multi-tabbed terminal
program – make an excellent programmer IDE.

--
\ “When I was a baby I kept a diary. Recently I was re-reading |
`\ it, it said ‘Day 1: Still tired from the move. Day 2: Everybody |
_o__) talks to me like I'm an idiot.’” —Steven Wright |
Ben Finney

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


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


Re: [Tutor] Coming from R, what's a good IDE editor? I've tried PyCharm and Spyder

2017-06-03 Thread Alan Gauld via Tutor
On 03/06/17 07:20, Mike C wrote:

> There is a high demand for Python in the 
> industry, but there has not been a good IDE.
There are a ton of IDEs for Python including the
generic ones like VS, Eclipse and Netbeans.
But... I've tried many of these and find I keep
coming back to the simpler 3-window approach to
Python development:
- A code editor(multi-tabbed),
- an open interpreter session and
- an OS prompt for running/testing the program.

I always find that faster and more effective
than a complex IDE.

I'm not against IDEs in general and for C++ and
Java I find an IDE more or less essential. But
the immediacy and simplicity of Python with its
interpreter is very hard to beat. (It's the closest
thing I've found to the Smalltalk workspace for
productive programming)

> I find that strange.

It seems so until you try it. IDEs and Python
just don't work that well for many people. (Of
course there are also many folks who do like them
and use them, but compared to other languages they
are less used, because they offer less benefit.)


-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


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


Re: [Tutor] New blog that has solution for python programs

2017-06-03 Thread Jay Lozier



On 06/02/2017 09:07 PM, Mats Wichmann wrote:

I don't think "what the authors might want" is the only factor here.
Personally, I think these programming challenge sites probably do more
harm than good, discouraging people that they're not good enough to be a
programmer because they can't solve the (often exceedingly tricky)
problems on their own. I think they're often dick-measuring contests,
for elite programmers to show off and sneer at "lesser mortals" who
can't solve the problems.

In the real world, nobody has to solve these sorts of problems under the
constraints given. In real life programming, you get to look for
existing solutions, you get to consult with your colleagues, pass ideas
back and forth, etc. If you need a solution to X, and your colleague
already solved it for another project, you say "Hey Fred, I'm stealing
your code" and if Fred gets upset you talk to his project manager who
tells Fred to cooperate.

Indeed... they're a slightly tamer variant of the even worse "clickbait"
articles like "how to answer the 10 top Python interview questions", not
a single one I've ever seen being something I'd expect to be part of a
competent interview process.

However, I still don't like the idea of answering people's quizzes. I
won't violently disagree with Steven's viewpoint, however.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
"Hey Fred, I'm stealing your code" - in the group I am in we are 
expected to use each other's code. Reusing known, good, working code 
saves time, money, and effort. Also, we are expected to ask each other 
for advice as needed.

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


Re: [Tutor] Coming from R, what's a good IDE editor? I've tried PyCharm and Spyder

2017-06-03 Thread C W
I want to run something from script and edit in the console.

For example, pseudo code

1) I run a Monte Carlo simulation for 5 min, I got simulation results.
> my_sim = mcmc(1000)

2) I calculate the mean, var, sd, of the simulated numbers
> mean = sum(my_sim)/100
> and so on...

3) I want to revise my mean and sd formula

For step 3, you can just highlight that portion of the script with the
modified formula. It's very convenient!

In another word, I want to do trial and error, play with the code and see
what comes out.  Not running everything from the top every time.

Thank you for all your suggestions, I appreciate it!

On Sat, Jun 3, 2017 at 4:06 AM, Alan Gauld via Tutor 
wrote:

> On 03/06/17 07:20, Mike C wrote:
>
> > There is a high demand for Python in the
> > industry, but there has not been a good IDE.
> There are a ton of IDEs for Python including the
> generic ones like VS, Eclipse and Netbeans.
> But... I've tried many of these and find I keep
> coming back to the simpler 3-window approach to
> Python development:
> - A code editor(multi-tabbed),
> - an open interpreter session and
> - an OS prompt for running/testing the program.
>
> I always find that faster and more effective
> than a complex IDE.
>
> I'm not against IDEs in general and for C++ and
> Java I find an IDE more or less essential. But
> the immediacy and simplicity of Python with its
> interpreter is very hard to beat. (It's the closest
> thing I've found to the Smalltalk workspace for
> productive programming)
>
> > I find that strange.
>
> It seems so until you try it. IDEs and Python
> just don't work that well for many people. (Of
> course there are also many folks who do like them
> and use them, but compared to other languages they
> are less used, because they offer less benefit.)
>
>
> --
> Alan G
> Author of the Learn to Program web site
> http://www.alan-g.me.uk/
> http://www.amazon.com/author/alan_gauld
> Follow my photo-blog on Flickr at:
> http://www.flickr.com/photos/alangauldphotos
>
>
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Coming from R, what's a good IDE editor? I've tried PyCharm and Spyder

2017-06-03 Thread Francois Dion
PyCharm has support for cell based notebooks, interactive python console
etc. You can set up the layout so it mirrors Rstudio. Spyder should have
installed correctly. How did you install?

Having said that, you should also look into JupyterLab:
https://github.com/jupyterlab/jupyterlab,
YHat's Rodeo: https://www.yhat.com/products/rodeo
and of course, vim + tmux + tmuxp and something like sidecar:
https://github.com/smashwilson/jupyter-sidecar
Enthought's Canopy: https://store.enthought.com/downloads/#default

All of them can be configured to replicate pretty much the same workflow as
rstudio, although there's a cliff waiting when deploying this stuff to
production. I've sat in many conferences and meetups where the speaker is
demoing his code directly in Rstudio and, of course, gets to the point
where there's an undefined variable. "oh yeah, I forgot about that..."

Not a knock against R, just something to be aware of in systems that allow
non linear code execution (like Jupyter notebooks, be it R, Python, Octave,
Coconut or anything else that runs in it).

Also, look into the rpy2 python module and feather-format. That way you can
still go back and forth with R.


Francois



On Fri, Jun 2, 2017 at 1:46 PM, C W  wrote:

> Dear Python list,
>
> I am an R user learning Python. What is a good editor?
>
> 1) Pycharm
> PyCharm evaluates the entire script, I just want to change a few lines in
> the script.
> For example,
>
> import matplotlib.pyplot as plt
> import numpy as np
>
> x = np.arange(0, 1,0.1)
> y = np.sin(2 * np.pi * x)
>
> plt.figure(1)
> plt.clf()
> plt.plot(x, y)
> plt.show()
>
> Now, I want to do a scatter plot, but don't want to generate the data
> again. I just want the "line by line" evaluation like in R and Matlab.
> Basically, you can type in console and add to the existing variables.
>
> 2) Spyder
> Spyder looks a lot like RStudio, I like it! But, it does not have an app
> icon in applications.  I am baffled. I do ~/anaconda/bin/spyder every time.
>
> Am I missing something or is this the way it is?
>
> Thank you very much!
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>



-- 
raspberry-python.blogspot.com - www.pyptug.org - www.3DFutureTech.info -
@f_dion
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Coming from R, what's a good IDE editor? I've tried PyCharm and Spyder

2017-06-03 Thread Ben Finney
C W  writes:

> In another word, I want to do trial and error, play with the code and
> see what comes out. Not running everything from the top every time.

Already suggested, but I will repeat: You will find that Jupyter
Notebook https://jupyter.org/> is explicitly designed to make that
easy.

-- 
 \  “Now Maggie, I’ll be watching you too, in case God is busy |
  `\   creating tornadoes or not existing.” —Homer, _The Simpsons_ |
_o__)  |
Ben Finney

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