Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
function call in recursion
#3
Since I have not received any response. I tried in the below way. The code looks good to me but it is running into infinite loop in the for loop is for repo_temp in rps_temp: so the function call running into infinite loop. where I am making mistake in the below code.

path="/home/"
url = "<url>"
nme = {'xmlns' : url}
def find( repo, dep ):
    pom=path+repo+"/pom.xml"
    if not os.path.exists(pom):
        return
    tree = ElementTree.parse(pom)
 
    root = tree.getroot()
    deps = root.findall(".//xmlns:dependent", nme=nme)
    for d in deps:
        aid = d.find("xmlns:aid", nme=nme)
        vsn    = d.find("xmlns:vsn", nme=nme)
        if dep == aid.text:
            print repo + " : " + vsn.text
            rps_temp=os.walk(path).next()[1]
            temp = repo
            for repo_temp in rps_temp:
                dep_check(repo_temp, temp)
    return
print "\ndependecy:\n"
rps=os.walk(path).next()[1]
for repo in rps:
    find(repo, dep)
print "\n"
Reply


Messages In This Thread
function call in recursion - by moong - Feb-16-2019, 04:34 PM
RE: function call in recursion - by moong - Feb-17-2019, 01:29 AM
RE: function call in recursion - by moong - Feb-17-2019, 09:48 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How do I call sys.argv list inside a function, from the CLI? billykid999 3 863 May-02-2023, 08:40 AM
Last Post: Gribouillis
  how to call an object in another function in Maya bstout 0 2,127 Apr-05-2021, 07:12 PM
Last Post: bstout
  In this function y initially has no value, but a call to foo() gives no error. Why? Pedroski55 8 3,601 Dec-19-2020, 07:30 AM
Last Post: ndc85430
  Struggling for the past hour to define function and call it back godlyredwall 2 2,287 Oct-29-2020, 02:45 PM
Last Post: deanhystad
  list call problem in generator function using iteration and recursive calls postta 1 1,993 Oct-24-2020, 09:33 PM
Last Post: bowlofred
  function call at defined system time? Holon 5 3,302 Oct-06-2020, 03:58 PM
Last Post: snippsat
  How to call/read function for all elements in my list in python johnny_sav1992 1 2,139 Jul-27-2020, 04:19 PM
Last Post: buran
  Python: Call function with variabele? Ending in error. efclem 5 3,017 Apr-22-2020, 02:35 PM
Last Post: buran
  Lambda function recursion error DeadlySocks 1 2,120 Apr-13-2020, 05:09 PM
Last Post: deanhystad
  How to mock an object that is created during function call? Schlangenversteher 0 2,018 Jan-31-2020, 01:36 PM
Last Post: Schlangenversteher

Forum Jump:

User Panel Messages

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