473,761 Members | 8,372 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IDLE history, Python IDE, and Interactive Python with Vim

This is sort of both Python and Vim related (which is why I've posted to
both newsgroups).

Python related:
----------------------
I have been frustrated for quite some time with a lack of a history
command in IDLE (in fact with IDLE in general). Often I'll develop new
code at the command line, testing each line as I go. Currently I have to
copy and paste, removing outputs and the ">>>" at each line.
Is it perhaps possible to make some kind of hack to do this (dump a
command history)?

Idle in general isn't that great IMO, so I was wondering also if there are
better alternatives out there? What do people use mostly? I've tried
something called pyCrust, but this too didn't have history and some other
things I was looking for. On a more general note, although the agility
and simplicity of Python make programming tools like an IDE less
necessary, it still seems that Python is lacking in this departement. The
PyDev plug-in for Eclipse seems like good step in this direction, although
I haven't tried it yet. Does anyone have any experience with this, or
perhaps can point me to other tools.

Vim related:
----------------------
Ideally, it would be nice to have a command mapped to a keystroke that can
append the last executed command to a file. Even better would be a system
that would integrate the file editing and interactive command line tool
more seamlessly. Something along the lines of a debugger + file editor
+ command line utility, where file editor = vim. I know that vim has a
utility for running python commands from its command prompt, but I have
had a hard time getting this to work in windows and haven't explored it.
Has anyone seen/tried a system along these lines, perhaps incorporating
the python debugger (pdb)? I can see something that will run the file you
are editing in vim up to the cursor or a mark with a set_trace at the line
you are editing.
Any info is appreciated, thanks.

--
Ashot Petrosian
University of Texas at Austin, Computer Sciences
Jul 18 '05 #1
15 7388
This is certainly a worthy topic. There are several IDEs for Python
(one I like very much being Komodo) that have plenty of fancy
debugging features and advanced operations, however I have yet to
encounter (elsewhere) the convenience that comes with being able to
press F5 and have an interactive interpreter load my code and be ready
for testing.

That said, that is my only reason for my ever using IDLE. Without it I
would probably forget that IDLE exists, were it not for the obnoxious
context menu entry. ;)

--
Daniel Bickett
dbickett at gmail.com
http://heureusement.org/
Jul 18 '05 #2
Daniel Bickett wrote:
This is certainly a worthy topic. There are several IDEs for Python
(one I like very much being Komodo) that have plenty of fancy
debugging features and advanced operations, however I have yet to
encounter (elsewhere) the convenience that comes with being able to
press F5 and have an interactive interpreter load my code and be ready
for testing.


*Sigh*, I too am a vi kinda guy, and I keep badgering the WingIDE
gang to give Wing a vi mode ... :) They keep saying "it's coming",
but it's been a while ... and in fairness to them, I don't think
there is exactly a huge horde of vi barbarians at their gate!
Probably a pretty tiny horde, and not very noisy. ;)

Steve
Jul 18 '05 #3
WingIDE looks nice though, and it seems that the interactive shell is
built in from the screenshots. Can you run a program to a certain point
break point and use the shell?

On Wed, 02 Feb 2005 23:40:40 -0500, Stephen Waterbury <go***@comcast. net>
wrote:
Daniel Bickett wrote:
This is certainly a worthy topic. There are several IDEs for Python
(one I like very much being Komodo) that have plenty of fancy
debugging features and advanced operations, however I have yet to
encounter (elsewhere) the convenience that comes with being able to
press F5 and have an interactive interpreter load my code and be ready
for testing.


*Sigh*, I too am a vi kinda guy, and I keep badgering the WingIDE
gang to give Wing a vi mode ... :) They keep saying "it's coming",
but it's been a while ... and in fairness to them, I don't think
there is exactly a huge horde of vi barbarians at their gate!
Probably a pretty tiny horde, and not very noisy. ;)

Steve


--
=============== ===============
Ashot Petrosian
University of Texas at Austin, Computer Sciences
(views expressed are solely my own)
=============== ===============
Jul 18 '05 #4
If you use IPython for your interactive mode stuff, you'll have a nice
history...
Regards,

