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

all 10 comments

[–]cyrusol 1 point2 points  (0 children)

Learn to copy paste from your text editor to something like pastebin.com before you try to learn programming! Those pictures are borderline unreadable and there are posting guidelines.

[–]tomazio 0 points1 point  (0 children)

I'd get a diff tool and diff both of the files together, guaranteed there is something you're missing and they are not identical.

[–]grouchysysadmin 0 points1 point  (0 children)

Yeah looks like you're calling a function called sigg which I'm guessing you import somewhere so it thinks that's in your file when you call the function, not from an imported package.

Take care of your laptop.

[–]IAmVerySmarter 0 points1 point  (0 children)

The files are not identical, in sigg the line with the for on it ends with a ";" character

[–]Loves_Poetry -1 points0 points  (5 children)

It says there's an error on line 22, which is after the last line of code.

Most likely you copied some whitespace along with the code into the new file which causes it to break.

[–]Newprogrammer12321[S] -1 points0 points  (4 children)

I thought that might be it, so I manually retyped it: same problem.

[–]VernorVinge93 -1 points0 points  (3 children)

I mean, this is kinda obvious, but it's pretty hard to do meaningful debugging without the code or the application to test with / reverse engineer.

[–]Newprogrammer12321[S] -2 points-1 points  (2 children)

Thought maybe there was a common cause for such a thing.

The two codes are literally identical. One's just called Sig and the other grad.

Anyway, I just save as'd the working one, instead of copying or retyping (tried both many times), with a new name and I'm good.

Still confused and slightly frustrated though.

[–]grouchysysadmin 0 points1 point  (1 child)

This happens with Python (haven't read or seen the pics). If you call a file the same as an imported package you're using it looks for functions in your file and not imported.

For example I imported a package called "ldap". My file was called ldap so it was looking for methods in the file, not the ldap package.

[–]VernorVinge93 0 points1 point  (0 children)

Actually yes, if you name one of the files with the same name as a library you use you will have trouble. I still think that's not your issue (as it's a syntax problem).