Submitting form through python code

Hi,
I would like to open a form, set the values of certain fields and submit automatically through python code. Is there any way of doing this by a script? I know it can be done through an external method but is there any way of doing it from plone itself?

I don't want the user to see the form or have to interact with it.

Thanks

Why then do this through a form if the user is never supposed to see or interact with it? What is the form doing with the submitted data? Might as well have your script just send the email (for example), and don't bother creating or dealing with the form.

We are using authorize.net to process payments. A form with certain fields filled in have to be submitted to their script. I have the form created, I would like to set the values of the fields and submit the form programatically.

Use mechanize or a related tool to fill out a form ...or you analyze the request send to their
server and perform the HTTP request with the related data yourself using python + requests
module.

-aj

Maybe you can use PloneFormGem (it an add on), there are some scripts that you could edit (?)

this might help, too:
https://plone.org/products/ploneformgen/documentation-obsolete/how-to/creating-content-from-pfg

So really you need to send a get or post request with the form variables that authorize.net requires?
This can be done using the Python requests library. see: http://stackoverflow.com/questions/20759981/python-trying-to-post-form-using-requests