Fuzzy
http://www.voidspace.org.uk/python/index.shtml

Jul 18 '05 #5
Fuzzyman a écrit :
If you use IPython for your interactive mode stuff, you'll have a nice
history...
Regards,

Fuzzy
http://www.voidspace.org.uk/python/index.shtml


Best event : if your "EDITOR" system variable in "vim", using the "ed"
command in ipython will bring "vim" with (eventually) the code you want
to edit :)

Now, I wonder if you could embed ipython inside vim ...

Pierre
Jul 18 '05 #6
Daniel Bickett a écrit :
This is certainly a worthy topic. There are several IDEs for Python
(one I like very much being Komodo) that have plenty of fancy
debugging features and advanced operations, however I have yet to
encounter (elsewhere) the convenience that comes with being able to
press F5 and have an interactive interpreter load my code and be ready
for testing.


Try emacs + python-mode.

Jul 18 '05 #7
Pierre Barbier de Reuille a écrit :
Fuzzyman a écrit :
If you use IPython for your interactive mode stuff, you'll have a nice
history...
Regards,

Fuzzy
http://www.voidspace.org.uk/python/index.shtml

Best event : if your "EDITOR" system variable in "vim", using the "ed"
command in ipython will bring "vim" with (eventually) the code you want
to edit :)

Now, I wonder if you could embed ipython inside vim ...


<holy-war>
Don't know, but you can embed ipython inside emacs !-)
</holy-war>
Pierre

Jul 18 '05 #8
I think SPE has exactly what you need. Next to the shell there is the
session, which has only the commands typed on the interactive prompt.

Stani

http://spe.pycs.net

