File under things-I-didn't-know-but-should-have:

Instead of creating batch files all over the place to fire up python
programs, and then having to cope with annoying "Terminate batch job
(Y/N)?" with Ctrl-C/Break you can ask python setuptools to create an .exe
in the Python\Scripts folder.

in same folder as foo.py create setup.py, populate like so:

from setuptools import setup

setup(
    name='Foo for you',
    version='0.3',
    py_modules=['foo'],
    entry_points='''
        [console_scripts]
        foo = foo
        '''
    )

Then run "pip --editable install . " in the same folder. Foo.exe will be
created in C:\pythonxx\Scripts. As long as that folder is in path you can
use foo like any other command line program. Furthermore the "editable"
parameter means we can continue to edit and change foo.py and the changes
are always live.

Yay! No more "pushd ..\path\to\data\folder && python ..\path\to\code\foo.py
--do-stuff-here ..." for me. :)

Works for Leo too -- with the existing setup.py. It creates leo.exe and
leoc.exe for Windowed mode (no log messages to console) and console mode
respectively.

cheers,

matt

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to