I had been contacted with a friend a couple of days ago - that has hardly any programming experience, and that he includes a project he requested outside assistance with.
Essentially - this is exactly what he's trying to complete:
1.) Create a website that can accept text files as input. 2.) Read said file and pass the parameters contained in the file to a python script. 3.) Output these results of the script on the same webpage upon completion.
They know a tiny bit of Python (enough to create the processing script), but he's no clue what to do came from here. I designed a quick example for him utilizing an ASP page that read inside a file, and used IronPython to pass through the parameters right into a script file and output the outcomes, which labored just like I'd expected it.
However - for him I had been wishing to steer him within the right direction of creating a easier application to do this and was wishing to locate a few recommendations or hear some ideas on different approaches. I figure because of his lack of skill the more, the greater.
Thanks men.
Flask is dead-simple, very effective, and intuitive. I favor it over Django for more compact projects, as Django uses way a lot of folders (just stick to the introduction tutorial). Here's what i'm saying by easy and intuitive. I can not really explain it in words, so here's a good example script:
File:
script.py
app = Flask(__name__) app.config.from_object(__name__) @app.route('/') def index(): return render_template('index.html', message = 'Hello') if __name__ == '__main__': app.run(host = '0.0.0.0')
File:
index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""> <html xmlns="" xml: <head> <title>Test</title> </head> <body> {% if message != 'nope' %} {{ message }} {% endif %} </body> </html>
Just my ideas, so great luck.
Maybe he look into Flask? Quite simple web-framework in Python for fast creation a little web-site.
In case your friend really wants to go together very rapidly and simply and does not cash programming experience, I believe his best choice could be web2py. It takes no installation or configuration, doesn't have dependencies, and features a web server, a relational database, along with a web-based integrated development atmosphere and admin interface (demo).
It's very easy to learn and was created for ease of use and developer productivity. You can aquire a lot completed with hardly any code because of the incorporated scaffold application together with many sensible default actions. When the application will get more complicated, web2py are designed for it, because it is a properly-integrated full-stack framework with a lot of built-in functionality, together with a database abstraction layer, form handling and validation, access control, web services, and simple Ajax integration.
If he needs help getting began or has any queries, he'll get plenty of the aid of the friendly and responsive mailing list.
Here's the entire working web2py same as @Blender's Flask application (though this version adds a pleasant default layout having a menu in addition to internationalization support to translate the 'Hello' message):
File:
default.py
def index(): return dict(message=T('Hello'))
File:
index.html
{{extend 'layout.html' # optional}} {{if message != 'nope':}} {{=message}} {{pass}}