It appears that you are asking how to request justification settings for the separate columns, which are numofcolumns in number. The simplest changes to your program-so-far are to correct rawinput to raw_input, and add a column number to the last prompt, and save results in a list:
nrows = int(raw_input('# rows: '))
ncolumns = int(raw_input('# columns: '))
justify = []
for x in range(ncolumns):
j = raw_input('Select left, center, or right justification in column '+str(x+1)+' by L,C,R: ')
justify.append(j.upper())
print justify
For example, with ncolumns = 4, four questions like
Select left, center, or right justification in column 1 by L,C,R:
will appear, and if users responds with letters L, R, C, and L in turn, in upper or lowercase, the print statement will print ['L', 'R', 'C', 'L'].
Of course such an interface is clumsy to use; on the one hand, if the user notices a mistake in column 4's specification after entering a dozen other specifications, it is necessary to start all over. On the other hand, the program is difficult to use from a script. The example code shown below does not address the latter problem, but does make it easy for the user to make column-justification settings in any order. This code displays a message, Select column justification settings, then click Go and puts up a grid of radio buttons labeled L, C, R. After the user is satisfied with justification settings and clicks Go, the program prints a list like [1, 1, 1, 0, 2], which indicates C,C,C,L,R selections as shown in following figure.
This demo program does not input nrows or ncolumns, but sets ncolumns=5.
#!/usr/bin/env python
# Set up a simple horizontal menu with some editable radio buttons
import gtk
def bcallback(w, i, j): # Radio button callback
settings[i] = j
# create set of radio buttons
ncolumns = 5
W = gtk.Window()
W.connect('destroy', gtk.main_quit)
W.set_title('Column-justification settings')
box = gtk.HBox()
W.add(box)
for i in range(ncolumns):
col = gtk.VBox()
b = gtk.RadioButton(None, 'L')
rb = [b, gtk.RadioButton(b, 'C'), gtk.RadioButton(b, 'R')]
for j,b in enumerate(rb):
col.pack_start(b)
b.connect('toggled', bcallback, i, j)
box.pack_start(col)
b = gtk.Button(None, 'Go')
b.connect('button-press-event', gtk.main_quit)
box.pack_start(b)
W.show_all() # Make menu available for showing
settings = [0 for i in range(ncolumns)]
print 'Select column justification settings, then click Go'
gtk.main()
print settings