Re: Python scripting with Paint Shop Pro 8.0

Discussion in 'Python' started by Greg Brunet, Jul 21, 2003.

  1. Greg Brunet

    Greg Brunet Guest

    Hi Marc:

    "Marc Wilson" <> wrote in message
    news:...
    > I've just got Paint Shop Pro 8.0, and the functionality of the old
    > ImageRobot add-on has been replaced with the new Python Scripting.


    Thanks for mentioning PSP 8's support of Python. I have an older copy
    that I haven't updated for a while, and this scripting capability is an
    update worthwhile making!

    > What I'm trying to determine is: can I run these scripts from a

    command-line
    > invocation? I want to use the scripts to automatically convert files

    as
    > they arrive, uploaded onto a website, not interactively.


    I just DL'd an eval copy also, and a couple of thoughts.
    1) Duncan's already pointed out the file association, so it looks like
    that's an easy way to ensure that the Python script is handled properly
    by PSP.

    2) Python was installed there for me. You should see "python22.dll" in
    your [C:\Program Files\Jasc Software Inc\Paint Shop Pro 8] (or
    appropriate) directory. There shold also be a [\Python Libraries]
    subdirectory with other required files.

    3) Interestingly, I can't find any sign of a JascApp.* file anywhere. I
    would expect to see a PYC or PYD given the Import command, but being a
    relative newbie myself, don't have a good understanding of how this
    could be. But, hey - it seems to work, so I won't complain.

    4) I would expect that for btach processing you would also pass the file
    to process at the command shell, but they do seem to offer some extra
    help for batch processing (the "Processing all the files in a directory"
    section on page 26 of the script.pdf manual (available at their website
    if you've only got all the HTML documentation from the CD) I agree that
    the Docs could be a bit more helpful!

    5) Of course the messages showing off PIL have opened my eyes to how
    easy it is to use that - and Python is LOTS easier than Perl IMHO.

    --
    Greg
     
    Greg Brunet, Jul 21, 2003
    #1
    1. Advertising

  2. Greg Brunet

    Marc Wilson Guest

    In comp.lang.python, "Greg Brunet" <> (Greg
    Brunet) wrote in <>::

    |Hi Marc:
    |
    |"Marc Wilson" <> wrote in message
    |news:...
    |> I've just got Paint Shop Pro 8.0, and the functionality of the old
    |> ImageRobot add-on has been replaced with the new Python Scripting.
    |
    |Thanks for mentioning PSP 8's support of Python.

    "Support" may be an exaggeration. Part of the problems I've had are that
    JASC seem to regard "support" as something that only happens to other
    people- or at least, their UK distributor does. They don't even answer the
    phone, last couple of weeks.

    |I have an older copy
    |that I haven't updated for a while, and this scripting capability is an
    |update worthwhile making!
    |
    |> What I'm trying to determine is: can I run these scripts from a
    |command-line
    |> invocation? I want to use the scripts to automatically convert files
    |as
    |> they arrive, uploaded onto a website, not interactively.
    |
    |I just DL'd an eval copy also, and a couple of thoughts.
    |1) Duncan's already pointed out the file association, so it looks like
    |that's an easy way to ensure that the Python script is handled properly
    |by PSP.
    |
    |2) Python was installed there for me. You should see "python22.dll" in
    |your [C:\Program Files\Jasc Software Inc\Paint Shop Pro 8] (or
    |appropriate) directory. There shold also be a [\Python Libraries]
    |subdirectory with other required files.

    Got all that- but no .exe, so presumably can only run Python *via* PSP.
    I've now got a separate Python exe to try- maybe I can bypass PSP
    altogether.

    |3) Interestingly, I can't find any sign of a JascApp.* file anywhere. I
    |would expect to see a PYC or PYD given the Import command, but being a
    |relative newbie myself, don't have a good understanding of how this
    |could be. But, hey - it seems to work, so I won't complain.
    |
    |4) I would expect that for btach processing you would also pass the file
    |to process at the command shell, but they do seem to offer some extra
    |help for batch processing (the "Processing all the files in a directory"
    |section on page 26 of the script.pdf manual (available at their website
    |if you've only got all the HTML documentation from the CD) I agree that
    |the Docs could be a bit more helpful!

    I don't think we're using "batch" in the same way: I'm using it in the old
    mainframe sense of "unattended, non-interactive". Anything with a GUI is
    out. It's to be triggered by a file upload to the website.
    |
    |5) Of course the messages showing off PIL have opened my eyes to how
    |easy it is to use that - and Python is LOTS easier than Perl IMHO.

    Don't know enough about either to say, but I've heard Python propaganda from
    ex-Perlies. :)
    --
    Marc Wilson

    Cleopatra Consultants Limited - IT Consultants
    2 The Grange, Cricklade Street, Old Town, Swindon SN1 3HG
    Tel: (44/0) 70-500-15051 Fax: (44/0) 870 164-0054
    Mail: Web: http://www.cleopatra.co.uk
    _________________________________________________________________
    Try MailTraq at https://my.mailtraq.com/register.asp?code=cleopatra
     
    Marc Wilson, Jul 21, 2003
    #2
    1. Advertising

  3. Greg Brunet

    David Bolen Guest

    "Greg Brunet" <> writes:

    > 3) Interestingly, I can't find any sign of a JascApp.* file anywhere. I
    > would expect to see a PYC or PYD given the Import command, but being a
    > relative newbie myself, don't have a good understanding of how this
    > could be. But, hey - it seems to work, so I won't complain.


    This would work if they "embedded" Python rather than "extending" it.
    Using Python as an embedded scripting engine, the embedding
    application (probably the main PSP executable) can define whatever
    modules it wants as built-in modules prior to executing Python code.
    The "modules" actually exist right in the executable that is starting
    the Python interpreter.

    If true, then it would make it less likely you could use that
    functionality from an externally initiated Python script, since that
    script wouldn't have started from the right environment containing
    those built-in modules.

    -- David
     
    David Bolen, Jul 21, 2003
    #3
  4. Marc Wilson wrote:
    > [...] One thing I've not found in the reference (perhaps I'm looking in the wrong
    > place): how do I capture command-line parameters? [...]


    sys.argv

    For fancier options, check out optparse (new in 2.3) or getopt.

    -- Gerhard
     
    =?ISO-8859-1?Q?Gerhard_H=E4ring?=, Jul 22, 2003
    #4
  5. "Greg Brunet" <> wrote in message news:<>...

    > Thanks for mentioning PSP 8's support of Python. I have an older copy
    > that I haven't updated for a while, and this scripting capability is an
    > update worthwhile making!
    >


    Greg,

    If you do upgrade, please let them know that the python scripting was
    a major factor in your decision to do so.
     
    Kevin Dahlhausen, Jul 23, 2003
    #5
    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. Replies:
    4
    Views:
    4,652
    Brendan Guild
    Oct 23, 2005
  2. Aahz
    Replies:
    5
    Views:
    795
    Duncan Booth
    Jul 22, 2003
  3. Martin Franklin

    Re: Python scripting with Paint Shop Pro 8.0

    Martin Franklin, Jul 21, 2003, in forum: Python
    Replies:
    11
    Views:
    1,913
    Marc Wilson
    Jul 24, 2003
  4. Ron Stephens
    Replies:
    23
    Views:
    2,923
    Ron Stephens
    Apr 12, 2004
  5. Wayne Erfling
    Replies:
    0
    Views:
    343
    Wayne Erfling
    Nov 18, 2006
Loading...

Share This Page