Python Forum
Browse and build a list of folder paths using recursion
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Browse and build a list of folder paths using recursion
#3
(Apr-21-2021, 08:43 AM)ibreeden Wrote: In line 17 you do a recursive call to "BrowseServer(server,nodeId)" but you do nothing with the result of that call.
Should this perhaps have to be:
path_list += BrowseServer(server,nodeId)
?

I noticed that and updated the code, but I'm still in the same situation as far as getting the format right take a look at the image:

1. You can see the OPC browse pane towards the left and the folders that I'm retrieving.
2. You can also see the code and output from the code towards the far right.

The output from code gets all the folders and the children under those folders but the issue as said before is formatting that I can't seem to get right?
In the image you can see I highlighted a set of paths based on the folder structure in the OPC browse pane. The code gets to those children folders and outputs them together to show that it went in/out of each folder.
The format for what I highlighted in blue should be:

["Loytec ROOT\BACnet Port\Datapoints\CVS-B230A","Loytec ROOT\BACnet Port\Datapoints\CVS-C220A","Loytec ROOT\BACnet Port\Datapoints\CVS-C220B"]

[Image: uk2Sb.png]
Reply


Messages In This Thread
RE: Browse and build a list of folder paths using recursion - by Ultrainstinct_5 - Apr-21-2021, 03:30 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Compare folder A and subfolder B and display files that are in folder A but not in su Melcu54 3 730 Jan-05-2024, 05:16 PM
Last Post: Pedroski55
Question Keyword to build list from list of objects? pfdjhfuys 3 1,735 Aug-06-2022, 11:39 PM
Last Post: Pedroski55
  python-docx regex : Browse the found words in turn from top to bottom Tmagpy 0 1,625 Jun-27-2022, 08:45 AM
Last Post: Tmagpy
  pdf2image, poppler and paths jehoshua 18 16,068 Jun-14-2022, 06:38 AM
Last Post: jehoshua
  Windows paths issue otalado 3 1,574 May-29-2022, 09:11 AM
Last Post: snippsat
  Compare filename with folder name and copy matching files into a particular folder shantanu97 2 4,724 Dec-18-2021, 09:32 PM
Last Post: Larz60+
  Move file from one folder to another folder with timestamp added end of file shantanu97 0 2,581 Mar-22-2021, 10:59 AM
Last Post: shantanu97
  automatically get absolute paths oclmedyb 1 2,231 Mar-11-2021, 04:31 PM
Last Post: deanhystad
  Using recursion instead of for loops / list comprehension Drone4four 4 3,300 Oct-10-2020, 05:53 AM
Last Post: ndc85430
  chkFile with absolute paths JarredAwesome 7 3,153 Sep-21-2020, 03:51 AM
Last Post: bowlofred

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020