python - Explanation of pysftp.Connection.walktree() parameters -


I've just started using Python of Python and I'm confused about how to do this Walktree function

I have found some code (found) that helps me better understand how my parameters look like

  Def walktree (self, remotepath, fcallback, dcallback, ucallback, recurse = True): '' 'recursive down, depth first, directory tree contained in RemotePep, each regular file, Call for thoughtful callback function for directory and unknown file type. : Param str remotepath: The route of the remote directory to descend, '.' To get started: Atri: `.pwd`: Ultimate Liable Fiscalback: Callback function to call for a regular file. (Form: `` Funk (ARR) ``): The most cost-effective DC-lock: Callback function to call for a directory. (Form: `` Funk (ARR) ``): Absolute cornerable ucallback: callback function to call for an unknown file type. (Form: `` Funk (ARR) ``): Ultimate Balls Recurs: * Default: True * - It should be Recored: Returns: None  

But I'm still absolutely wrong "I mean using a callback function for a regular file, for a directory, and for an unknown file type.

I have also seen through official documents:

< P> But it all tells me that the walktree () function is that:

What is a powerful method that is a recurring ( default ) A Remote directory structure and callback functions provided by the user for each file, directory or unknown entity It is used in the methods of get_x pysftp and it can be used with great effect, each callback is given the path name of the unit. (Form: Func (str) )

Which I felt did not give me much information about how to call it properly.

If someone can provide an example of calling this function properly and you have chosen your chosen logic Explanation of why people are passing, it will be greatly appreciated!

As walktree returns the directory structure, it For each file-system object, one of those functions "calls back" finds the object that is found as a path (string) argument.

Usually, you will need some state (reference) for implementing implementation ie i.e. In order to avoid using a reference to container to contain the found routes, you can refer to the pysftp sample, state ( flist , dlist , flv} to avoid using global variables Code>, and ulist container) in the object instance.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -