From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Simon Newsgroups: gmane.emacs.help Subject: Python workflow Date: Fri, 6 Nov 2009 03:42:44 -0800 (PST) Organization: http://groups.google.com Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1257520637 11196 80.91.229.12 (6 Nov 2009 15:17:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 6 Nov 2009 15:17:17 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 06 16:17:10 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1N6QYj-00051c-0E for geh-help-gnu-emacs@m.gmane.org; Fri, 06 Nov 2009 16:17:05 +0100 Original-Received: from localhost ([127.0.0.1]:45256 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N6QYi-0005v9-D6 for geh-help-gnu-emacs@m.gmane.org; Fri, 06 Nov 2009 10:17:04 -0500 Original-Path: news.stanford.edu!usenet.stanford.edu!postnews.google.com!p35g2000yqh.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 39 Original-NNTP-Posting-Host: 94.245.127.14 Original-X-Trace: posting.google.com 1257507765 20741 127.0.0.1 (6 Nov 2009 11:42:45 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 6 Nov 2009 11:42:45 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: p35g2000yqh.googlegroups.com; posting-host=94.245.127.14; posting-account=RibUSwoAAAALKEHRvTWorFStqBb2l_hI User-Agent: G2/1.0 X-HTTP-Via: 1.1 EUR-PRXY-13 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.1.4) Gecko/20091016 Firefox/3.5.4,gzip(gfe),gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:174465 X-Mailman-Approved-At: Fri, 06 Nov 2009 10:14:41 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:69549 Archived-At: Hi, apologies in advance for a potentially numpty post. I've been using Emacs for a little while now, but I've yet to settle on a satisfactory python edit-run-debug cycle, and I was wondering what wiser minds than mine have settled upon. So far I've tried: * Edit code and run with emacs PDB. After fiddling the lisp code to automatically pick up the current buffer as the default run candidate, this is nearly okay. The main issue is that, after editing code, there's no easy way to rerun the code, so I end up killing the gud buffer every time. As such, entering and leaving the debugger is quite a few key presses and accidentally leaving it running is also easy. * Tried Pydb to similar effect. * Run everything in a seperate shell. And debug by hand. This is a little too low-fi, even for me. * Use the 'import/reload file' and 'eval def/class' functions, and run everything from the emacs python shell, using pdbtrack to help with debugging. Problems so far: *** It's very easy to forget which modules you've modified and fail to reload them; because the state is carried over I continually find myself running the old versions of code I've just edited, especially if it's across several files. *** More than that, sometimes the stuff I expect to reload simply doesn't, and I have no indication as to why. For example, if pdb has module open and you stick a deliberate error in the code and reload it, the minibuffer tells you the module has been loaded, even though it clearly can't have been. *** I have to run pdb.pm() to debug the exception. If I run *anything* else by accident, I lose the exception context. This can be annoying if you're incompetent enough to keep making typos (I am). Does anyone have any tips on their workflow? Many thanks! Simon