os.system help

Discussion in 'Python' started by Grzegorz Dostatni, Apr 18, 2004.

  1. Cheers.

    In short ghostscript is not installed by default on windows. You can
    install it yourself (http://www.cs.wisc.edu/~ghost/doc/AFPL/get814.htm)
    and install. You could also try to package it in your program somehow (for
    example including the binary in your program directory). I'm not sure if
    it will work properly though.

    I don't think there is anything installed by default on windows that can
    read .ps files.

    You could also try another approach. I am not entirely sure, but I think
    that Python Imaging Library supports writing/reading .ps files.

    Greg



    Advice is what we ask for when we already know the answer but wish we
    didn't.
    -- Erica Jong (How to Save Your Own Life, 1977)


    On Sat, 17 Apr 2004, Reid Nichol wrote:

    > Hello,
    > I have made a program that works wonderfully on OpenBSD but it uses
    > os.system to get ghostscript to convert ps to jpeg. But, I wish this
    > program to run on Windows as well. Is there any way I can snag where
    > the gs executable is on Windows? What it is named? And so forth.
    >
    >
    Grzegorz Dostatni, Apr 18, 2004
    #1
    1. Advertising

  2. Grzegorz Dostatni

    Reid Nichol Guest

    Hello,
    I have made a program that works wonderfully on OpenBSD but it uses
    os.system to get ghostscript to convert ps to jpeg. But, I wish this
    program to run on Windows as well. Is there any way I can snag where
    the gs executable is on Windows? What it is named? And so forth.
    Reid Nichol, Apr 18, 2004
    #2
    1. Advertising

  3. Grzegorz Dostatni

    Reid Nichol Guest

    Unfortunately PIL only writes .eps files. I was going to get the users
    to install gs but of course it's install directory is variable. I've
    tried using shortcuts but that didn't work.

    Since most of my intended users use windows only...



    Grzegorz Dostatni wrote:
    > Cheers.
    >
    > In short ghostscript is not installed by default on windows. You can
    > install it yourself (http://www.cs.wisc.edu/~ghost/doc/AFPL/get814.htm)
    > and install. You could also try to package it in your program somehow (for
    > example including the binary in your program directory). I'm not sure if
    > it will work properly though.
    >
    > I don't think there is anything installed by default on windows that can
    > read .ps files.
    >
    > You could also try another approach. I am not entirely sure, but I think
    > that Python Imaging Library supports writing/reading .ps files.
    >
    > Greg
    >
    >
    >
    > Advice is what we ask for when we already know the answer but wish we
    > didn't.
    > -- Erica Jong (How to Save Your Own Life, 1977)
    >
    >
    > On Sat, 17 Apr 2004, Reid Nichol wrote:
    >
    >
    >>Hello,
    >> I have made a program that works wonderfully on OpenBSD but it uses
    >>os.system to get ghostscript to convert ps to jpeg. But, I wish this
    >>program to run on Windows as well. Is there any way I can snag where
    >>the gs executable is on Windows? What it is named? And so forth.
    >>
    >>

    >
    >
    Reid Nichol, Apr 18, 2004
    #3
  4. On Sat, 17 Apr 2004 23:32:01 -0500, Reid Nichol wrote:

    > Unfortunately PIL only writes .eps files. I was going to get the users
    > to install gs but of course it's install directory is variable. I've
    > tried using shortcuts but that didn't work.
    >
    > Since most of my intended users use windows only...


    I'm not familiar with GS on Windows, but it may be worth searching the
    registry to see whether the install path is written there.

    Jeremy
    Jeremy Sanders, Apr 18, 2004
    #4
  5. Grzegorz Dostatni

    Reid Nichol Guest

    The registry contains certain data but not *exactly* the data I need. I
    could construct from that but according to the docs it's quite new so
    I'd rather not use it.

    I know there has to be a way to tell if I'm on a certain platorm.
    Something like:
    if __win32__:
    print 'on windows'

    But, I can't find any docs on that. I'm probably looking in the wrong
    place, so, could someone point me in the right direction or just give me
    that if statment.

    Thanks


    Jeremy Sanders wrote:
    > On Sat, 17 Apr 2004 23:32:01 -0500, Reid Nichol wrote:
    >
    >
    >>Unfortunately PIL only writes .eps files. I was going to get the users
    >>to install gs but of course it's install directory is variable. I've
    >>tried using shortcuts but that didn't work.
    >>
    >>Since most of my intended users use windows only...

    >
    >
    > I'm not familiar with GS on Windows, but it may be worth searching the
    > registry to see whether the install path is written there.
    >
    > Jeremy
    >
    Reid Nichol, Apr 18, 2004
    #5
  6. Reid Nichol wrote

    > I know there has to be a way to tell if I'm on a certain platorm.
    > Something like:
    > if __win32__:
    > print 'on windows'
    >
    > But, I can't find any docs on that. I'm probably looking in the wrong
    > place, so, could someone point me in the right direction or just give me
    > that if statment.


    if sys.platform == "win32":
    print "on windows"

    </F>
    Fredrik Lundh, Apr 18, 2004
    #6
  7. On Sun, 18 Apr 2004 13:26:18 -0500, Reid Nichol <>
    declaimed the following in comp.lang.python:

    > The registry contains certain data but not *exactly* the data I need. I
    > could construct from that but according to the docs it's quite new so
    > I'd rather not use it.
    >
    > I know there has to be a way to tell if I'm on a certain platorm.
    > Something like:
    > if __win32__:
    > print 'on windows'


    import sys
    if sys.platform == "win32":
    print "On windows"

    --
    > ============================================================== <
    > | Wulfraed Dennis Lee Bieber KD6MOG <
    > | Bestiaria Support Staff <
    > ============================================================== <
    > Home Page: <http://www.dm.net/~wulfraed/> <
    > Overflow Page: <http://wlfraed.home.netcom.com/> <
    Dennis Lee Bieber, Apr 18, 2004
    #7
  8. Grzegorz Dostatni

    bobb Guest

    "Reid Nichol" <> wrote in message
    news:78lgc.3445$...
    > Hello,
    > I have made a program that works wonderfully on OpenBSD but it uses
    > os.system to get ghostscript to convert ps to jpeg. But, I wish this
    > program to run on Windows as well. Is there any way I can snag where
    > the gs executable is on Windows? What it is named? And so forth.
    >

    I test my gs things through cygwin on my windows box.
    hth

    bobb
    bobb, Apr 19, 2004
    #8
  9. Grzegorz Dostatni

    JanC Guest

    Reid Nichol <> schreef:

    > The registry contains certain data but not *exactly* the data I need. I
    > could construct from that but according to the docs it's quite new so
    > I'd rather not use it.


    I did this 2 years ago (using a NSIS 1.x install script to change a batch
    file) and it worked for everyone who tested & used it then (at least 10
    people, maybe more). I think most of them had a 7.x GS version.
    (Maybe some 6.x versions too, but I don't remember exactly.)

    Two years isn't that "quite new" anymore...

    --
    JanC

    "Be strict when sending and tolerant when receiving."
    RFC 1958 - Architectural Principles of the Internet - section 3.9
    JanC, Apr 19, 2004
    #9
    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. sfunds sfunds
    Replies:
    9
    Views:
    8,688
  2. Charles A. Lackman

    Streaming with System.IO and System.Net

    Charles A. Lackman, Dec 8, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    541
    Richard Grimes [MVP]
    Jan 15, 2005
  3. Mark Miller
    Replies:
    1
    Views:
    1,068
    Mark Miller
    Jul 18, 2003
  4. Matt
    Replies:
    2
    Views:
    828
    Matt Getting
    Jul 24, 2003
  5. keithb
    Replies:
    3
    Views:
    18,503
    =?ISO-8859-1?Q?G=F6ran_Andersson?=
    May 7, 2006
Loading...

Share This Page