Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- #--*--coding: utf-8--*--
- import MySQLdb
- import user
- from dbconfig import read_param, game_server
- from premium_user import isPremiumUser
- status, username = user.isAuth()
- premium_account = isPremiumUser()
- if status:
- if premium_account:
- db_config = game_server()
- db = MySQLdb.connect(**db_config)
- cursor = db.cursor()
- cursor.execute("SELECT char_name from characters WHERE account_name=%s", (username))
- all_characters = cursor.fetchall() #кортеж из кортежей
- all_char = range(len(all_characters)) #range(2) будет [0, 1]
- print "<center>Выберите с какого персонажа продать вещь:"
- print "<select name=\"char_select\">"
- j = 0
- for char_name in all_char:
- j+=1
- i = all_characters[char_name][0]
- print """
- <option value="%s">%s</option>
- """ % (j, i)
- print "</select><br>"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement