Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pycode_similar.detect does not return anything #11

Open
Shroud007 opened this issue Apr 22, 2021 · 0 comments
Open

pycode_similar.detect does not return anything #11

Shroud007 opened this issue Apr 22, 2021 · 0 comments

Comments

@Shroud007
Copy link

Imported pycode_similar as python library:
import pycode_similar

Have two files with python source code ('t1.py' and 't2.py' respectively):

from math import sqrt
x = float(input("x="))
y = float(input("y="))
r = float(input("r="))
h = sqrt(x2 + y2)
print("The distance to a point from the origin is %.2f" % h)
if h > r:
print("point is outside the circle")
else:
print("point belongs to circle")

and

import math
x_point = float(input("x = "))
y_point = float(input("y = "))
r_circle = float(input("R = "))
hypotenuse = math.sqrt(x_point ** 2 + y_point ** 2)
if hypotenuse <= r_circle:
print("The point belongs to the circle")
else:
print("The point does not belongs to the circle")

Read both of them as strings:
str_1 = open('t1.py', 'r').read()
str_2 = open('t2.py', 'r').read()

Tried to use pycode_similar.detect:
pycode_similar.detect([str_1, str_2], diff_method=pycode_similar.UnifiedDiff, keep_prints=True, module_level=True)
But nothing was output to the console.
What am I doing wrong ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant