Skip to content

fix/output directory generation not working as expected. - #64

Closed
padam-ghimire wants to merge 1 commit into
moest-np:mainfrom
padam-ghimire:fix/39
Closed

fix/output directory generation not working as expected.#64
padam-ghimire wants to merge 1 commit into
moest-np:mainfrom
padam-ghimire:fix/39

Conversation

@padam-ghimire

@padam-ghimire padam-ghimire commented Apr 24, 2024

Copy link
Copy Markdown
Contributor

It appears that OUTPUT_DIR is the base directory, and you're trying to create two files within it. However, when you're specifying the file paths for writing, you're not directly referencing OUTPUT_DIR for the second file.

You're using args.output, which only contains the filename, not the full path. To ensure that both files are created within the OUTPUT_DIR, you should use os.path.join() to construct the full file paths

create_dir(OUTPUT_DIR) # Create the output directory if not exists
with open(os.path.join(OUTPUT_DIR, 'school-center-distance.tsv'), 'w', encoding='utf-8') as intermediate_file, \
open(os.path.join(OUTPUT_DIR, args.output), 'w', encoding='utf-8') as a_file:

This way, both files will be created within the OUTPUT_DIR, resolving the issue with the output directory generation.

@ashiishme

Copy link
Copy Markdown

There are already 2 more PRs (#45 & #54 ) resolving the same issue. You should collaborate with any of them to come with common solution.

@sumanashrestha

Copy link
Copy Markdown
Collaborator

thank you for you time on this. #45 has been merged for this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants