[scribus-dev] Windows - Replacing Shipped Python Interpreter

Joao S. O. Bueno gwidion at gmail.com
Sat May 30 19:52:09 UTC 2015


That is great - it could be made a documentation entry - or otherwise
be put in some visible web place.  This is the kind of thing that
could be easier to do for Windows users.

On 30 May 2015 at 12:05, John L. Poole <jlpoole56 at gmail.com> wrote:
> I wanted the ability to transact with postgreSQL from within Scribus
> and the Python Interpreter shipped with Scribus does not contain
> the postgreSQL module: psycopg2
>
> So, as I wrote earlier today, I hacked the Windows build to use
> my installed Python vs. that shipped with the build.
>
> Others may want to do the same, so I have created a Windows batch file
> that accomplishes the necessary substitutions.
>
> Here is the script:
> -------------------------------------------
>     @echo off
>     ::
>     :: special run of Scribus that uses Python installed on the
>     :: users system that matches the build of the Python interpreter
>     :: shipped with Scribus rather than the Python Interpreter shipped
>     :: with Scribus' build.
>     ::
>     :: See: http...wiki....[Windows Replacing Shipped Python Interpreter]
>     ::
>     echo.
>     echo Running Scribus ***without*** its shipped Python Interpreter
>     echo.
>     ::
>     :: Hide the shipped version of the Python interpreter so Scribus will
> use
>     :: the "same" version we have built on Windows
>     ::
>     if exist python (
>         echo masking Scribus Python directory
>         ren python python.SUSPEND
>     )
>     if exist python27.dll (
>         echo masking Scribus library python.dll
>         ren python27.dll python27.dll.SUSPEND
>     )
>     echo.
>     ::
>     :: point to our custom Python which should match the build of
>     :: Python shipped with this version of Scribus
>     :: See:
>     ::
>     PATH=C:\Python278;.
>     ::
>     ::   run it!
>     ::
>     echo.
>     echo Launching Scribus...
>     scribus.exe
>     echo.
>     ::
>     :: undo our temporary masks so we don't run Scribus in the future
>     :: forgetting that we have this special hack to replace the Python
>     :: interpreter shipped with it
>     ::
>     if exist python.SUSPEND (
>         echo restoring Scribus Python directory
>         ren python.SUSPEND python
>     )
>     if exist python27.dll.SUSPEND (
>         echo restoring Scribus library python.dll
>         ren python27.dll.SUSPEND python27.dll
>     )
>     echo.
>     ::
>     :: remind our user that we're cleaning up
>     ::
>     pause
>
> -------------------------------------------
>
> Before I go public with this on the Sribus Scripting wiki, I'd like to see
> if there are any
> objections or problems with this approach.
>
> Opinions?
>
>
>
> _______________________________________________
> scribus-dev mailing list
> scribus-dev at lists.scribus.net
> http://lists.scribus.net/mailman/listinfo/scribus-dev
>



More information about the scribus-dev mailing list