Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export solution pdf #16

Merged
merged 3 commits into from
Sep 8, 2022
Merged

Export solution pdf #16

merged 3 commits into from
Sep 8, 2022

Conversation

joshbduncan
Copy link
Owner

Additional functionality in response to issues #14 and #15.

Added

  • You can now export the puzzle solution along with the puzzle using the save() method. Just specify solution=True after the path.
    • If you are exporting a PDF then a second page will be added with the puzzled words highlighted in red (just like the show(solution=True) method)
    • If you are exporting to CSV the puzzle solution will be included at the bottom of the csv below the answer key.

Changed

  • save() method now accepts the solution argument.
  • -c, --cheat cli option now works with the -o, --output option to include the puzzle solution within the output file (csv or pdf)
  • To clean things up a bit, export_pdf_file() and export_csv_file() now accept a WordSearch object as the main argument.

@ALEXDINO7
Copy link

Thanks for the update but still not working when i added solution=True i get the bellow error

puzzle.save(path="./puzzle.pdf",solution=True)
TypeError: WordSearch.save() got an unexpected keyword argument 'solution'

@joshbduncan
Copy link
Owner Author

Yeah, I haven't merged the new feature code and released a new version yet... So if you installed it using pip you would get that error. I just wanted to get your feedback on the attached pdf to see if that is the result you were looking for before I released the new version.

@joshbduncan
Copy link
Owner Author

@ALEXDINO7 you can install the new program for testing on your system using the command below. This will install the latest code from the export-solution-pdf branch that is tied to this PR.

# if you are not using a virtual environment
pip install --user git+https://github.com/joshbduncan/word-search-generator.git@export-solution-pdf

# if you are using a virtual environment
pip install git+https://github.com/joshbduncan/word-search-generator.git@export-solution-pdf

@ALEXDINO7
Copy link

@ALEXDINO7 you can install the new program for testing on your system using the command below. This will install the latest code from the export-solution-pdf branch that is tied to this PR.

# if you are not using a virtual environment
pip install --user git+https://github.com/joshbduncan/word-search-generator.git@export-solution-pdf

# if you are using a virtual environment
pip install git+https://github.com/joshbduncan/word-search-generator.git@export-solution-pdf

wooow it's working now you are the best

@joshbduncan joshbduncan merged commit e70b6a4 into main Sep 8, 2022
@joshbduncan joshbduncan deleted the export-solution-pdf branch September 8, 2022 21:05
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.

Hi anyone knows how we can save the solution as a pdf file? how to save solution as pdf ???
2 participants