is there any way through which I could create a Visual Studio Project, add files to it
Whilst there is a .NET API for creating/manipulating project files, it's a bit on the undocumented side (I have used it in the past though) and I don't know if you can call it from Python. If you want to see the .NET API just look at the IronPython Custom Project Extension project.
However, VS project files are just XML files so if you know the schema, you can just write to the files from Python using your API of choice. VS won't know any better.
and build it from within the python program
Ultimately you can just spawn a process to invoke msbuild
. Works for Jenkins.