|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
1200+ fellow developers rate and compare features of the top IDEs, like Visual Studio, Eclipse, RAD, Delphi and others, across 13 categories. Enjoy this FREE Download of the IDE User Satisfaction Study by Evans Data Corporation. Download Now!
|
|
#1
|
|||
|
|||
|
Python: The 'Include' feature
Hello,
I just want to know whether or not Python can 'include' HTML or scripts like PHP. I know the PHP script to include is: <?php include(" SOMETHING HERE "); ?> but I don't know what is the include script for Python. Does anyone know anything about it? Does Python even have this feature? If not, does Zope have it? Any help would be very nice. Thanks! Ye Tan ![]() |
|
#2
|
|||
|
|||
|
you can check out Spyce at http://spyce.sourceforge.net/
Spyce let's you insert python in your Python documents to generate dynamic content just like PHP does. It has an include module which should do what you want. |
|
#3
|
|||
|
|||
|
thanks jimmy2k1,
But Spyce requires installation. I want the Python 'include' feature. Do you have any other suggestions? |
|
#4
|
||||
|
||||
|
Why not just use the 'import' statement?
|
|
#5
|
|||
|
|||
|
Quote:
I'm pretty sure the import statement isn't quite the same as a preprocessor style inclusion. Zope does have support for this sort of thing, but unfortunately, I don't remember the syntax for it. But setting up zope is even harder than setting up Spyce. Spyce is one answer, as is Webware for Python. One of those two seems to be the easiest route to get where you are going. |
|
#6
|
||||
|
||||
|
But he wants to know if Python can include files like PHP does... Which is exactly what import is. You can include other Python files you create with the import statement. I don't think he needs anything preprocessed.
|
|
#7
|
|||
|
|||
|
Quote:
No, that seems to be the problem - he doesn't want to include other Python files. He wants to include HTML. Which would end up trying to be parsed by the interpreter when the script is called. Which would, of course, be bad. |
|
#8
|
||||
|
||||
|
Oh, I see.... Kind of misinterpreted the post. Sorry 'bout that.
What part of Houston you from? I am originally from Sugar Land. ![]() |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > Python: The 'Include' feature |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|