Seite 1 von 1
Python C API .h und example zum 2.4.1
Verfasst: Dienstag 14. Juni 2005, 07:51
von tiberg
Hoi
Ich bin Sven-Erik Tiberg, neu am dieser forum ( und python ), wohnt in Lulea nordschwede.
Hab eine frage: Fersucht eine Python API .dll zu machen aus die C++ lib von
www.CHAI3D.org, und laut "Extendiong and Embedding the Phyhon Interpreter"
brauch man example*.* und .h filen unter \PC\example_nt\
und python.h mit kompl *.h filen.
Who zum finden? Installationspaket ( WINXP) ? kompl. dateie?
-- BG --
Sven-Erik Tiberg
Verfasst: Dienstag 14. Juni 2005, 09:15
von CM
Hoi Sven-Erik,
Herzlich Willkommen im Forum.
Ich nehme mal an Du möchtest die Antworten auf Deutsch, sonst hättest Du wohl in einem anderen Forum gefragt, deshalb schreibe ich mal auf Deutsch. Wenn Du wirklich erst mit jetzt mit Python anfängst, hast Du Dir eine sehr schwierige Aufgabe für den Anfang ausgesucht!
Lies einfach nochmal das Kapitel "Extending and Embedding the Python Interpreter" durch. Dort gibt es auch das Kapitel "Building C and C++ Extensions on Windows". Für einen Anfänger ist das allerdings sehr schwer zu verstehen.
Python.h findest Du in dem Quellcode für Python. Ob Dir der Windowsinstaller das auch irgendwo hinlegt weiß ich nicht. Weiß jemand anderer da Bescheid?
Gruss,
Christian
PS However, in case you aren't aware of the English mailing list, here is the URL to subscribe to it:
http://mail.python.org/mailman/listinfo/tutor
Don't try the English Forum - as you can see the traffic there is rather low and people hardly use it.
Verfasst: Dienstag 14. Juni 2005, 13:14
von tiberg
Hoi CM
Danke fur dein tips, hat die Quellcode untergeladet und es scheint komplett mit example_nt und .h lib.
Abends gehts weiter.
Bin nicht genau ein anfänger
Bleibt gern an diser forum, statt die englishe wegen mehr aktivitet.
-- BG --
Sven-Erik
Verfasst: Dienstag 14. Juni 2005, 15:08
von Leonidas
CM hat geschrieben:Python.h findest Du in dem Quellcode für Python. Ob Dir der Windowsinstaller das auch irgendwo hinlegt weiß ich nicht. Weiß jemand anderer da Bescheid?
Ja, bei mir liegt Python.h in Python Ordner und ich kann mich nicht erinnern das von Hand dorthin kopiert zu haben, also muss es wohl dorthin installiert worden sein.
Verfasst: Dienstag 14. Juni 2005, 20:31
von tiberg
Es klappt.
Meine setup: WinXP mit MS VS.net
Source in C:\Python24\source\Python-2.4.1\
python installation: C:\Python24
Solution pack: example im : C:\Python24\source\Python-2.4.1\PC\example_nt\example.sln
Öffnet example.sln in MS VS.net
Im MS VS.net > Tools > Options > Projects > C++ Directories >
Select "Include files" und addieren "C:\Python24\include" schob nach unten und "Library Files" addieren "C:\Python24\libs" und schob nach unten.
Dann "wählt "release" und "Build" > "Build solution"
NB: vergleicht die beide \include\ folder innhalt mit windiff.exe, und pyconfig.h fehl in source\ sonst nur unterschied in "blanks".
Gehts weiter mit eine *.py test von example.dll.
-- BG --
Sven-Erik
Verfasst: Montag 20. Juni 2005, 12:15
von tiberg
Just a second Q.
Any hints on how to set up a project in MSVS.net to form a .dll.
-- BG --
Sven-Erik
Verfasst: Montag 20. Juni 2005, 23:34
von querdenker
just another answer:
Normally you'll create a new project with file>>new>>project when you are using the studio. In the assistant you have the choice of language and target.
mfg, querdenker