First loop over the characters you'd like to see, then loop over the result of a call to itertools.product, as the task you're describing is the Cartesian product. In that inner loop, you can print each result (a tuple) by turning each element (integers) into a string and joining them all together.
import itertools
for i in xrange(1,4):
    for item in itertools.product(xrange(3), repeat=i):
        print ''.join(map(str, item))
Result:
0
1
2
00
01
02
10
11
12
20
21
22
000
001
002
010
011
012
020
021
022
100
101
102
110
111
112
120
121
122
200
201
202
210
211
212
220
221
222