Skip to content

Files

In py4pd, sometimes you need to save something in the patch folder (as audio files), or save something temporally, or other things. In this section, we present some helpers to get the correct pathname that can be useful.

pd.get_patch_dir

  • Example

    Returns pathname of the current patch folder.

    import pd
    
    def getPatchDir():
        return pd.get_patch_dir()
    
  • Arguments

    There is no args for this function.


pd.get_temp_dir

  • Example

    pd.get_temp_dir returns a pathname for a temp-folder, all files inside this folder are deleted when the PureData patch is closed or when all the py4pd objects are deleted.

    import pd
    
    def getTempDir():
        return pd.get_temp_dir()
    
  • Arguments

    There is no args for this function.


pd.get_py4pd_dir

  • Example

    Returns the folder where the binary of py4pd is located.

    import pd
    
    def getPy4pdDir():
        return pd.get_py4pd_dir()
    
  • Arguments

    There is no args for this function.

pd.get_pd_search_paths

  • Example

    pd.get_pd_search_paths returns all the folders in the PureData search path.

    import pd
    
    def getPdSearchPaths():
        return pd.get_pd_search_paths()
    
  • Arguments

    There is no args for this function.