473,841 Members | 1,694 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 7397
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
6314
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
9695
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
6737
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
2846
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
5259
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
1193
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
3031
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
1273
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
1291
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
9865
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9706
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10927
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10609
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...
0
10303
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
5691
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
4498
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
2
4082
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3140
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.