<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<font size="2"><font face="Verdana">I wanted the ability to transact
with postgreSQL from within Scribus<br>
and the Python Interpreter shipped with Scribus does not contain<br>
the postgreSQL module: psycopg2<br>
<br>
So, as I wrote earlier today, I hacked the Windows build to use<br>
my installed Python vs. that shipped with the build.<br>
<br>
Others may want to do the same, so I have created a Windows
batch file<br>
that accomplishes the necessary substitutions.<br>
<br>
Here is the script:<br>
-------------------------------------------<br>
@echo off<br>
::<br>
:: special run of Scribus that uses Python installed on the<br>
:: users system that matches the build of the Python
interpreter<br>
:: shipped with Scribus rather than the Python Interpreter
shipped<br>
:: with Scribus' build.<br>
::<br>
:: See: http...wiki....[Windows Replacing Shipped Python
Interpreter]<br>
::<br>
echo.<br>
echo Running Scribus ***without*** its shipped Python
Interpreter<br>
echo.<br>
::<br>
:: Hide the shipped version of the Python interpreter so
Scribus will use<br>
:: the "same" version we have built on Windows <br>
::<br>
if exist python (<br>
echo masking Scribus Python directory<br>
ren python python.SUSPEND<br>
)<br>
if exist python27.dll (<br>
echo masking Scribus library python.dll<br>
ren python27.dll python27.dll.SUSPEND<br>
)<br>
echo.<br>
::<br>
:: point to our custom Python which should match the build
of<br>
:: Python shipped with this version of Scribus<br>
:: See:<br>
::<br>
PATH=C:\Python278;.<br>
::<br>
:: run it!<br>
::<br>
echo. <br>
echo Launching Scribus...<br>
scribus.exe<br>
echo.<br>
::<br>
:: undo our temporary masks so we don't run Scribus in the
future<br>
:: forgetting that we have this special hack to replace the
Python<br>
:: interpreter shipped with it<br>
::<br>
if exist python.SUSPEND (<br>
echo restoring Scribus Python directory<br>
ren python.SUSPEND python<br>
)<br>
if exist python27.dll.SUSPEND (<br>
echo restoring Scribus library python.dll<br>
ren python27.dll.SUSPEND python27.dll<br>
)<br>
echo.<br>
::<br>
:: remind our user that we're cleaning up<br>
::<br>
pause<br>
</font></font><br>
<font size="2"><font face="Verdana">-------------------------------------------<br>
<br>
Before I go public with this on the Sribus Scripting wiki, I'd
like to see if there are any<br>
objections or problems with this approach.<br>
<br>
Opinions?<br>
</font></font>
<div class="moz-signature">
<p><font face="Verdana" size="2">
<br>
</font></p>
</div>
</body>
</html>