Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
So I am really annoyed by using IDLE. I need an IDE or simply a shell that can take a .py file and run it immediately, showing me the results.
I've configured Notepad++ to run python console, and I have to add "raw_input()" at the end of every file so it doesn't disappear. Problem is, if there is a syntax error, it won't show me the error, it won't go to raw_input. So I am forced to use IDLE.
I tried running DreamPie shell with notepad++ but it doesn't work that way. Neither does the IDLE shell.
How can I write Python code and then instantly see the results without using IDLE's editor?
EDIT: I found a plugin called PyNPP it allows you to run the 'interactive shell' for Python immediately, using a shortcut like F6 in Notepad++. This seems to work great! Sublime 2 seems like a nice editor too, but I couldn't get it to run shell.
I would recommend pydev for eclipse. You can download it from the pydev website
What kinds of scripts are you running? If you are doing just pure text output scripts without needing a GUI event loop, check out Sublime. It's a gorgeous editor, and extensible in python if you want to make addins for it. iPython is a great shell which has autocomplete (sort of).
http://www.sublimetext.com/
Komodo Edit is pretty good, has decent autocomplete and its free, it also doesn't suffer from the GUI event loop limitation that Sublime has (though it is also a larger application, and not nearly as pretty).
http://www.activestate.com/komodo-edit
Eclipse, as mentioned earlier, is a great IDE though it is huge - I personally prefer sublime as my goto editor.
I would recommend Emacs with python-mode.el.
This will be harder to get into initially, since Emacs has a bit of a learning curve. However, once you have it down, it has all the advantages of an interactive shell and an IDE. When you're working normally, it's like any other text editor/IDE, where you have syntax highlighting, code completion, and other nice features. When you want to be in a shell, control-c ! will pop one open, and you can paste code in, or highlight your code and send it to the shell.
That being said, Emacs isn't for everyone. Still, a lot of people like it once they learn it. Definitely worth giving a try.
IPython is a souped up version of the standard python shell. It does auto completion and syntax highlighting along with automatically providing help docs for various functions.
I tried several Sublimetext3, Vim etc. but there was always one or more issues.
Then I came across Zeus
http://www.zeusedit.com/index.html
Briljant simple and running straight out of the box if you set the link to the compiler. I am now on the 45 days trial period but I am going to buy it.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
I am a self-taught programmer coming from a scientific (non-programming) background. I discovered Jupyter early after I started using Python. And although I greatly enjoy using it (Jupyter), I feel that it somewhat hindered my ability to think ahead and write code that will be easy to maintain and interact with in the future.
I inevitably end up with these endless notebooks that are impossible to navigate and mostly consist of redundant code. I then tuck away some of the functions into text files. Make a copy of the notebook, delete a bunch of cells, and start over. Until the notebook becomes unmanageable again, then semi-refactor, make a copy, prune cells, and so on.
I feel that at this point I should learn some basic software design principles and practices (like version control and code organization). Is there a course or a lecture series you can recommend that might help me with that? I feel that any advice from you will be helpful. Thanks!
This will help in learning version control from official Git Documentation
This will also help in Software development philosophies from wikipedia
Try sublime text editor. It is not an IDE but it is really good for coding and has a bunch of useful coding plugins. It is not free but has an unlimited free trial, in which you get all the features, and an occasional popup asking you to buy it. If you download it, you should also use some plugins to help you code python
I personally use these plugins:
Origami, Terminus, Kite & Anaconda
I f you don't like sublime or using a plain text editor, check out visual studio code, idle or thonny.
They are full IDEs (not code editors), and will thus have more features.
IDLE & thonny are beginner's IDEs and Visual Studio Code is a lot more powerful & complex
Now you have your Jupyter notebook replacement on to the version control
Instead of using git, use github. It is built on top of git, and is a lot easier.
If you don't already have a github account then create one. Now you have a version control system going. I am not going to go any deeper because i am not very good at github version control so check out this site
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
(I use Mac OS X and Python version 3.4.3).
When I double-click on the Python program (.py), I don't want the source code to load/open in Python IDLE, I just want the program to run in Python Shell?
For example when I click the Spotify Icon App, it just runs the program and doesn't bring up its source code! I understand this maybe a very simple question, but I am really stuck! Any help will be great! If this is unclear feel free to ask me questions.
TLDR: You don't.
This isn't normally done; applications that you double click are usually compiled so that the source code isn't there anymore, instead it's been turned into machine-readable instructions for the computer. Since python code is source code, it's simply not designed to be run like an app.
You can compile your python code into an app every time you want to use it, using something like py2app but then the source-code inside isn't easily editable and it may be fiddly to get complex imports working with this, or multiple python versions. I wouldn't get into the habit of this.
Instead, to run a python file, use the Terminal, and type python file_location where file_location is the path to the file. Alternatively you could navigate in the Terminal to the directory containing your python file and then just use python file_name where file_name is the name of your file.
Only compile your python work into an app when it's at its final stage and ready for "release".
For example, what if your app prints something to the command line? Without running it from the command line where would python print that information? Or what if something goes wrong in it and it returns an error; where would that error message go? Also the newer versions of Mac and their "System Integrity Protection" can make life difficult for bundled apps.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm not sure if this question is appropriate for here, so if it isn't, I apologize, however I'm not sure where else to ask.
I've been learning python on codecademy however when I downloaded python myself it is nothing like what I've become used to. I can't for the life of me figure out where to define fucntions and I don't know where to find the console.
I would like basically the same that codecademy has with the editor / console 2-in-1 combo. Where can I find this?
FWIW I have python 3.3.5 that I downloaded from www.python.org
Thank you.
The version used by CodeAcademy is Python 2.
Download Python 2 from here: https://www.python.org/download/releases/2.7.6/
Once you are done downloading and installing it, open "IDLE (Python GUI)" and press <CTRL + N>.
This will open the python text editor. Enter your code, functions, and etc. in here.
Then press <F5> to run it.
This is what you should be seeing:
Python Shell (when you first run Python IDLE): http://gyazo.com/a3eca0fb88139c3a526b6f8fdfa6e4c0
And then when you press , you should see a blank file: http://gyazo.com/1d4426ac0e9fb49a50ea33fce881fcb6
As Amit pointed out, CodeAcademy is currently using Python 2.7.3. (I don't for the life of me see why that got downvoted, it's entirely relevant to the question, and "Python 2" covers an awful lot of ground.)
I can't recommend Python 3.x for working on CodeAcademy problems; the syntax and module changes from 2.x to 3.x will give you unending problems (with any luck they will update their course soon).
You can download the latest Python 2.7 (currently 2.7.6) from Python.org (https://www.python.org/download/releases/2.7.6); it is essentially identical to the CodeAcademy version with minor bug fixes.
For an interactive shell, I recommend Dreampie (http://www.dreampie.org/download.html); it has decent live code editing with code completion and documentation.
I also use the Notepad++ text editor (http://notepad-plus-plus.org/download/v6.5.5.html) quite a bit; it has decent code formatting and coloring (although the Python indentation is broken out-of-the-box; you have to go into Settings / Preferences..., Tab Settings, Python, uncheck Use default value, and check Replace by space to make it PEP-8 compliant). There is also a plugin, PyNPP, which will let you launch Python code directly from NotePad++ (no more cut-and-paste!) - you can get it through Notepad++'s built-in Plugin Manager - then hit Alt-Shift-F5 to launch the current file in an interactive Python shell window.
import sys
print sys.version_info
# sys.version_info(major=2, minor=7, micro=3, releaselevel='final', serial=0)
so you are looking for the 2.7.3 version from python.org
If you are very new to python, you may be experiencing the differences between python2 and python3. One main difference that a beginner will run into
print "this works" # in python 2
print("this works") # in python 3
print becomes a method, rather than whatever it was before... Also division is floating type by default, to get integer division in python 3 use 4//3 # output: 1 instead.
It sounds like you are looking for the interactive prompt, and a text editor.
If you want the interactive Python prompt:
If you are on Windows, look for a directory called C:\Python? and find a bin\python.exe.
If you are on Linux or OSX, typing python in the Terminal should get you the interactive prompt.
For a text editor to define functions, Notepad or gedit should help you.
Like I suspect most people reading this, I have no experience with Codecademy, but they seem to be running their own web front-end http://repl.it/ which is available for download -- if you really wanted to (and had the skills to set up a web server to host it on) you could even run that yourself.
The user interface looks like your run-of-the-mill programmers' editor; the abysmal color scheme is probably not worth copying anyway, and the interactive evaluation of your code (rather than the traditional save, quit, run, repeat cycle) is available via plug-ins in many modern editors. Or, as others have already suggested, you could use IDLE, which is a part of the standard Python distribution.
If Python's default interactive mode feels clumsy but otherwise right, you might also want to look at a popular souped-up replacement iPython
When I want to write a Python program, I open Windows explorer and go to the directory where I keep my .py files. When I right click a .py file, I am given the choice to "Edit with IDLE." I like IDLE really well. When I "Run" a program a Python Shell window opens. I work between these two windows.
(I think I used Notepad to create the first .py file because if you open IDLE you get a Python Shell.) (Another oddity - when I want to create a new program file I "Save As" to a new name.) In spite of these oddities IDLE is my favorite programming environment.
I think Komodo Edit is the editor codeacademy used to teach us.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I'm looking for a Python IDE that can help me easily locate and manage and use the libraries on my system (Ubuntu). Specifically Twisted.
Code completion is important including the symbols I import.
(I've so far had a look at PyDev as well as OpenKomodo, but while both offer code completion for default Python concepts, I wasn't able to get either to import Twisted into my project and was thus getting reference errors.)
Usual disclaimer: I don't like EMACS or vi, please, nothing regarding those.
Using Wing IDE with Twisted discusses how to debug twisted using their IDE - although unfortunately WingWare is not free.
Are you sure you have given PyDev a fair look? It seems to be the most popular Python IDE, and I have always had good experiences with it in the past.
I've just downloaded the preview of netbeans and it seems to have done quite well so far.
It has detected inherited methods & properties. I haven't had to add a single library reference in my project, so this seems to be the most fluid so far.
eclipse + pydev seems to work well for me.
Just remember to right-click on the project and select Properties and make sure that your libraries are on the path. Sometimes this doesn't happen for easy_installed libraries.
Check out JetBrains PyCharm. It features:
Code completion of any imported library
Good support for unit testing
Refactoring
Debugging
Version control integration
It's built on the same platform as IntelliJ IDEA which is a generally considered one of the best Java IDEs. There's a community edition which is free and open-source.
Like Eclipse is primarily a Java IDE written in Java, you could try Eric which is a Python IDE written in Python. I have had some issues with it in the past but I really enjoy the ability to stop your code at a breakpoint and have access to the python console to manipulate your data or even to inject new functions. PyDev could really use a console like that.
for a small proyects Scribes. Otherwise Eclipse+pydev.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I'm using Notepad++ for python development, and few days ago I found out about free Komodo Edit.
I need Pros and Cons for Python development between this two editors...
I have worked a bit with Python programming for Google App Engine, which I started out in Notepad++ and then recently shifted over to Komodo using two excellent startup tutorials - both of which are conveniently linked from this blog post (direct: here and here).
Komodo supports the basic
organization of your work into
Projects, which Notepad++ does not
(apart from physical folder
organization).
The custom commands
toolbar is useful to keep track of
numerous frequently-used commands
and even link to URLs (like online
documentation and the like).
It has a working (if sometimes clunky)
code-completion mechanism.
In short, it's an IDE which provides all the benefits thereof.
Notepad++ is simpler, much MUCH faster to load, and does support some basic configurable run commands; it's a fine choice if you like doing all your execution and debugging right in the commandline or Python shell. My advice is to try both!
I just downloaded and started using Komodo Edit. I've been using Notepad++ for awhile. Here is what I think about some of the features:
Komodo Edit Pros:
You can jump to a function definition, even if it's in another file (I love this)
There is a plugin that displays the list of classes, functions and such for the current file on the side. Notepad++ used to have a plugin like this, but it no longer works with the current version and hasn't been updated in a while.
Notepad++ Pros:
If you select a word, it will highlight all of those words in the current document (makes it easier to find misspellings), without having to hit Ctrl+F.
When working with HTML, when the cursor is on/in a tag, the starting and ending tags are both highlighted
Anyone know if either of those last 2 things is possible in Komodo Edit?
I use Komodo edit. The main reasons are: Intellisense (not as good as VisualStudio, but Python's a hard language to do intellisense for) and cross-platform compatibility. It's nice being able to use the same editor on my Windows machine, my linux machine, and my macbook with little to no change in feel.
I use both Komodo Edit and Notepad++.
Notepad++ is a lot quicker to launch and it's more lightweight, so I often use it for quick one-off editing.
I use Komodo Edit for major projects, like my django and wxPython applications. KE is a full-featured IDE, so it has a lot more features.
Main advantages of Komodo Edit for programming Python:
Manage groups of files as projects
Use custom commands to run files, run nosetests/pylint, etc.
Auto complete & syntax checking
Mozilla extension system, with several useful extensions available
Write macros in JavaScript or Python
Spell checking
Some of the little things that Notepad++ is missing for Python development:
Doesn't auto-indent after a colon
You can't set tabs/spaces on a file-type basis (I like to use tabs for HTML)
No code completion or tooltips
No on-the-fly syntax checking
As far as I know , Notepad++ doesn't show you the docstring each method has .
A downside I found of Notepad++ for Python is that it tends (for me) to silently mix tabs and spaces. I know this is configurable, but it caught me out, especially when trying to work with other people using different editors / IDE's, so take care.
I haven't used Komodo yet (the download never quite finished on the slow connection I was on at the time), but I use Eclipse with PyDev regularly and enjoy the "IDE" features described by the other respondents. However, I'm also regularly frustrated by how much of a resource hog it is.
I downloaded Notepad++ recently (much smaller download size ;-) ) and have been enjoying it quite a bit. The editor itself is nice and fast and it looks to be extensible. I'm hoping to copy some of my favorite features from IDE into Notepad++ and migrate, at some distant point in the future.
If I had to choose between Notepad++ and Komodo i would choose PyScripter ;.)
Seriously I consider PyScripter as a great alternative...
Downloaded both myself. Like Komodo better.
Komodo Pros: Like it better. Does more. Looks like an IDE. Edits Django templates
Notepad++ Cons: Don't like it as much. Does less. Looks less like and IDE.