Ashot wrote:
This is sort of both Python and Vim related (which is why I've posted to both newsgroups).

Python related:
----------------------
I have been frustrated for quite some time with a lack of a history
command in IDLE (in fact with IDLE in general). Often I'll develop new code at the command line, testing each line as I go. Currently I have to copy and paste, removing outputs and the ">>>" at each line.
Is it perhaps possible to make some kind of hack to do this (dump a
command history)?

Idle in general isn't that great IMO, so I was wondering also if there are better alternatives out there? What do people use mostly? I've tried something called pyCrust, but this too didn't have history and some other things I was looking for. On a more general note, although the agility and simplicity of Python make programming tools like an IDE less
necessary, it still seems that Python is lacking in this departement. The PyDev plug-in for Eclipse seems like good step in this direction, although I haven't tried it yet. Does anyone have any experience with this, or perhaps can point me to other tools.

Vim related:
----------------------
Ideally, it would be nice to have a command mapped to a keystroke that can append the last executed command to a file. Even better would be a system that would integrate the file editing and interactive command line tool more seamlessly. Something along the lines of a debugger + file editor + command line utility, where file editor = vim. I know that vim has a utility for running python commands from its command prompt, but I have had a hard time getting this to work in windows and haven't explored it. Has anyone seen/tried a system along these lines, perhaps incorporating the python debugger (pdb)? I can see something that will run the file you are editing in vim up to the cursor or a mark with a set_trace at the line you are editing.
Any info is appreciated, thanks.

--
Ashot Petrosian
University of Texas at Austin, Computer Sciences


Jul 18 '05 #9
Have a gander at Boa Constructor.

YOu can certainly go to a shell when debugging. (ie set breakpoint)
then the shell is attached to that context.

T

Ashot wrote:
This is sort of both Python and Vim related (which is why I've posted
to both newsgroups).

Python related:
----------------------
I have been frustrated for quite some time with a lack of a history
command in IDLE (in fact with IDLE in general). Often I'll develop new
code at the command line, testing each line as I go. Currently I have
to copy and paste, removing outputs and the ">>>" at each line.
Is it perhaps possible to make some kind of hack to do this (dump a
command history)?

Idle in general isn't that great IMO, so I was wondering also if there
are better alternatives out there? What do people use mostly? I've
tried something called pyCrust, but this too didn't have history and
some other things I was looking for. On a more general note, although
the agility and simplicity of Python make programming tools like an IDE
less necessary, it still seems that Python is lacking in this
departement. The PyDev plug-in for Eclipse seems like good step in
this direction, although I haven't tried it yet. Does anyone have any
experience with this, or perhaps can point me to other tools.

Vim related:
----------------------
Ideally, it would be nice to have a command mapped to a keystroke that
can append the last executed command to a file. Even better would be a
system that would integrate the file editing and interactive command
line tool more seamlessly. Something along the lines of a debugger +
file editor + command line utility, where file editor = vim. I know
that vim has a utility for running python commands from its command
prompt, but I have had a hard time getting this to work in windows and
haven't explored it. Has anyone seen/tried a system along these lines,
perhaps incorporating the python debugger (pdb)? I can see something
that will run the file you are editing in vim up to the cursor or a
mark with a set_trace at the line you are editing.
Any info is appreciated, thanks.

--
Ashot Petrosian
University of Texas at Austin, Computer Sciences

Jul 18 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
6310
by: Christoph Becker-Freyseng | last post by:
Hello, is there a way to dump (and save) the command-history of the python interactive mode. Thanks, Christoph Becker-Freyseng
3
9685
by: Miki Tebeka | last post by:
Hello All, I'd like to bind <CTRL+L> so that it will clear IDLE's screen (in the interactive prompt). Any pointers/suggetions? Thanks. Miki
1
6729
by: dbrown2 | last post by:
I typically use IDLE for editing and debug. On Windows at least, IDLE and the standard turtle graphics module do not mix. I think both use Tkinter. For now I use IPython and Jedit when using the turtle module but it's not a great solution for me. Is there any known work-around to use turtle with IDLE? If not is there a planned fix for the problem. I find turtle is a convenient way to do simple graphics without having to install...
13
2838
by: John Salerno | last post by:
If I want to write my code in a separate text editor (I like UltraEdit) but then press a single button to have that code run in the IDLE environment, is that possible? I know that you can configure UE to run external tools, but I can't figure out how to run IDLE this way, because when I check on its properties to find it's file path, it is just the Python directory itself. So not only do I not know where to find the actual file to run...
6
5253
by: John (Z R) L | last post by:
Hi all, I am very new to programming, and I chose to study the Python language before C++. I am currently using the Wikibooks "Non-Programmer's Tutorial for Python", and am up to the section "Who goes there"? http://en.wikibooks.org/wiki/Non-Programmer%27s_Tutorial_for_Python/Who_Goes_There%3F But after clicking "run module" for " a = 1
0
1187
by: Jan Kanis | last post by:
Hello everyone, I'm trying to change the interactive python prompt. According to the docs this is done by changing sys.ps1 and sys.ps2 . That works fine when running python interactively from a command line, but when running in IDLE the .ps1 and .ps2 don't seem to exist. I suppose this has something to do with Idle and the python shell in it both running in different processes, with the prompts generated by the Idle process?
1
3024
by: wongjoekmeu | last post by:
Dear All, I have some functions written in C++, which I try to approach from python using swig. In the C++ functions I use std::cout to print stuff to output. Everything works fine, but the only problem that I have is that when I start IDLE and use the functions what std::cout should print to the "IDLE console" simply does not appear. When I don't use IDLE but simply double click on the .py script, it works all fine. I was wondering how...
3
1267
by: Nikhil | last post by:
Hi, I am using python -i, and I find it hard typing/pasting the commands from the previous interactive shell. Basically, is there anyway that I can preserve the history in the shell? I guess but not sure there should be something like ~/.pyrc for configuring such but can someone please let me know what is the effective environment variable to preserve the history? Thanks,
0
1285
by: Terry Reedy | last post by:
Gabriel Genellina wrote: You can paste a multi-line statement and it gets executed. You can paste in more, and the first may be executed, but anything after is ignored. I presume you are talking about the Python interpreter in interactive mode, not IDLE on Linux. The interactive interpreter in Windows also accepts multiple statements.
0
9957
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9905
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9775
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8780
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7332
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6609
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5229
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3881
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3456
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.