Passing arguments to Blender Script from PyQt I am new to Blender Programming,I am using PyQt for my GUI,
i want to pass my two arguments(which i am getting from the UI) to the Blender script, i am using Python2.7 with PyQt4 and Blender 2.79

self.sourceFile = self.sourceLineEdit.text()
self.destinationPath = self.desigLineEdit.text()
sourceFiles = str(self.sourceFile)
print sourceFiles
subprocess.Popen(['C:/Program Files/Blender Foundation/Blender/blender.exe', "--python-expr", "import blender_import_export; blender_import_export.importExport("+self.sourceFile,self.destinationPath+");" ], shell=True)


My blender_import_export.py file below...

import bpy

def importExport(path1,path2):
    print path
    full_path_to_file = path1
    bpy.ops.import_scene.dxf(filepath=full_path_to_file)
    bpy.ops.export_scene.obj(filepath=path2+"/my.obj", check_existing=True, axis_forward='-Z', axis_up='Y', filter_glob="*.obj;*.mtl", use_selection=False, use_animation=False, use_mesh_modifiers=True, use_edges=True, use_smooth_groups=False, use_smooth_groups_bitflags=False, use_normals=True, use_uvs=True, use_materials=True, use_triangles=False, use_nurbs=False, use_vertex_groups=False, use_blen_objects=True, group_by_object=False, group_by_material=False, keep_vertex_order=False, global_scale=1, path_mode='AUTO')


If i run this, its showing the below error.How to fix this.


  File "", line 1
      import blender_import_export blender_import_export.importExport(D:/Blender/test.dxf)
                                                       ^ SyntaxError: invalid syntax location: :-1 location: :-1
Your mistake is a simple python error. 

blender_import_export.importExport("+self.sourceFile,self.destinationPath+");" 


if you look closely, you will see that that will output blender_import_export.importExport(D:/Blender/test.dxf) as shown in the error output. The issue is there are no quotes surrounding the file path, which should be a string, to fix, simply change:

blender_import_export.importExport("+self.sourceFile,self.destinationPath+");" 


to 

blender_import_export.importExport(\""+self.sourceFile,self.destinationPath+"\");"