| | |
Python - automatic webpage creation
Please support our HTML and CSS advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Sep 2009
Posts: 3
Reputation:
Solved Threads: 0
Hi,
I have a minor website that I wish to maintain that I do for gratis (for free). It is for a school. I wish to be able to automate the task of adding links and photos and text body. I already use a css template to maintain the look and feel of the site but would like to go that one step closer to adding automation. I have the concept but do not know how to go from concept to actually programming what I would like to do with python. I have written very basic python and perl code.
I need direction.
Here are my thoughts at what I wish to achieve.
I have already created the basic folder structure for easy of keeping things clean and orderly.
Name of folder - within that -pdf folder - image folder - doc folder.
What I wish to be able to do is have files within these folders. That can be read by a python script.
Firstly to create links to documents or pdfs or photos secondly to grab the text body out of a text file and place it into the html document. Sounds easy. Well I have popped a blood vessel and would like some advise. I know that there are cms systems out there that could do this but the site on which this webpage site is housed will not allow for this interaction. Any suggestions.
I have a minor website that I wish to maintain that I do for gratis (for free). It is for a school. I wish to be able to automate the task of adding links and photos and text body. I already use a css template to maintain the look and feel of the site but would like to go that one step closer to adding automation. I have the concept but do not know how to go from concept to actually programming what I would like to do with python. I have written very basic python and perl code.
I need direction.
Here are my thoughts at what I wish to achieve.
I have already created the basic folder structure for easy of keeping things clean and orderly.
Name of folder - within that -pdf folder - image folder - doc folder.
What I wish to be able to do is have files within these folders. That can be read by a python script.
Firstly to create links to documents or pdfs or photos secondly to grab the text body out of a text file and place it into the html document. Sounds easy. Well I have popped a blood vessel and would like some advise. I know that there are cms systems out there that could do this but the site on which this webpage site is housed will not allow for this interaction. Any suggestions.
•
•
Join Date: Jul 2008
Posts: 101
Reputation:
Solved Threads: 9
•
•
•
•
Hi,
Name of folder - within that -pdf folder - image folder - doc folder.
What I wish to be able to do is have files within these folders. That can be read by a python script.
include <name of text file>;
In one of my sites I let the script search directories and display the filenames of that directory. The user can select which one he wants to see or download.
By adding new directories, even in several levels, it's possible to add nearly anything dynamically, with no code changes.
Yes, I'm running Ubuntu. Of course.
in python you could use the open method, to write a basic framework you could write:
You would need to use different inputs and editors for extras, but the admins should really move this to the python forum.
python Syntax (Toggle Plain Text)
new_page = open("name.html", "w")#change 'name' to whatever you want/input and you could use "a" to add to the page framework = """ <html> <head><title>basic framework</title></head>#add in any extra <body> <p> This is some text </p> </body> </html> """ new_page.write(framework)
don't judge me because I'm a year 8!
'it is better to fight for something than to live for nothing'General George S Patton
'it is better to fight for something than to live for nothing'General George S Patton
![]() |
Similar Threads
- how do i go onto a new line in python (Python)
- Why should i learn Python? (Python)
- Running Python Code in a Webpage (Python)
- Python automatic date? (Python)
- Automatic Files Sorting and Folders Creation (VB.NET)
- Automatic email creation in cpanel ----PHP (PHP)
Other Threads in the HTML and CSS Forum
- Previous Thread: Date and time format on website
- Next Thread: A couple begginer questions
| Thread Tools | Search this Thread |
Tag cloud for HTML and CSS
appointments asp background backgroundcolor beta browser bug calendar cart cgi code codeinjection corporateidentity css design development displayimageinsteadofflash dreamweaver emailmarketing epilepsy explorer firefox flash font fonts form format google griefers hackers hitcounter hover html ide ie7 ie8 iframe image images internet internetexplorer intranet iphone javascript jpeg layout macbook maps marketshare microsoft mozilla multimedia navigationbars news offshoreoutsourcingcompany opacity opera optimization perl pnginie6 positioning problem scroll seo shopping studio swf swf. textcolor timecolor titletags url urlseparatedwords visual visualization web webdevelopment webform website windows7 xml xsl





