Always code as if the person who will maintain your code is a maniac serial killer that knows where you live.
Always code as if the person who will maintain your code is a maniac serial killer that knows where you live.
My first own functional python script is ready. It’s a simple game.
If you have pointers how to make it better, please do write em. I’m eager to learn.
# -*- coding: cp1252 -*-
import random
running = True
r = random.randrange(65,90)
r_chr = chr(r)
while running:
print "Numeric value for ASCII '" + r_chr + "'?"
try:
a = input("Your answer: ")
if chr(a) == r_chr:
print "Correct! " + r_chr + " is", a
running = False
else:
print "Wrong... Try again."
running = True
except NameError:
print "You didn't provide a good numeric value."
except KeyboardInterrupt:
print "Shutting down..."
running = False
quit()
except:
print "Something went wrong..."
running = False
quit()
The game: Learn the numerical values of ASCII uppercase letters. — Why? I don’t know.
The 5th day after reading first things about python, 2nd day actually learning and writing it.
number = 5
print number
number = number + 1
print number
multiline = '''This is the first line.
And this is the second.
'''
print multiline
Yay! Baby steps, I know, but gotta start from somewhere.This area is intended for everyone new to PHP. It opens with a series of informal, entertaining tutorials written by Vikram Vaswani, founder and CEO of Melonfire.
Covers the basics of PHP using easy to follow examples and detailed descriptions what is happening in the code.
Must read to all who want to learn and understand the basics.
As of January 1, 2008, PEAR will be dropping support for PEAR versions 1.3.6 and earlier.
If you are using PEAR 1.3.6 or earlier, upgrade using these simple steps:
pear upgrade --force PEAR-1.3.6 Archive_Tar-1.3.1 Console_Getopt-1.2
pear upgrade --force PEAR-1.4.11
pear upgrade PEAR
Read more about the whole thing from here: Innovating the future: Package.xml 1.0, and PEAR 1.3.6 are officially deprecated
After trying hard to upgrade PEAR 1.3.2 to latest with the build in upgrade tool
pear upgrade pear
on my own Debian 3.1 (Sarge) I got the following error message so many times I can’t count:
pinion:/# pear upgrade PEAR
downloading PEAR-1.4.11.tgz ...
Starting to download PEAR-1.4.11.tgz (283,272 bytes)
..........................................................done: 283,272 bytes
requires package `PEAR' >= 1.3.3
And
Segmentation fault
I came across this workaround:
pear upgrade http://pear.php.net/get/PEAR-1.3.3.tgz
pear upgrade Archive_Tar
pear upgrade PEAR
pear upgrade-all