The "PythonPortfolioAnalyzer" is a Git repository that forms a vital part of the final project for the "Programming 2" course. This project aims to develop a Python application that empowers users to calculate the risk and return of a stock portfolio, making it an essential tool for investors and financial analysts.
change
def save(self, path: str = '.') -> str: complete_path = path + os.sep + self.name + 'jprt' with open(complete_path, 'w') as outfile: Jportfolio = { 'name': self.name, 'version': self.version, 'portfolio':self.portfolio } json_object = json.dumps(Jportfolio, indent=4) outfile.write(json_object) return complete_path
to:
def save(self, path: str = '.') -> str: complete_path = path with open(complete_path, 'w') as outfile: Jportfolio = { 'name': self.name, 'version': self.version, 'portfolio':self.portfolio } json_object = json.dumps(Jportfolio, indent=4) outfile.write(json_object) return complete_path
tkinter will return the complete path, if you use the tkinter complete path with filename and jprt concatenation will fail the aplication