Last active
October 10, 2020 12:51
-
-
Save lebalz/a84af116415d0197a7ed048af8714bed to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def save(self, savefile): | |
"""Do the TTS API request and write result to file. | |
Args: | |
savefile (string): The path and file name to save the ``mp3`` to. | |
Raises: | |
:class:`gTTSError`: When there's an error with the API request. | |
""" | |
from pathlib import Path | |
savefile = Path(savefile) | |
savefile = str(Path(get_ipython().home_dir, savefile.name)) | |
with open(str(savefile), 'wb') as f: | |
self.write_to_fp(f) | |
log.debug("Saved to %s", savefile) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
used to make sure a user is writing to it's own user space within jupyterhub...
locate the path of tts.py with