Snippets management

Discussion in 'Python' started by Edwin, Nov 6, 2008.

  1. Edwin

    Edwin Guest

    Hi there,

    I've been looking for a snippet manager and found PySnippet but it
    requires PyGTK. Do you know any other option that doesn't need much?

    I'm sort of new to python and user interfaces seem a bit far for me
    right now, that's why I thought having to install PyGTK was
    unnecessary.

    Would you recommend installing it anyway?

    I'm on a Mac, maybe some users of Steve's Unix flavour know about a
    snippets software piece? I'm looking for free/open source alternatives.

    Thank you!

    P.S.: I'm also new to usenet ;) and hope my english is not that bad.
    Edwin, Nov 6, 2008
    #1
    1. Advertising

  2. Edwin

    r Guest

    On Nov 5, 7:55 pm, (Edwin) wrote:
    > Hi there,
    >
    > I've been looking for a snippet manager and found PySnippet but it
    > requires PyGTK. Do you know any other option that doesn't need much?
    >
    > I'm sort of new to python and user interfaces seem a bit far for me
    > right now, that's why I thought having to install PyGTK was
    > unnecessary.
    >
    > Would you recommend installing it anyway?
    >
    > I'm on a Mac, maybe some users of Steve's Unix flavour know about a
    > snippets software piece? I'm looking for free/open source alternatives.
    >
    > Thank you!
    >
    > P.S.: I'm also new to usenet ;) and hope my english is not that bad.


    I don't use one, but why not take a stab at coding one yourself.
    Use Tkinter to start, its easy. well documented
    gotta learn GUI somehow
    if you need links to docs or help let me know
    r, Nov 6, 2008
    #2
    1. Advertising

  3. Edwin

    Edwin B. Guest

    r <> writes:

    > On Nov 5, 7:55 pm, (Edwin) wrote:
    >> Hi there,
    >>
    >> I've been looking for a snippet manager and found PySnippet but it
    >> requires PyGTK. Do you know any other option that doesn't need much?
    >>
    >> I'm sort of new to python and user interfaces seem a bit far for me
    >> right now, that's why I thought having to install PyGTK was
    >> unnecessary.
    >>
    >> Would you recommend installing it anyway?
    >>
    >> I'm on a Mac, maybe some users of Steve's Unix flavour know about a
    >> snippets software piece? I'm looking for free/open source alternatives.
    >>
    >> Thank you!
    >>
    >> P.S.: I'm also new to usenet ;) and hope my english is not that bad.

    >
    > I don't use one, but why not take a stab at coding one yourself.
    > Use Tkinter to start, its easy. well documented
    > gotta learn GUI somehow
    > if you need links to docs or help let me know
    >


    Good idea. It's not that I don't want to learn GUI, but coming from Web
    related fields I'm taking it one step at a time, while learning Unix
    (editors, shell, filesystem hierarchy, etc.).

    All of this had been obscured by 'Apple's lifestyle'. It's been less than a
    year since I realized I had so much powerful software around.

    I'll start with Python documentation. If in any trouble, I'll get to you.

    Cheers!
    Edwin B., Nov 6, 2008
    #3
  4. On approximately 11/5/2008 8:23 PM, came the following characters from
    the keyboard of r:
    > I don't use one, but why not take a stab at coding one yourself.
    > Use Tkinter to start, its easy. well documented
    > gotta learn GUI somehow


    Since you are recommending tkinter, maybe you know what is the state of
    cross-platform (or even single-platform) printing capabilities in Tk
    these days? Last I heard, there was a plan, but it was nowhere near
    complete. So I guess the OP is on a mac, so maybe you could reply about
    mac printing capabilities, if you know, but I'm interesting in
    cross-platform printing.

    Because of that, I've started learning PyQt, which seems to be
    cross-platform at least for Linux, Mac, and Windows...

    --
    Glenn -- http://nevcal.com/
    ===========================
    A protocol is complete when there is nothing left to remove.
    -- Stuart Cheshire, Apple Computer, regarding Zero Configuration Networking
    Glenn Linderman, Nov 6, 2008
    #4
  5. On Wed, 05 Nov 2008 19:55:51 -0600, Edwin wrote:

    > Hi there,
    >
    > I've been looking for a snippet manager and found PySnippet but it
    > requires PyGTK. Do you know any other option that doesn't need much?

    [snip]

    If you're looking for a snippet manager for actually *using* it (not
    educational purposes or something), I'd recommend your favorite editor
    and the version control system of your choice. I found DVCSes to be
    rather nice for local ad-hoc repositories (particulary Git_). If you'd
    like to modify your snippet system you could take a look at Mercurial or
    Bazaar, both being written in Python.

    HTH,

    ... _Git: http://git.or.cz/

    --
    Robert "Stargaming" Lehmann
    Robert Lehmann, Nov 6, 2008
    #5
  6. Edwin

    Edwin Guest

    Robert Lehmann <> writes:

    > On Wed, 05 Nov 2008 19:55:51 -0600, Edwin wrote:
    >
    >> Hi there,
    >>
    >> I've been looking for a snippet manager and found PySnippet but it
    >> requires PyGTK. Do you know any other option that doesn't need much?

    > [snip]
    >
    > If you're looking for a snippet manager for actually *using* it (not
    > educational purposes or something), I'd recommend your favorite editor
    > and the version control system of your choice. I found DVCSes to be
    > rather nice for local ad-hoc repositories (particulary Git_). If you'd
    > like to modify your snippet system you could take a look at Mercurial or
    > Bazaar, both being written in Python.
    >
    > HTH,
    >
    > .. _Git: http://git.or.cz/


    That sounds interesting. As I'm learning Python sometimes I look for
    different approaches to the same problem so I use Git branches in order
    to save every try. It's just that I'm looking for a 'global' place in my
    system where I can save code ideas and useful snippets not particular to
    any project. Quick access could be useful for some copy/paste
    operations... I don't know.

    How would you set this up? A git folder 'snippets' maybe?

    Thanks for your ideas.
    Edwin, Nov 6, 2008
    #6
  7. On Thu, 06 Nov 2008 05:23:25 -0600, Edwin wrote:
    [snip]
    > As I'm learning Python sometimes I look for different approaches to the
    > same problem so I use Git branches in order to save every try. It's
    > just that I'm looking for a 'global' place in my system where I can
    > save code ideas and useful snippets not particular to any project.
    > Quick access could be useful for some copy/paste operations...
    > I don't know.
    >
    > How would you set this up? A git folder 'snippets' maybe?
    >
    > Thanks for your ideas.


    I don't think there is a one-size-fits-all solution.

    Setting up a 'snippets' repository sounds good if you just want to be
    able to look back at what you've done and/or have a place to stash away
    quick tests. I have set up a 'sandbox' folder (unrevisioned) and put
    together a few shell aliases for easier access and it works pretty well.
    I almost never look back at that code though.

    If you develop a lot of small scripts you think you'll reuse in your
    daily routine, you should add a dedicated 'bin' directory and add it to
    your PATH.

    I've also seen people put together libraries of "personal helpers", say,
    libedwin, but I don't think such mashups offer any particular semantic
    gain. They will just bloat over time and be vastly unused in most
    projects.

    So, I don't really know what you should do. I'd go for a throw away
    location for quick tests; *real* libraries/programs where reasonable. If
    you need a particular algorithm and know you've used it in project XY,
    just go back to this project and copy it. No big deal. If it's a
    generally applicable algorithm, extracting a library might be a good idea
    then.

    Just one last hint: Don't be overly shy in creating new Git repositories.
    They're pretty cheap and a shared history for *deeply unrelated projects*
    is seldom sensible (IMO). GitHub doesn't restrict you in your number of
    public repositories so that's no deal breaker either. :)

    Snippet'ly yours,

    --
    Robert "Stargaming" Lehmann
    Robert Lehmann, Nov 6, 2008
    #7
  8. Edwin

    Stef Mientki Guest

    Edwin wrote:
    > Hi there,
    >
    > I've been looking for a snippet manager and found PySnippet but it
    > requires PyGTK. Do you know any other option that doesn't need much?
    >
    > I'm sort of new to python and user interfaces seem a bit far for me
    > right now, that's why I thought having to install PyGTK was
    > unnecessary.
    >
    > Would you recommend installing it anyway?
    >
    > I'm on a Mac, maybe some users of Steve's Unix flavour know about a
    > snippets software piece? I'm looking for free/open source alternatives.
    >
    > Thank you!
    >
    > P.S.: I'm also new to usenet ;) and hope my english is not that bad.
    > --
    > http://mail.python.org/mailman/listinfo/python-list
    >


    I developed one in wxPython, you can see some of the features here.
    http://mientki.ruhosting.nl/data_www/pylab_works/pw_code_editor.html

    Although it's part of a larger part it can be used standalone,
    but then it requires two actions copy and paste.
    Started from a python application you can do copy+paste with just one
    action.
    It has integrated a full blown scintilla editor,
    with syntax highlighting, code completion, and syntax checker.

    If there's interest, I can distribute the files as a separate package.

    cheers,
    Stef Mientki
    Stef Mientki, Nov 6, 2008
    #8
  9. Edwin

    Edwin B. Guest

    Robert Lehmann <> writes:

    > I don't think there is a one-size-fits-all solution.


    I definetly agree.

    > Setting up a 'snippets' repository sounds good if you just want to be
    > able to look back at what you've done and/or have a place to stash away
    > quick tests. I have set up a 'sandbox' folder (unrevisioned) and put
    > together a few shell aliases for easier access and it works pretty well.
    > I almost never look back at that code though.
    >
    > If you develop a lot of small scripts you think you'll reuse in your
    > daily routine, you should add a dedicated 'bin' directory and add it to
    > your PATH.


    This is a nice method. I'm already putting it to use. I've learned about
    /usr/bin and /usr/local/bin so I went ahead and created $HOME/bin and
    added it to my path for this sort of code.

    Now, I was thinking more of a notes+code program. Let me give you an
    example:

    I use Emacs.app (Emacs compiled with --with-ns) and in order to get a
    meta key in the Spanish keyboard on my Mac I had to try different lines
    but I didn't want to keep all these tries in my .emacs file. I also
    wanted to keep the lines that didn't work for later tests in my Free BSD
    PC (also with a Spanish keyboard). So I keep all of them in my notebook.

    Then, I start coding Python. This time I try to translate an old PHP
    script to Python and want to keep a few important lines visible. It'll
    be nice to take some notes of the main differences in my scripts in a
    different place. Like a student's notebook. Once again, all this goes to
    my little program.

    Then, I remember I had to run some Mac maintenance commands... I don't
    remember the complete line very well, so I go to my notebook.

    My point is that sometimes not every note is useful for a program. I
    guess as I gain experience all these little notes will be kept in my
    mind ;). But as a newbie it seems useful.

    As r said, I think it'll be good to write this program. If it doesn't
    result in a very useful piece, it'll be a good way to practice.

    I forgot to mention I don't use a notes program to keep personal and
    programming notes separately.

    Thanks mate!

    P.S.: Man I hope my English doesn't suck too much.
    Edwin B., Nov 7, 2008
    #9
  10. Edwin

    expora Guest

    On Nov 6, 12:38 pm, Stef Mientki <> wrote:
    > Edwin wrote:
    > > Hi there,

    >
    > > I've been looking for a snippet manager and found PySnippet but it
    > > requires PyGTK. Do you know any other option that doesn't need much?

    >
    > > I'm sort of new to python and user interfaces seem a bit far for me
    > > right now, that's why I thought having to install PyGTK was
    > > unnecessary.

    >
    > > Would you recommend installing it anyway?

    >
    > > I'm on a Mac, maybe some users of Steve's Unix flavour know about a
    > > snippets software piece? I'm looking for free/open source alternatives.

    >
    > > Thank you!

    >
    > > P.S.: I'm also new to usenet ;) and hope my english is not that bad.
    > > --
    > >http://mail.python.org/mailman/listinfo/python-list

    >
    > I developed one in wxPython, you can see some of the features here.
    >  http://mientki.ruhosting.nl/data_www/pylab_works/pw_code_editor.html
    >
    > Although it's part of a larger part it can be used standalone,
    > but then it requires two actions copy and paste.
    > Started from a python application you can do copy+paste with just one
    > action.
    > It has integrated a full blown scintilla editor,
    > with syntax highlighting, code completion, and syntax checker.
    >
    > If there's interest, I can distribute the files as a separate package.
    >
    > cheers,
    > Stef Mientki


    Wicked!
    I'm going to check it out Stef.

    Is the source available? It's all about learning for me right now.

    Cheers!
    expora, Nov 7, 2008
    #10
  11. Edwin

    Stef Mientki Guest

    expora wrote:
    > On Nov 6, 12:38 pm, Stef Mientki <> wrote:
    >
    >> Edwin wrote:
    >>
    >>> Hi there,
    >>>
    >>> I've been looking for a snippet manager and found PySnippet but it
    >>> requires PyGTK. Do you know any other option that doesn't need much?
    >>>
    >>> I'm sort of new to python and user interfaces seem a bit far for me
    >>> right now, that's why I thought having to install PyGTK was
    >>> unnecessary.
    >>>
    >>> Would you recommend installing it anyway?
    >>>
    >>> I'm on a Mac, maybe some users of Steve's Unix flavour know about a
    >>> snippets software piece? I'm looking for free/open source alternatives.
    >>>
    >>> Thank you!
    >>>
    >>> P.S.: I'm also new to usenet ;) and hope my english is not that bad.
    >>> --
    >>> http://mail.python.org/mailman/listinfo/python-list
    >>>

    >> I developed one in wxPython, you can see some of the features here.
    >> http://mientki.ruhosting.nl/data_www/pylab_works/pw_code_editor.html
    >>
    >> Although it's part of a larger part it can be used standalone,
    >> but then it requires two actions copy and paste.
    >> Started from a python application you can do copy+paste with just one
    >> action.
    >> It has integrated a full blown scintilla editor,
    >> with syntax highlighting, code completion, and syntax checker.
    >>
    >> If there's interest, I can distribute the files as a separate package.
    >>
    >> cheers,
    >> Stef Mientki
    >>

    >
    > Wicked!
    > I'm going to check it out Stef.
    >
    > Is the source available? It's all about learning for me right now.
    >

    I've to extract the right libs from the larger program,
    as I'm in an import crisis right now,
    it may take a couple of days.
    If it's not here by the end of next week,
    mail be directly, because I forget a lot :)

    cheers,
    Stef
    > Cheers!
    > --
    > http://mail.python.org/mailman/listinfo/python-list
    >
    Stef Mientki, Nov 7, 2008
    #11
  12. Edwin

    Edwin Guest

    On Nov 7, 6:36 pm, Ricardo Aráoz <> wrote:
    >
    > Since you are in Linux you should definitely check "Basket". Go to it's
    > website and you'll be hooked, just what you need.


    Actually I use Mac OS and Free BSD but I'll check it out mate.
    Thanks for the tip!!
    Edwin, Nov 7, 2008
    #12
  13. Edwin

    Edwin Guest

    On Nov 7, 5:38 pm, Stef Mientki <> wrote:

    > I've to extract the right libs from the larger program,
    > as I'm in an import crisis right now,
    > it may take a couple of days.
    > If it's not here by the end of next week,
    > mail be directly, because I forget a lot :)
    >
    > cheers,
    > Stef
    >
    > > Cheers!
    > > --
    > >http://mail.python.org/mailman/listinfo/python-list


    Take your time mate. Thank you in advance.
    In the meantime. I'm going to check BasKet as Ricardo recommended.
    I'm also starting some sketches to make my own, ala Python. I don't
    know how much will it take me but if anyone is interested I can send
    you a message as soon as I've got something working.

    Cheers,
    Edwin, Nov 7, 2008
    #13
  14. Edwin B. wrote:
    > Robert Lehmann <> writes:
    >
    >> I don't think there is a one-size-fits-all solution.

    >
    > I definetly agree.
    >
    >> Setting up a 'snippets' repository sounds good if you just want to be
    >> able to look back at what you've done and/or have a place to stash away
    >> quick tests. I have set up a 'sandbox' folder (unrevisioned) and put
    >> together a few shell aliases for easier access and it works pretty well.
    >> I almost never look back at that code though.
    >>
    >> If you develop a lot of small scripts you think you'll reuse in your
    >> daily routine, you should add a dedicated 'bin' directory and add it to
    >> your PATH.

    >
    > This is a nice method. I'm already putting it to use. I've learned about
    > /usr/bin and /usr/local/bin so I went ahead and created $HOME/bin and
    > added it to my path for this sort of code.
    >
    > Now, I was thinking more of a notes+code program. Let me give you an
    > example:
    >
    > I use Emacs.app (Emacs compiled with --with-ns) and in order to get a
    > meta key in the Spanish keyboard on my Mac I had to try different lines
    > but I didn't want to keep all these tries in my .emacs file. I also
    > wanted to keep the lines that didn't work for later tests in my Free BSD
    > PC (also with a Spanish keyboard). So I keep all of them in my notebook.
    >
    > Then, I start coding Python. This time I try to translate an old PHP
    > script to Python and want to keep a few important lines visible. It'll
    > be nice to take some notes of the main differences in my scripts in a
    > different place. Like a student's notebook. Once again, all this goes to
    > my little program.
    >
    > Then, I remember I had to run some Mac maintenance commands... I don't
    > remember the complete line very well, so I go to my notebook.
    >
    > My point is that sometimes not every note is useful for a program. I
    > guess as I gain experience all these little notes will be kept in my
    > mind ;). But as a newbie it seems useful.
    >
    > As r said, I think it'll be good to write this program. If it doesn't
    > result in a very useful piece, it'll be a good way to practice.
    >
    > I forgot to mention I don't use a notes program to keep personal and
    > programming notes separately.
    >
    > Thanks mate!
    >
    > P.S.: Man I hope my English doesn't suck too much.
    >


    Since you are in Linux you should definitely check "Basket". Go to it's
    website and you'll be hooked, just what you need.
    Ricardo Aráoz, Nov 8, 2008
    #14
  15. Edwin

    Stef Mientki Guest

    expora wrote:
    > On Nov 6, 12:38 pm, Stef Mientki <> wrote:
    >
    >> Edwin wrote:
    >>
    >>> Hi there,
    >>>
    >>> I've been looking for a snippet manager and found PySnippet but it
    >>> requires PyGTK. Do you know any other option that doesn't need much?
    >>>
    >>> I'm sort of new to python and user interfaces seem a bit far for me
    >>> right now, that's why I thought having to install PyGTK was
    >>> unnecessary.
    >>>
    >>> Would you recommend installing it anyway?
    >>>
    >>> I'm on a Mac, maybe some users of Steve's Unix flavour know about a
    >>> snippets software piece? I'm looking for free/open source alternatives.
    >>>
    >>> Thank you!
    >>>
    >>> P.S.: I'm also new to usenet ;) and hope my english is not that bad.
    >>> --
    >>> http://mail.python.org/mailman/listinfo/python-list
    >>>

    >> I developed one in wxPython, you can see some of the features here.
    >> http://mientki.ruhosting.nl/data_www/pylab_works/pw_code_editor.html
    >>
    >> Although it's part of a larger part it can be used standalone,
    >> but then it requires two actions copy and paste.
    >> Started from a python application you can do copy+paste with just one
    >> action.
    >> It has integrated a full blown scintilla editor,
    >> with syntax highlighting, code completion, and syntax checker.
    >>
    >> If there's interest, I can distribute the files as a separate package.
    >>
    >> cheers,
    >> Stef Mientki
    >>

    >
    > Wicked!
    > I'm going to check it out Stef.
    >
    > Is the source available? It's all about learning for me right now.
    >

    source can now be found here:
    http://pylab-works.googlecode.com/files/Test_Scintilla_Templates.zip

    cheers,
    Stef
    Stef Mientki, Nov 10, 2008
    #15
  16. Edwin

    Edwin Guest

    On Nov 10, 3:14 pm, Stef Mientki <> wrote:
    > expora wrote:
    > > On Nov 6, 12:38 pm, Stef Mientki <> wrote:

    >
    > >> Edwin wrote:

    >
    > >>> Hi there,

    >
    > >>> I've been looking for a snippet manager and found PySnippet but it
    > >>> requires PyGTK. Do you know any other option that doesn't need much?

    >
    > >>> I'm sort of new to python and user interfaces seem a bit far for me
    > >>> right now, that's why I thought having to install PyGTK was
    > >>> unnecessary.

    >
    > >>> Would you recommend installing it anyway?

    >
    > >>> I'm on a Mac, maybe some users of Steve's Unix flavour know about a
    > >>> snippets software piece? I'm looking for free/open source alternatives.

    >
    > >>> Thank you!

    >
    > >>> P.S.: I'm also new to usenet ;) and hope my english is not that bad.
    > >>> --
    > >>>http://mail.python.org/mailman/listinfo/python-list

    >
    > >> I developed one in wxPython, you can see some of the features here.
    > >>  http://mientki.ruhosting.nl/data_www/pylab_works/pw_code_editor.html

    >
    > >> Although it's part of a larger part it can be used standalone,
    > >> but then it requires two actions copy and paste.
    > >> Started from a python application you can do copy+paste with just one
    > >> action.
    > >> It has integrated a full blown scintilla editor,
    > >> with syntax highlighting, code completion, and syntax checker.

    >
    > >> If there's interest, I can distribute the files as a separate package.

    >
    > >> cheers,
    > >> Stef Mientki

    >
    > > Wicked!
    > > I'm going to check it out Stef.

    >
    > > Is the source available? It's all about learning for me right now.

    >
    > source can now be found here:
    >  http://pylab-works.googlecode.com/files/Test_Scintilla_Templates.zip
    >
    > cheers,
    > Stef


    How great!
    Thanks for sharing mate! Downloading...

    Cheers,
    E.
    Edwin, Nov 11, 2008
    #16
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. - Steve -

    Reusing Code Snippets

    - Steve -, Sep 30, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    424
    Greg Burns
    Oct 1, 2004
  2. Pat

    Where are my Code Snippets?

    Pat, Apr 20, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    394
    Simon Harris
    Apr 23, 2005
  3. Steve Franks
    Replies:
    2
    Views:
    359
    Juan T. Llibre
    Sep 11, 2005
  4. Floris van Haaster

    Project management / bug management

    Floris van Haaster, Sep 23, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    1,237
    Jon Paal
    Sep 23, 2005
  5. pouet
    Replies:
    2
    Views:
    752
    Will Hartung
    Jul 30, 2004
Loading...

Share This Page