473,597 Members | 2,423 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

os.system help

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.

Jul 18 '05 #1
8 1395

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.


Jul 18 '05 #2
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.



Jul 18 '05 #3
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

Jul 18 '05 #4
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:

Unfortunate ly 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


Jul 18 '05 #5
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>


Jul 18 '05 #6
On Sun, 18 Apr 2004 13:26:18 -0500, Reid Nichol <rn*********@ya hoo.com>
declaimed the following in comp.lang.pytho n:
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"

-- =============== =============== =============== =============== == <
wl*****@ix.netc om.com | Wulfraed Dennis Lee Bieber KD6MOG <
wu******@dm.net | Bestiaria Support Staff <
=============== =============== =============== =============== == <
Home Page: <http://www.dm.net/~wulfraed/> <
Overflow Page: <http://wlfraed.home.ne tcom.com/> <

Jul 18 '05 #7

"Reid Nichol" <rn*********@ya hoo.com> wrote in message
news:78******** *********@news1 .mts.net...
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

Jul 18 '05 #8
Reid Nichol <rn*********@ya hoo.com> 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
Jul 18 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
6522
by: Dave | last post by:
After following Microsofts admonition to reformat my system before doing a final compilation of my app I got many warnings/errors upon compiling an rtf file created in word. I used the Help Workshop program: hcw.exe that's included with Visual Basic. This exact same file compiled perfectly with no notes, warnings or errors prior to reformatting my system. Prior to the reformatting, I copied the help.rtf file onto a CD and checked the box to...
1
536
by: Rafael | last post by:
Hi, I hope I can find some help for this problem IDE: Visual Studio.NET 2003 Developer Editio Language: C# Problem: "An unhandled exception of type 'System.NullReferenceException' occurred in system.windows.forms.dll. Additional information: Object reference not set to an instance of an object. Visual Studio's IDE is not allowing me to develop projects in C#... I've trying to create a simple Windows Forms project using Visual Studio.NET...
0
297
by: Softer | last post by:
Hi I have been installed Longhorn, alfa version from PDC 2003. I tryed to install Visual Studio 8.0 "Whidbey", version Beta March 2004, under Longhorn and doesen't work. : I instaled Whidbey under XP and works well In .Net Framework 1.2 from Longhorn there is a namespace called System.Net.PeerToPeer in \Windows\Microsoft.Net\Windows\v6.0.4030\System.Net.PeerToPeer.dl Whidbey come with .Net Framework 2.0, but System.Net.PeerToPeer no...
5
1557
by: sugaray | last post by:
Right now, the code I wrote below seems works fine, i know it's definitely not the best solution, so if there are better solutions to eschew from using goto statements to jump out of multiple loops ? and any other suggestions or good ideas that are pertain to construct a more powerful and common interactive menu system is also welcomed, and if there's any primitive but better interactive system that is written in C suitable for educational...
5
3373
by: Steve Teeples | last post by:
Can someone point me to a document that clearly identifies the steps of creating a good help system for an application? I have a test tool that I'd like to add help to so that others will know how to use it. -- Steve
2
2659
by: Sean Carey | last post by:
I converted a C# Upload app to VB.NET and am down to one error and was hoping someone could help me with te error. I would greatly appreciate help from anyone. Here is the error: c:\inetpub\wwwroot\admin\filemanager.aspx.vb(76): Expression is of type 'System.Web.UI.HtmlControls.HtmlInputFile', which is not a collection type.
1
7828
by: mfunkmann | last post by:
Hi, I recently got an error and I don't know how to fix it: Error 1 'System.Data.DataColumn' does not contain a definition for 'Windows' C:\c#\CsharpPRO\Form1.Designer.cs 304 77 CsharpPRO I am note sure what to do because all propertiers work, except the System.Data.DataColumn.. I didn't write any code by hand and used the visual studio to set the properties..
10
3347
by: JonathanOrlev | last post by:
Hello everybody, I wrote this comment in another message of mine, but decided to post it again as a standalone message. I think that Microsoft's Office 2003 help system is horrible, probably the worst I ever seen. I almost cannot find anything I need, including things I
2
3817
by: Thomas Bauer | last post by:
Hello, I have a config file. <?xml version="1.0" encoding="utf-8"?> <configuration> <appSettings> <add key="Directory" value="C:\_Database\" /> <add key="CloseApplication" value="0" /> <add key="Extension" value="*.txt,*.log" />
0
7962
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8267
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8024
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6681
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5844
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3880
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3921
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2394
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1493
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.