Re: how do "real" python programmers work?

2006-01-18 Thread Stormcoder
I might be a little late to the party but my comments may still be
valuable.

I write Python code in emacs. Emacs has an great python-mode. The code
I write can range from a GUI apps to server side code and emacs works
just as well in all cases. Some of the features that make emacs a good
Python editor is a built in code browser, embedded interactive shell,
evaluation of python code in either a region, class, function or the
whole buffer. I can force a reimport of the code in a buffer to the
interactive interpreter. Add onto those features all the nifty emacs
text editing features plus the ability to build tools on top of emacs
and you have a really good development system. I've used a number of
commercial and open source tools including Slickedit, and pretty much
all the Python specific tools out there and have come back to emacs
because it does what I need without getting in my way.

The way I work in this environment is that I will open my project files
then start an interpreter within emacs. So the way it looks when I
start is that I have a split window with my Python buffers on top with
a tab for each one. In emacs you can enable grouping for the tabs so
that when I am editing a certain kind of file only those tabs are
immediately visible. The bottom window has my interpreter. When I think
I am finished with a block of code (function, class etc) I will
evaluate it and make sure that it doesn't have any syntax errors. I can
then go down to the interactive interpreter that is in the bottom
window and test the function or class etc. I then go back up to the
editor and write more code, rinse repeat. This works extremely well for
me. I've written some large Python apps this way.

bblais wrote:
> Hello,
>
> Let me start by saying that I am coming from a background using Matlab
> (or Octave), and C++.  I am going to outline the basic nuts-and-bolts
> of how I work in these languages, and ask for some help to find out how
> the same thing is done in Python.  I am not sure what the standard is.
>
> In C++, I open up an editor in one window, a Unix shell in another.  I
> write the code in the editor, then switch to the shell window for
> compile and run.  I then go back to the editor for modifications, and
> then compile and run in the shell window.
>
> In Matlab, I do much the same thing, except there is no compile phase.
> I have the editor on one window, the Matlab interactive shell in the
> other.  I often make a bunch of small scripts for exploration of a
> problem, before writing any larger apps.  I go back and forth editing
> the current file, and then running it directly (Matlab looks at the
> time stamp, and automagically reloads the script when I modify it).
>
> In Python, there seems to be a couple ways of doing things.   I could
> write it in one window, and from a Unix shell call
>python myscript.py
> and be like C++, but then I lose the interactiveness which makes
> prototyping easier.  If I use the python shell, I can use import (and
> reload), or execfile perhaps.
>
> How do experienced python programmers usually do it?  Is there a
> "usually" about it, or is it up to personal taste?  Are there any
> convenient ways of doing these things?
>
> I realize this is a pretty newbie question, but it could possibly save
> me hours of time if there is a better way to work.
> 
> 
>   thanks,
> 
> Brian Blais

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Software Needs Philosophers

2006-06-05 Thread Stormcoder
He means Lisp macros. Lisp macros are nothing like the crippled C++
macros that people tend to think of.

Roedy Green wrote:
> On 21 May 2006 02:15:31 -0700, "Xah Lee" <[EMAIL PROTECTED]> wrote,
> quoted or indirectly quoted someone who said :
>
>
> Java has lots of macro languages, including C++'s preprocessor. What
> it does not have is a sanctioned one.  It has instead on-the-fly code
> generation. See http://mindprod.com/jgloss/onthefly.html
>
>
> --
> Canadian Mind Products, Roedy Green.
> http://mindprod.com Java custom programming, consulting and coaching.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Concurrency, I guess

2006-01-23 Thread Stormcoder
Using candygram you can send the sync thread a message telling it to
reread the config file or you could send a message that changes the
setting directly. Candygram is much better than the standard threading
module which is designed after the Java threading library. Java
recently added another threading library because the old one was not
adequate.

The reason you can't simply share a global variable is that threads do
not share state. You have to go through a lot of trouble to share that
state. First you have to setup some form of interprocess communications
such as a memory mapped file, shared mem, pipe, socket etc. You then
have to implement locking and try to debug what you have done.
Debugging multi threaded programs is inherently difficult.
I would highly recommend using candygram or an asynchronous library,
since it sounds like you haven't done any multi-threaded programming
before. In candygram you can send threads messages which don't require
any synchronization or IPC setup.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: CRC calculation

2006-05-04 Thread Stormcoder
Check out http://docs.python.org/lib/module-zlib.html comes with a CRC
function.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Swaying A Coder Away From Python

2006-05-04 Thread Stormcoder
I usually refer to it as "VILE!". As in what Vile thing do I have
before me. 

Emacs all the way baby!

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: John Bokma harassment

2006-05-24 Thread Stormcoder
Five is not excessive when they are on topic and they are on topic. If
you don't like his posts ignore them, killfile them, whatever. I took
the time to write his ISP a supporting email because it is important to
keep unpopular speech, even more than popular speech, free. Censoring
usenet serves no good purpose.

-- 
http://mail.python.org/mailman/listinfo/python-list