1

I've read about using sqlalchemywithin the pylons framework.

How will things work if I need it for a simple script file?

I have like importer.py that is spidering a site and I want to save to mysql.

If things are in a single file, can I still using sqlalchemy?

How do I setup my model/mappings then?

1 Answer 1

3

If things are in a single file, can I still using sqlalchemy?

Yes, SQLAlchemy does not impose any restrictions on the way you use it.

You can see example on single-script initialization here: http://www.sqlalchemy.org/trac/attachment/ticket/1328/sqlalchemy-bug-query_Employee_company.py

Sign up to request clarification or add additional context in comments.

2 Comments

thanks, what does: #!/usr/bin/env python mean at the top of the file?
Its common unix way to run scripts, called 'shebang'. It tells shell to execute '/usr/bin/env with arg 'python'. env itself is a way to run different installations of python on same machine. You can read more on it here: virtualenv.openplans.org P.S. you can consider it as just equivalent of running python <scriptname> from command line.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.