Noskiw Posted January 15, 2013 Share Posted January 15, 2013 from graphics import * win = GraphWin("Players",300,600) def printPlayers(fileRead,Position): y = 20 LineSplit = Read.split('\n') for x in range(len(LineSplit)-1): CellSplit = LineSplit[x].split(',') if CellSplit[1] == Position: a = Text(Point(100,y),CellSplit[0]) a.draw(win) y+=20 f = open("players.csv","r") Read = f.read() printPlayers(Read,"MF") win.getMouse() win.close() What I'm trying to do is perfectly align the player's names to a certain point, and right now, they look like this. What I want to do is to align them so they start at the same pixel, so they are left aligned. I have attached the whole thing including the players database file in a RAR file so that you may use this and see how it works. Thanks. (This is just a test for the entire project, it is a Fantasy Football League for the Npower Championship) PlayersDatabase.zip Quote Link to comment https://forums.phpfreaks.com/topic/273191-python-graphics-module-aligning-text/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.