I have made some application with PyQt4, which contains os.system() start function in it as a button, which basically opens a csv file.
import sqlite3
import sys
import os
.......
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName(_fromUtf8("MainWindow"))
####
.............
####
# "CSV" button
self.pushButton_4 = QtGui.QPushButton(self.centralwidget)
self.pushButton_4.setObjectName(_fromUtf8("pushButton_4"))
self.horizontalLayout_2.addWidget(self.pushButton_4)
self.pushButton_4.clicked.connect(self.csv_button)
####
def csv_button(self):
import csv
conn = sqlite3.connect('FamilyFinance_test.db')
c=conn.cursor()
myrow_in = c.execute("select * from Income_test order by date desc")
with open('Income_test.csv', 'wb') as csvfile_in:
s_in = csv.writer(csvfile_in, delimiter=' ')
s_in.writerow(['Date']+['Income'])
for i in myrow_in:
s_in.writerow([str(i[0])]+[str(i[1])])
myrow_out = c.execute("select * from Outcome_test order by date desc")
with open('Outcome_test.csv', 'wb') as csvfile_out:
s_out = csv.writer(csvfile_out, delimiter=' ')
s_out.writerow(['Date']+['ATM']+['Spent']+['Reason']+['Category'])
for j in myrow_out:
s_out.writerow([str(j[0])]+[str(j[1])]+[str(j[2])]+[str(j[3])]+[str(j[4])])
os.system("start "+'Income_test.csv')
os.system("start "+'Outcome_test.csv')
Within python itself this function works fine, as well as with .exe created with py2exe. However, after successful creation of installer by InnoSetup and installing the application, i find that the very same button does not work.
Can someone give direction for resolving this problem?
Is there something to be done additionally with InnoSetup compiler?