I'm having the following trouble with my program:
File "C:/Users/6ixpage/Documents/SoftwareDevelopment/Python/Programs/CLI/
PrintandCopy/P&C Job System.py", line 75, in set
eval('self.details['+a+'].'+b+'"'+c+'"');
File "<string>", line 1
self.details[0].file = "image"
^
SyntaxError: invalid syntax
Here's the code snippet for reference:
IN = ('details','0','file','image')
if IN[0] == 'details':
a = IN[1]
b = IN[2]
c = IN[3]
print('self.details['+a+'].'+b+' = "'+c+'"');
eval('self.details['+a+'].'+b+' = "'+c+'"');
IN[0]
- used to identify that the command specifies the details of the folder. *IN[1]
- the task within the folder. *IN[2]
- the attribute of the task (any of type, file, quantity, tally). *IN[3]
- the value to set the attribute to.
The entire code is here, unfortunately undocumented as I originally wanted to only have a simple CUI setup. But do quiz me if you have any questions about particular snippets. I have paper documentation too, that shows how the program is supposed to work.
If you can suggest some changes to how the CUI works please do, especially if they will cause less headaches than the one I currently have. (And I'm certain that I don't have to use eval()
for every single function.)