You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If any directories in the specified path do not exist, setting ``mkdir=True`` will create them. For example, to specify a data directory named ``"data"`` within the ``"pyhelpers_tutorial"`` folder:
@@ -223,7 +223,7 @@ If any directories in the specified path do not exist, setting ``mkdir=True`` wi
223
223
>>> data_dir = cd(dir_name, "data") # equivalent to `cd(path_to_dir, "data")`
224
224
>>># Relative path of the data directory
225
225
>>> rel_data_dir = os.path.relpath(data_dir)
226
-
>>>print(rel_data_dir)
226
+
>>>print(rel_data_dir)# (on Windows)
227
227
pyhelpers_tutorial\data
228
228
229
229
We can then use the :func:`~pyhelpers.dirs.is_dir` function to check if ``data_dir`` (or ``rel_data_dir``) is a directory:
@@ -250,7 +250,7 @@ For another example, to specify a path to a Pickle file, named ``"dat.pkl"``, in
Saving "python-logo.png" to "./pyhelpers_tutorial/images/"... Done.
485
486
486
487
.. note::
487
488
488
-
- *'10.8MB/s'* shown at the end of the output is an estimated speed of downloading the file, which varies depending on network conditions at the time of running the function.
489
+
- *'403kB/s'* shown at the end of the output is an estimated speed of downloading the file, which varies depending on network conditions at the time of running the function.
489
490
- Setting ``if_exists='replace'`` (default) allows us to replace the image file that already exists at the specified destination.
490
491
491
492
Now let's have a look at the downloaded image file using `Pillow`_:
@@ -512,7 +513,7 @@ To delete ``"pyhelpers_tutorial\"`` and its subdirectories (including ``"pyhelpe
Setting the parameter ``confirmation_required=False`` can allow us to delete the directory straightaway without typing a ``yes`` to confirm the action. The confirmation prompt is actually implemented through the :func:`~pyhelpers.ops.confirmed` function, which is also from the :mod:`pyhelpers.ops` module and can be helpful especially when we'd like to impose a manual confirmation before proceeding with certain actions. For example:
0 commit comments