Python: How to compare what my function and pyc file funciton print (when I run both of them in loop at anothe?

I have a pyc file and to check if my function print the same at the pyc function. I want to run a loop that check some randomaly options at my function and check if it prints the same output as the another options. I didn’t want to use diff. Thanks


Why I don’t want to use diff?

I want to run it many times. and each fundtion call to check if the function give the same output.

How I can do it?

✅ Answers

? Favorite Answer

  • Why NOT diff?

    That is what it is for (diff – differences). But, if you REALLY don’t want to use diff, you could “roll your own”. You need a testing framework for the pyc function, and your own. Call each, and compare the outputs programmatically. This is called a “unit test”, and is used to validate your results.

    Main reason to not use diff – floating point processing, where two different kinds of computer or two different procedures to get the results are used, and the floating output is slightly different and cannot be directly compared.

  • So THATS what you call your junk now huh?…the ‘Burmese Python’??..alritey then.. properly i assume its greater useful than that previous call you used- “the Mitey Inch computer virus’…top? yet once you woulda paid greater useful interest in eighth grade wellbeing class, (or in my case, to Mrs Ortez- the superb neighbor lady around the corner), you woulda discovered that the ‘coughing and sneezing’, the rest human beings call ‘ejaculation’…. desire that helps some~

  • See also  How to make an array of Turtles?

    Leave a Comment