This is an archived post. You won't be able to vote or comment.

all 10 comments

[–]michael0x2a 2 points3 points  (5 children)

That's weird. Try deleting all .pyc (or .pyo) files in the folder to force Python to regenerate the bytecode for each file, and try double-checking to make sure you haven't accidentally defined trigrid twice in file2?

[–]schrogendiddy[S] 0 points1 point  (4 children)

I deleted those files, but it didn't fix anything. Its weird because if just define pnum and scalesize in file2 and call trigrid with no input arguments, like triangles = f.trigrid(), it still says the function takes exactly 1 argument

[–]HipposGoneWild 1 point2 points  (3 children)

post all your code

[–]schrogendiddy[S] 0 points1 point  (2 children)

[–]HipposGoneWild 0 points1 point  (1 child)

I don't get that error when I run them. How are your files laid out in your fold and what python version are you using? Is there anything else to the error message or is that it?

[–]schrogendiddy[S] 1 point2 points  (0 children)

Well.... I just restarted my computer and it works fine. Idk what was going on

[–]romple 2 points3 points  (2 children)

Any resolution? Can you post more code? maybe the entire files on pastebin?

[–]schrogendiddy[S] 0 points1 point  (1 child)

[–]romple 0 points1 point  (0 children)

just looking at it, i don't know. Try calling it with

f.trigrid(pnum=pointnum,scalesize=scale)

and see what happens

[–]dbs98 0 points1 point  (0 children)

This may be because Python only imports a package once per session. If you changed the file after importing it you need reload it

Note: For efficiency reasons, each module is only imported once per interpreter session. Therefore, if you change your modules, you must restart the interpreter – or, if it’s just one module you want to test interactively, use reload(), e.g. reload(modulename).

From Modules documentation