Skip to content

Commit 37bc24c

Browse files
author
David
committed
add absolute paths to file names
1 parent 9cf3e28 commit 37bc24c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

colortest.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/home/david/projects/python_colors/bin/python3
1+
#!/Users/davidaccomazzo/Projects/python_colors/bin/python
22
""" Resources
33
* https://www.lihaoyi.com/post/BuildyourownCommandLinewithANSIescapecodes.html
44
* Good resource on how to manipulate terminal commands with Python
@@ -24,6 +24,7 @@
2424
import argparse
2525
import time
2626
import json
27+
import os
2728

2829
from colormath.color_objects import sRGBColor, LabColor
2930
from colormath.color_conversions import convert_color
@@ -122,7 +123,7 @@ def allForegroundAndAllBackground():
122123

123124
# Create a map of all ANSI colors and their conversions to different formats
124125
def _getColorMap():
125-
f = open("colors.json")
126+
f = open(os.path.dirname(os.path.realpath(__file__)) + "/colors.json")
126127
data = json.load(f)
127128
# Map the ANSI code to actual color dict
128129
colorsDict = {}

0 commit comments

Comments
 (0)