J'utilise le script python webkit2png version 0.4 qui fonctionne très
bien quand on l'utilise en ligne de commande depuis le terminal de
Leopard.
Mon problème est que j'ai besoin de l'utiliser à partir de php et que
ça ne fonctionne pas.
Je fais un exec("/usr/bin/python /le_path_vers_webkit2png/
webkit2png.py /le_path_vers_le_fichier_html/fichier.html");
En retour j'ai "Cannot find pyobjc library files. Are you sure it is
installed?", ce qui signifie que l'interpréteur Python fait bien son
boulot,
mais que le script n'arrive pas à importer la librairie PyObjc.
Dans ce script python on à ce code pour importer les librairies :
import sys
try:
import Foundation
import WebKit
import AppKit
import objc
except ImportError:
print "Cannot find pyobjc library files. Are you sure it is
installed?"
sys.exit()
Le problème doit venir du fait que php et Apache ne connaissent pas
Foundation, Webkit etcŠ, il faudrait le path complet,
or quand je spécifie le path complet du genre /System/Library/
Frameworks/Foundation.framework/Versions/C/Resources/BridgeSupport/
Foundation.dylib,
Python me dit :
File "webkit2png.py", line 27
import /System/Library/Frameworks/Foundation.framework/Versions/C/
Resources/BridgeSupport/Foundation.dylib
^
SyntaxError: invalid syntax
Comment dire au script python d'importer les librairies par un path
complet ?
Merci.
Précédente
Suivante
diskutil et no space left on device
[Q] Comment désinstaller QuickTime?