Skip to content

Commit

Permalink
d.correlate: fix for Python 3 (#1149)
Browse files Browse the repository at this point in the history
  • Loading branch information
NikosAlexandris committed Dec 7, 2020
1 parent 7610d3b commit ece7799
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/d.correlate/d.correlate.py
Expand Up @@ -67,12 +67,12 @@ def main():
stdin="%s %s" % (i, j))
line += 1

ofile = file(tmpfile, 'w')
ofile = open(tmpfile, 'w')
gcore.run_command('r.stats', flags='cnA', input=(i, j),
stdout=ofile)
ofile.close()

ifile = file(tmpfile, 'r')
ifile = open(tmpfile, 'r')
first = True
for l in ifile:
f = l.rstrip('\r\n').split(' ')
Expand All @@ -98,12 +98,12 @@ def main():
p = gcore.feed_command('d.graph', color=color)
ofile = p.stdin

ifile = file(tmpfile, 'r')
ifile = open(tmpfile, 'r')
for l in ifile:
f = l.rstrip('\r\n').split(' ')
x = float(f[0])
y = float(f[1])
ofile.write("icon + 0.1 %f %f\n" % ((x - minx + 1) * kx,
ofile.write(b"icon + 0.1 %f %f\n" % ((x - minx + 1) * kx,
(y - miny + 1) * ky))
ifile.close()

Expand Down

0 comments on commit ece7799

Please sign in to comment.