Sudoku

E

Eric Parry

Would you like to elaborate? exit() is supposed to take an int

parameter, but the author apparently didn't notice that. So perhaps you

got an exception of some sort. Change it to exit() or exit(0) and it

might solve the problem, depending on what the problem was.






No it doesn't. return = 0 is a syntax error in both Python 2.x and 3.x



But if you changed it to a valid return statement, then that's why it

doesn't stop on the first solution.

I think in the original it was exit(a). That did not work either.
I'll try the others.
Eric.
 
E

Eric Parry

I think in the original it was exit(a). That did not work either.

I'll try the others.

Eric.

I tried all those things. The program keeps running after the solution in every case. Never mind. It won't do that in VBA when I finish it.
Eric.
 
E

Eric Parry

I think in the original it was exit(a). That did not work either.

I'll try the others.

Eric.

I tried all those things. The program keeps running after the solution in every case. Never mind. It won't do that in VBA when I finish it.
Eric.
 
D

Dave Angel

I think in the original it was exit(a). That did not work either.

There you go again. "Did not work" tells us very little. With my
Python 2.7.2, exit(something) with something being a string prints the
string and then exits. Nowhere have I seen that documented, and I
thought it either took an int or nothing.

So please be much more specific. Did it give some exception, or did it
not print the right result (I don't see any print statement in the
code), or what?
 
C

Chris Angelico

[ chomp 128 lines of quoted text ]

I tried all those things. The program keeps running after the solution in every case. Never mind. It won't do that in VBA when I finish it.
Eric.

You have just spammed us with, and I counted them, one hundred and
twenty-eight lines of quoted text. And you posted to both
comp.lang.python and python-list, so some of us will have seen those
lines twice. Please don't do this. If you MUST use Google Groups,
check out this page, and try to adjust your posts to be more
courteous.

http://wiki.python.org/moin/GoogleGroupsPython

Thanks!

ChrisA
 
A

Arnaud Delobelle

[...] With my Python
2.7.2, exit(something) with something being a string prints the string and
then exits. Nowhere have I seen that documented, and I thought it either
took an int or nothing.

It is documented, just not exactly where you'd expect it (exit is a
constant, not a function):

http://docs.python.org/2/library/constants.html#constants-added-by-the-site-module

As for the behaviour when you pass a string, it's documented here:

http://docs.python.org/2/library/exceptions.html#exceptions.SystemExit
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,888
Messages
2,569,964
Members
46,294
Latest member
HollieYork

Latest Threads

Top