JerBouma / ThePassiveInvestor

Passive Investing for the Average Joe
https://www.jeroenbouma.com/
MIT License
538 stars 68 forks source link

update gitignore and guide to build app #3

Closed NWylynko closed 4 years ago

NWylynko commented 4 years ago

.DS_store is an auto generated file by MacOs that shouldn't be commited, .vs_code is a generated folder that is created when a dev changes a setting with visual studio code so its only local to that dev and shouldn't be commited because it will effect other devs environments in annoying ways.

added infomation to help devs who arent familiar with how to build the app.

NWylynko commented 4 years ago

third commit e3a2814 adds a function that returns the directory that the program is running in so the image can be open. This is needed on macos because a .app is just a folder and the directory its run from is not the same directory the program is run from. So it crashes on launch because it cant open the image. this fixes it by using sys._MEIPASS which only works when getting run my the pyinstaller app. it needs to be in a try except because it will fail when the program.py file is run for development, so it fails over to local directory which is what it should be.

JerBouma commented 4 years ago

third commit e3a2814 adds a function that returns the directory that the program is running in so the image can be open. This is needed on macos because a .app is just a folder and the directory its run from is not the same directory the program is run from. So it crashes on launch because it cant open the image. this fixes it by using sys._MEIPASS which only works when getting run my the pyinstaller app. it needs to be in a try except because it will fail when the program.py file is run for development, so it fails over to local directory which is what it should be.

I currently have it set up to copy over the images folder to the application. Therefore the path images/ThePassiveInvestorPNG.png can still be used. Is this what you were trying to fix with this commit? As the .exe does not seem to crash for me with the current set-up.

NWylynko commented 4 years ago

I currently have it set up to copy over the images folder to the application. Therefore the path images/ThePassiveInvestorPNG.png can still be used. Is this what you were trying to fix with this commit? As the .exe does not seem to crash for me with the current set-up.

I'm building and running it on MacOs and the app will crash if this fix isn't used, it won't effect the windows version from what i can tell but you should probs test it to double check.

JerBouma commented 4 years ago

Added, and slightly adjusting, much of what you added. Thank you for that. I do have a few questions though:

  1. ~Why include the xlrd import while it is not being used within the program?~ EDIT: It is required for pd.read_excel, that's unfortunate but I understand now.
  2. Is there a specific reason you list starting the program with this command? start dist\ThePassiveInvestor.exe. I ask this because there is a subfolder created within the dist folder named 'ThePassiveInvestor'. Therefore you have to write start dist\ThePassiveInvestor\ThePassiveInvestor.exe.
  3. Is this the same for Mac?