file_name = 'test'
print('Uploading file ' + file_name + '...')
body = {'name': file_name, 'mimeType': 'application/vnd.google-apps.document'}
media = MediaFileUpload('test.html', mimetype='text/html')
fiahl = drive_api.files().create(body=body, media_body=media).execute()
print("Created file '%s' id '%s'." % (fiahl.get('name'), fiahl.get('id')))
Looking for example using MediaFileUpload