Python Forum
How to define two functions run simultaneously within a function?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to define two functions run simultaneously within a function?
#5
(Feb-06-2018, 08:00 PM)boring_accountant Wrote: Alright, I may not be of help to the general solution, but I can give you some pointers which hopefully will prove useful:
  • Value_2 is not set prior to be used by call1, as indicated in your OP, if that makes sense you can set an initial value prior to the loop being executed for the first time;
  • dilution is set but never used
  • Value_1 is used but never set
  • Value_2 is calculated using Value_1 + call*M where call is list, not a scalar. Did you mean to use call1 ?
  • If Value_1 and Value_2 are floats, it's possible that they may be close enough for your needs but that they will not equal 0. I would suggest storing the result without comparing to 0 so that you can observe yourself if one of the iterations is good enough for your needs.
Thank you! I changed the code the way you proposed, but the thing is that call1 and Value_2 are interdependent. So, I do not know how to deal with this. Once I run the code above I got constant diff_df and call_df since Value_2 is not changing. Any suggestions how can I make Value_2 be used for the first interation and all the rest should use new Value_2?
Reply


Messages In This Thread
RE: How to define two functions run simultaneously within a function? - by Alberto - Feb-06-2018, 10:08 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  It seems you have to define functions at the top 357mag 7 1,300 May-10-2023, 03:01 PM
Last Post: jefsummers
  Combine Two Recursive Functions To Create One Recursive Selection Sort Function Jeremy7 12 7,381 Jan-17-2021, 03:02 AM
Last Post: Jeremy7
  Struggling for the past hour to define function and call it back godlyredwall 2 2,225 Oct-29-2020, 02:45 PM
Last Post: deanhystad
  Help with define a def function Omer_ 3 2,167 Sep-20-2020, 06:59 PM
Last Post: Omer_
  How to define a function to create a resorted list? sparkt 6 2,825 Aug-08-2020, 04:10 PM
Last Post: sparkt
  Cant define turtle color with function argument Wrightys99 2 2,254 Apr-22-2020, 01:43 PM
Last Post: Wrightys99
  Run a timer when a functions starts to see how long the function takes to complete Pedroski55 2 2,006 Apr-19-2020, 06:28 AM
Last Post: Pedroski55
  Need help with a function that calls other functions. skurrtboi 4 2,537 Sep-30-2019, 09:28 PM
Last Post: stullis
  How to run same process simultaneously exploit123 1 2,449 Sep-19-2019, 10:08 AM
Last Post: Gribouillis
  How to define a function that calculates the BMI from dataframe DavidGG 2 5,871 May-30-2019, 03:35 PM
Last Post: volcano63

Forum Jump:

User Panel Messages

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