Source language: Translate to:

Any Python programmer overthere ?

General questions about NeoBook

Moderator: Neosoft Support

Any Python programmer overthere ?

Postby David de Argentina » Mon Aug 19, 2013 9:52 pm

Hi all,

I created a program that uses the Chromium WebBrowser component.
I created an instalation package for the common libraries of Chromium.
The purpose is, each time a NeoBook program needs this component, it will be available with only one download.
I had used the Inno Setup to do this installer.
The package install fine at %PROGRAMFILES%\Chromium Components Folder.
The PATH enviroment variable was updated with the new Folder.

Now, the problem.
The source code of the Chromium Component for NeoBook is written in Python.

Python program has this code:

Code: Select all
# CEF Python 3 example application.

# Checking whether python architecture and version are valid, otherwise an obfuscated error
# will be thrown when trying to load cefpython.pyd with a message "DLL load failed".
import platform
if platform.architecture()[0] != "32bit":
    raise Exception("Architecture not supported: %s" % platform.architecture()[0])

import os, sys
libcef_dll = os.path.join(os.path.dirname(os.path.abspath(__file__)),'libcef.dll')
# libcef_dll = 'libcef.dll'
if os.path.exists(libcef_dll):
   # Import the local module.
   if 0x02070000 <= sys.hexversion < 0x03000000:
       import cefpython_py27 as cefpython
   elif 0x03000000 <= sys.hexversion < 0x04000000:
       import cefpython_py32 as cefpython
   else:
       raise Exception("Unsupported python version: %s" % sys.version)
else:
   # Import the package.
   from cefpython3 import cefpython

import cefwindow
import win32con
import win32gui
import time
import json
import cefpython_py27


When i run this program, i get an error message telling program can't find some libraries

If I replace the Line:
libcef_dll = os.path.join(os.path.dirname(os.path.abspath(__file__)),'libcef.dll')
with
libcef_dll = 'libcef.dll'
Program attempts to load the "libcef.dll" from the program folder. if exists, program works fine. else, another error message tells can't find some libraries.

If i add the line:
sys.path[0:0] = "[ProgramFiles]\Chromium Components"
Program knows -exactly- where are located the libraries. But does not work.

Does any know how to normalize the path for load libraries, in order to make a "NeoBook program distribution", without the Chromium libraries, that could be installed from another installer ?

Thanks in advance,
David de Argentina
User avatar
David de Argentina
 
Posts: 1560
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Return to General NeoBook Discussions

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests

cron