Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Getting started
-
I’m new to python and use IDLE on my laptop.
I copied some code into what appears to be the editing area - where the examples appear.
I gave it a name that appears on the upper tabs, but I can’t run the program. The run icon above dose nothing and I can’t find documentation on the mechanics of the editor. -
ensure your script file has
.py
extention if run is grayed out. Also what is expected when you run the script? -
The script is called gameBoard.py which is in gray text in the tabs. The run arrowhead is in gray. From the examples I think it should be in green to be active.
The file itself is just a series of print statements about 10 lines long. I just want to get a feel for the editor -
@dougler1, my ”run triangle” or ”play button” is just empty (white) with a blue outline. Could be different with a different theme, though.
I assume nothing happens when you press it? Or could it very briefly turn into a box with an x in it?
Maybe paste your code in here just to be sure?
-
@dougler1, or send a screenshot, so we know where you are within your Pythonista.
To send a screenshot you can use:

-and-
https://imgur.com/ -
-
Here Is the code I’m trying to run
board=['1','2','3', '4','5', '6', '7','8','9'] def play(): print('got here') printBoard def printBoard(): print for square in range (0,9 ): print('|', board [square],'|', end='') if square ==2 or square ==5 : print ('\n') print('__________') print if __name__==' __main__': play()
-
Error was between seat and keyboard...thanks
-
Just a seggestion 😊 ... or two if board is going to be a list of numeric strings in order you can also just use range to create your board squars without the list object. that way you dont create two sparate lists each time (board and range). and fstring to help control spacing more. while we are t it lets throw in a new line variable 😁
For Example:
for square in range(1, 10): # 1-9 nl = '\n' if square%3 == 0 else '' print(f'| {square} |{nl}', end='')
prints:
| 1 || 2 || 3 | | 4 || 5 || 6 | | 7 || 8 || 9 |
As for myself, I like to use Unicode in my console apps
I'll show an example of how I would implement a Board 😊using the same 3x3 setup:
top = "╔═╦═╦═╦═╦═╦═╗\n" between = "╠═╬═╬═╬═╬═╬═╣\n" bottom = "╚═╩═╩═╩═╩═╩═╝\n" board = top rows = 3 for n in range(rows): board += f'╠ {n*3+1} ╬ {n*3+2} ╬ {n*3+3} ╣\n' if n+1 != rows: board += between else: board += bottom print(board)
prints:
╔═╦═╦═╦═╦═╦═╗ ╠ 1 ╬ 2 ╬ 3 ╣ ╠═╬═╬═╬═╬═╬═╣ ╠ 4 ╬ 5 ╬ 6 ╣ ╠═╬═╬═╬═╬═╬═╣ ╠ 7 ╬ 8 ╬ 9 ╣ ╚═╩═╩═╩═╩═╩═╝
many ways to do it. just figured id share 😇