#๐Ÿ”’ python game crashing

104 messages ยท Page 1 of 1 (latest)

twilit kayakBOT
#

@broken python

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

broken python
#

hey, ๐Ÿ™‚ my game that I am working on is an asci art style game run in the terminal. When I run my code which is just a save load system, and a way to navigate the terminal game, it works fine, but only on visual studio. However when I go into my filesystem and open my game main.py it works up untill I make a new game and set my name then it crashes. I'm not sure why it does not work as well on windows command prompt as visual studio or windows PowerShell, but when I run it on visual studio and windows PowerShell it works fine but on cmd prompt it does not work and crashes. my code is

fair totem
broken python
#

none

#

it just closes

fair totem
broken python
#

double clicking the file because I want to test the user experience

fair totem
#

Try via command

broken python
#

it wont work

fair totem
#

py <yourfilename>.py

fair totem
broken python
#

ik how to do it and I have it has the same issue it just closes BUT when I run it through PowerShell it works fine

vale wigeon
#

it's probably not wise to have a while loop inside a while loop (while run, while menu and while play)

broken python
#

here is a demenstration

#

and I am new to python and this is me following a tutorial

#

alright @fair totem here

#

shooot

#

woops its just visual studio

#

let me record seprete for each

vale wigeon
#

I tried to run your code but it seems there is no module named win32con

broken python
#

what do you mean

#

do you have asciimatics and pyfiglet?

vale wigeon
#

yes

#

i just installed them

broken python
#

weird

vale wigeon
#

now getting an error
AppData\Local\Programs\Python\Python312\Lib\site-packages\asciimatics\screen.py", line 1873, in <module>
import win32con
ModuleNotFoundError: No module named 'win32con'

broken python
#

LINE 1873?

#

my code only goes to 154

fair totem
#

What version of asciimatics is yours @broken python ?

vale wigeon
#

I've got 1.15

broken python
#

1.15

fair totem
#

ok strange

#

You might need to reinstall it @vale wigeon

broken python
#

well I dont use asciimatics

vale wigeon
#

you imported it though

broken python
#

updated code

#

does not change anything

vale wigeon
#

in startscreen
terminal_width = os.get_terminal_size().columns
OSError: [Errno 9] Bad file descriptor

#

that's the new error

#

when I run it in a cmd window it works fine

#

probably it doesn't run well in IDLE

broken python
#

what do you mean IDLE?

vale wigeon
#

it's the default IDE that comes with python

broken python
#

im brand new to python and I mainly use game engines for programming and I dont know what an IDE is

#

ohhhh

#

now I understan

#

how can I change IDLE to somehting that works better for an ascii art game like mine?

#

so that it works for other people too

vale wigeon
#

you are using visual studio

broken python
#

yrs

#

yes

#

for my code

#

does that change how my .py file works?

vale wigeon
#

yea, IDLE is just an editor

broken python
#

ok

vale wigeon
#

can you record using it in the cmd

#

for me it's working

broken python
#

ok

vale wigeon
#

are you on windows?

vale wigeon
#

you have a traceback there

broken python
#

how can I see it?

vale wigeon
#

permission was denied to open load.save

broken python
#

hmmm

vale wigeon
#

scrub the video slowly between 6-7 seconds

broken python
#

is it because im not an admin on my computer?

vale wigeon
#

if you have a file load.save in the same directory that is the problem

broken python
#

its load .txt

vale wigeon
#

do you have it open on your computer?

broken python
#

no

#

I might know why

#

this is my recycle bin

#

should I empty it

#

because my code just makes a new file

vale wigeon
#

I don't know why it gives a permission denied to opening the load.text, but the recycle bin isn't it

broken python
#

hmm

#

im not on an administrator account

vale wigeon
#

is the directory read only or something

broken python
#

what do you mean

vale wigeon
#

can you, with your current acount, open and change files and delete them?

#

in that folder

broken python
#

yes

vale wigeon
vale wigeon
#

ERRNO 13, permission denied: 'load.text'

broken python
#

thanks

#

btw are you the kenny from godot?

#

like kennys packs

vale wigeon
#

nope

#

I'm a newby programmer also

broken python
#

oh lol

vale wigeon
#

if you find the issue if you don't mind message me, I'll see it when I wake up

twilit kayakBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.