Gustavo6046 wrote:Since I am too lazy to copy it one by one from the window I can't select text, :3 I decided to just annex a screenshot...
Secret little-known tip: even though you can't select text in Golly error messages (and almost all other pop-up error windows in Windows) you can still hit Ctrl+C and you'll get the text -- e.g.
Code: Select all
---------------------------
Python error:
---------------------------
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Dave\Desktop\GustavoSearch.py", line 116
os.chmod(f)
^
IndentationError: unindent does not match any outer indentation level
---------------------------
OK
---------------------------
Windows makes an error noise as if it's unable to do the copy -- but then it copies the text perfectly. Silly Windows.
Gustavo6046 wrote:I fixed it with:
And now it's workinn again!... Why don't you run it now that it WORKS??
Well, people probably won't run it simply because you didn't post anything that they can run easily.
It seems kind of silly for me to have to take that code snippet you posted, hunt back through the last page of this thread until I find your
most recent broken code, locate and replace the correct lines, fix the indentation error on line 116, solve the problem with calling os.chmod() with the wrong number of arguments -- and then hope you haven't made any other incidental changes that you have forgotten to mention, so that I'm really running the same script that you are.
Instead of posting what you fixed, why couldn't you just post the whole script again -- or a ZIP file containing the hrf_test1.ini file and the script? That way people don't have to wonder what to call the INI file. The fewer arbitrary unnecessary hoops you make people jump through to look at your work, the more people will look at it.
However, don't get your hopes up too much -- most people have their own projects in mind, and won't be too interested in yours, until you start getting actual useful results from your program. As Scorbie says, it's really pretty worrisome that you "fixed" a problem just by wrapping the celleq() function call in a try/except block, when the problem is really just that one cell list or the other is empty.
If you're going to be passing in empty lists to celleq() sometimes, then add a test for those cases inside celleq() -- and think hard about what you really want to happen in those cases. Right now it kind of looks like you're breaking out of the loop and reporting a match, whenever you get an error due to an empty cell list. Isn't that really just another kind of mismatch, unless both lists are empty?
The INI file is a really huge improvement, by the way! If you set it up right, it will give everyone a concrete example of the type of search that you're trying to run.
However, when I try to run the script, I still seem to have to draw something manually and select something manually, before it will work. The INI file doesn't really contain all the parameters of your search, so that's some more detail that you'll need to explain much more carefully than you've done so far, if you want people to pay attention.
It might be better to include the Herschel position and the initial selection in the INI file, so that there's no guessing involved and people can really run your script "out of the box".
Also, please do more thorough testing of your code releases! You're working out answers to your problems and fixing your bugs yourself -- which is good, because that's your job, not anyone else's.
Wait until you've tested your script, fixed all the bugs you can find, and gotten useful results out -- and then post the useful results and the final script. Nobody needs to see all the earlier stages. Multiple postings with broken bits of Python and random error messages are discouraging to readers, and will tend to make people stop reading.