poikilotherm said:
yes indeed
Dropbear said:
poikilotherm said:yes indeed
The one that ate the dog?
Perhaps he went to siphon the python?
Cast our your pythons today, in the name of The Lord.

PM 2Ring said:
Nice!
A handsome photo indeed.
PM 2Ring said:
.
Is his name “Monty”?
ms spock said:
PM 2Ring said:
img src=“http://i2.photobucket.com/albums/y43/PM2Ring/Snake029.jpgNice!
A handsome photo indeed.

bob(from black rock) said:
PM 2Ring said:
![]()
.
Is his name “Monty”?
Of course!
continues Irish Dancing with a flourish
Carmen_Sandiego said:
ms spock said:
PM 2Ring said:
img src=“http://i2.photobucket.com/albums/y43/PM2Ring/Snake029.jpgNice!
A handsome photo indeed.
Awesome!
At your place?
bob(from black rock) said:
PM 2Ring said:
![]()
.
Is his name “Monty”?
No, Mum named him Cedric. He stayed in that rock wall over winter a couple of years ago, but left in the spring.
OTOH, the Python programming language is named after Monty Python.
PM 2Ring said:
bob(from black rock) said:
PM 2Ring said:
![]()
.
Is his name “Monty”?
No, Mum named him Cedric. He stayed in that rock wall over winter a couple of years ago, but left in the spring.
OTOH, the Python programming language is named after Monty Python.
.
You can’t call a python Cedric he will get a complex and need to see a snake shrink.
ms spock said:
Carmen_Sandiego said:
ms spock said:Nice!
A handsome photo indeed.
!https://fbcdn-sphotos-g-a.akamaihd.net/hphotos-ak-ash3/t31.0-8/q83/s720×720/964120_10200395570872010_2112334682_o.jpg
Awesome!
At your place?
Yeah, our kitchen. (That’s the edge of its head just poking over the edge of the cupboard – 2.7m, average adult size is 4m)
PM 2Ring said:
bob(from black rock) said:
PM 2Ring said:
![]()
.
Is his name “Monty”?
No, Mum named him Cedric. He stayed in that rock wall over winter a couple of years ago, but left in the spring.
OTOH, the Python programming language is named after Monty Python.
I didn’t know that. That is so cool.
*files away information for next time she is with the true nerds.
PM 2Ring said:
bob(from black rock) said:
PM 2Ring said:
![]()
.
Is his name “Monty”?
No, Mum named him Cedric. He stayed in that rock wall over winter a couple of years ago, but left in the spring.
OTOH, the Python programming language is named after Monty Python.
I didn’t know that. That is so cool.
files away information for next time she is with the true nerds.
Carmen_Sandiego said:
ms spock said:
Carmen_Sandiego said:!https://fbcdn-sphotos-g-a.akamaihd.net/hphotos-ak-ash3/t31.0-8/q83/s720×720/964120_10200395570872010_2112334682_o.jpg
Awesome!
At your place?
Yeah, our kitchen. (That’s the edge of its head just poking over the edge of the cupboard – 2.7m, average adult size is 4m)
Wow. You are so lucky!
Tell spiderlily I walked 6 km yesterday! She can be proud of me.
ms spock said:
I didn’t know that. That is so cool.
*files away information for next time she is with the true nerds.
I was pretty tired of coming second in every round of trivia on the ship. Grrrr!
Divine Angel said:
ms spock said:I didn’t know that. That is so cool.
*files away information for next time she is with the true nerds.
I was pretty tired of coming second in every round of trivia on the ship. Grrrr!
The first loser. Nice consistency though. :P
Hey poikilotherm,
What OS are you doing your Python stuff on?
It doesn’t really make much of a difference, but I’ve noticed that Windows users tend not to run Python stuff (or anything else) in a terminal if they can avoid it. On *nix (including OSX) it’s fairly easy to print coloured text in the terminal window, which can be fun to play with when you’re getting started in programming.
PM 2Ring said:
Hey poikilotherm,What OS are you doing your Python stuff on?
It doesn’t really make much of a difference, but I’ve noticed that Windows users tend not to run Python stuff (or anything else) in a terminal if they can avoid it. On *nix (including OSX) it’s fairly easy to print coloured text in the terminal window, which can be fun to play with when you’re getting started in programming.
At work I’m using an online emulator, at home I tried to use a Python terminal box in Win 7…hasn’t gone well yet.
poikilotherm said:
At work I’m using an online emulator, at home I tried to use a Python terminal box in Win 7…hasn’t gone well yet.
Ah, ok. It’s been a few years since I played with Python on Windows, and then I mostly ran stuff inside IDLE.
But this FAQ might be helpful.
PM 2Ring said:
poikilotherm said:
At work I’m using an online emulator, at home I tried to use a Python terminal box in Win 7…hasn’t gone well yet.
Ah, ok. It’s been a few years since I played with Python on Windows, and then I mostly ran stuff inside IDLE.
But this FAQ might be helpful.
Thanks, I’ll have a read at home.
Does that online emulator give you access to the standard Python modules, or is it only capable of running self-contained code?
PM 2Ring said:
Does that online emulator give you access to the standard Python modules, or is it only capable of running self-contained code?
It gives access to modules afaict, here is something the ‘classes’ have been leading up to, finally got it to work. Much headache.
from random import randintboard =
for x in range(5): board.append( * 5)
def print_board(board): for row in board: print “ “.join(row)
print “Let’s play Battleship!”
print_board(board)def random_row(board): return randint(0, len(board) – 1)
def random_col(board): return randint(0, len(board) – 1)
ship_row = random_row(board)
ship_col = random_col(board)
print ship_row
print ship_colfor turn in range(4):
guess_row = int(raw_input(“Guess Row:”)) guess_col = int(raw_input(“Guess Col:”)) if guess_row ship_row and guess_col ship_col: print “Congratulations! You sunk my battleship!” else: if (guess_row < 0 or guess_row > 4) or \ (guess_col < 0 or guess_col > 4): print “Oops, that’s not even in the ocean.” elif(board == “X”): print “You guessed that one already.” else: print “You missed my battleship!” board = “X” print turn+1 print_board(board)
just noticed the else/elif doesn’t look quite right.
poikilotherm said:
just noticed the else/elif doesn’t look quite right.
It looks ok to me. But you probably should break out of the for loop when the player makes a correct guess.
PM 2Ring said:
poikilotherm said:
just noticed the else/elif doesn’t look quite right.
It looks ok to me. But you probably should break out of the for loop when the player makes a correct guess.
Ah, yea…the instructions were ‘everything in this section in the for loop’. And this next section is about ending the game etc. :)
PM 2Ring said:
poikilotherm said:
just noticed the else/elif doesn’t look quite right.
It looks ok to me. But you probably should break out of the for loop when the player makes a correct guess.
Pffft. Such a pedant
Dropbear said:
PM 2Ring said:
poikilotherm said:
just noticed the else/elif doesn’t look quite right.
It looks ok to me. But you probably should break out of the for loop when the player makes a correct guess.
Pffft. Such a pedant
Well, that was rather simple…break, breaks the loop. Who woulda thort.
poikilotherm said:
PM 2Ring said:
poikilotherm said:
just noticed the else/elif doesn’t look quite right.
It looks ok to me. But you probably should break out of the for loop when the player makes a correct guess.
Ah, yea…the instructions were ‘everything in this section in the for loop’. And this next section is about ending the game etc. :)
Rightio.
Dropbear said:
PM 2Ring said:
poikilotherm said:
just noticed the else/elif doesn’t look quite right.
It looks ok to me. But you probably should break out of the for loop when the player makes a correct guess.
Pffft. Such a pedant
:)
Loops…hope chrome is ready for some crashing…
poikilotherm said:
Well, that was rather simple…break, breaks the loop. Who woulda thort.
Note that with nested loops, break only breaks the innermost loop. Some languages provide special syntax that makes it easy, but generally, how to best break out of nested loops is a topic of programmers’ Religious Wars. :)
So when did the Python thread turn into a Python thread?
The Rev Dodgson said:
So when did the Python thread turn into a Python thread?
slithers about, does a python.
Here’s a little script I wrote this afternoon. Hopefully, it’ll run in your emulator.
The Rev Dodgson said:
So when did the Python thread turn into a Python thread?
PWM got it back on track, I just let it run…was amusing to watch and I had solved the problem I was going to ask.
The Rev Dodgson said:
So when did the Python thread turn into a Python thread?
It actually started out that way, but it might not have been obvious from the earlier posts. :)
PM 2Ring said:
Here’s a little script I wrote this afternoon. Hopefully, it’ll run in your emulator.
Didn’t go, but I’ll try another tonight. Approaching home time :).
We all thought it was a post trolling elapid.
poikilotherm said:
I had solved the problem I was going to ask.
OCDC said:
We all thought it was a post trolling elapid.
elapids are pythons now?
I think OCDC thinks I am elapid.
poikilotherm said:
I think OCDC thinks I am elapid.
oooh K
poikilotherm said:
PM 2Ring said:
Here’s a little script I wrote this afternoon. Hopefully, it’ll run in your emulator.Didn’t go, but I’ll try another tonight. Approaching home time :).
Oh well. I’m not too surprised, though. I suppose that making urllib available in an online emulator could create security / DOS (Denial Of Service) problems.
But anyway, that script lets you quickly see who’s been posting what on this forum without having to fire up your browser, so it’s a bit redundant if you run it from inside a browser. :)
That script uses the standard Python Regular Expression module to do the work of extracting the relevant data. If you’ve never used regexes before they can be bit daunting, but they’re great once you get used to them.
xkcd #208
published 10 January 2007
Regular Expressions

Transcript
Narrator: Whenever I learn a new skill I concoct elaborate fantasy scenarios where it lets me save the day.
Woman: Oh no! The killer must have followed her on vacation!
{Woman points to computer}
Woman: But to find them we’d need to search through 200MB of emails looking for something formatted like an address!
Man: It’s hopeless!
Offpanel voice: Everybody stand back.
Offpanel voice: I know regular expressions.
{A man swings in on a rope, toward the computer}
<<tap tap>>
<<PERL!>>
{The man swings away, and the other characters cheer}
poikilotherm said:
I think OCDC thinks I am elapid.
Are you Croatian, do you fantasize about being blind or about being a park ranger?
If you answer “yes” to all the above, you could be elapid. :)
Sounds useful, I could use them often.
poikilotherm said:
I think OCDC thinks I am elapid.Well you seem to have the same smrts…
;-)
poikilotherm said:
Sounds useful, I could use them often.
Most scripting languages let you use Regular Expressions (aka regexes). There are minor variations from language to language, but that mostly just affects the fancier stuff, so once you’ve learned how to use regexes in one language it’s pretty easy to use them in others. And because regexes have been around for decades there are lots of tutorials available, and almost any conceivable question about them has been asked on some programmers’ forum.