Fixed issue with relative path

This commit is contained in:
LazoCoder 2017-06-06 12:31:24 -04:00
parent cdff8bd418
commit 392d4a119b
2 changed files with 3 additions and 3 deletions

View file

@ -1,5 +1,5 @@
tell application "iTerm"
tell current session of current window
set background image to "/Users/Laki/GitHub/Pokemon-Terminal/./Images/Generation IV - Sinnoh/390.png"
set background image to "/Users/Laki/GitHub/Pokemon-Terminal/./Images/Generation I - Kanto/004.png"
end tell
end tell

View file

@ -170,8 +170,8 @@ class Database:
def __load_data(self):
# Load all the Pokemon data. This does not include the 'Extra' Pokemon.
path = self.directory + "/./Data/pokemon.txt"
data_file = open(path, "r+")
path = "/./Data/pokemon.txt"
data_file = open(os.get_exec_path()[0] + path, 'r')
for line in data_file: # Load everything but the Pokemon from the 'Extra' folder.
identifier = line.split(' ')[0] # First part of the line is the id.
name = line[len(identifier)+1:-1].lower() # The rest is the name (minus the new line at the end).