Skip to content

Commit b52f309

Browse files
author
effy
committed
modified path var in task 0000 and task 0004
1 parent db85d81 commit b52f309

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

effy/0000/pillow_chesnut.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
>___,<
99
'''
1010
from PIL import Image, ImageDraw
11+
import os
1112
# open the base pic
12-
minion = Image.open("Your_Working_Directory_Path/python/effy/0000/zizi.gif").convert('RGBA')
13+
minion = Image.open(os.path.join(os.path.dirname(os.path.abspath(__file__)),"zizi.gif")).convert('RGBA')
1314
# new a transparent canvas for the annoying number :)
1415
annoying = Image.new('RGBA', minion.size, (255, 255, 255, 0))
1516
# get the drawing context , note that ImageDraw is the actionable module that will CREATE canvas on the base pic

effy/0004/0004_bad.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
it won't split abbrevations, like "I'd", nor it won't split words
77
concatenated with underscore, like "bad_game"
88
'''
9+
import os
910
import re
1011
def word_count(file_path):
1112
word_dict = {}
@@ -22,7 +23,7 @@ def word_count(file_path):
2223
word_dict[word] = word_dict.get(word,0) + 1
2324
return word_dict
2425

25-
result = word_count("Your_Working_Directory_Path/python/effy/0004/readme.txt")
26+
result = word_count(os.path.join(os.path.dirname(os.path.abspath(__file__)), "sampletext.txt"))
2627

2728
###################################################################################
2829

0 commit comments

Comments
 (0)