emiliobrazil / portfolio_analysis

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.
Apache License 2.0
0 stars 1 forks source link

change save files portfolio management #17

Closed henriqueassis2003 closed 10 months ago

henriqueassis2003 commented 10 months ago

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