#πŸ”’ Can't open file?

48 messages Β· Page 1 of 1 (latest)

proud sparrow
#

Hello I am using visual studio code and have a reoccuring error where my subprocess keeps saying no file or directory would appreciate some help

dusk duneBOT
#

@proud sparrow

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.

proud sparrow
#

here is the error if anyone can help thanks πŸ™‚

celest crater
#

is this happening when you try to run the file?

proud sparrow
#

btw hello again unseeyou :p I am bad at python sorry for creating so many tickets πŸ™‡β€β™‚οΈ

#

I can send the code if you would like

celest crater
#

can you send a screenshot of the project in vscode

proud sparrow
#

yes πŸ™‚

celest crater
#

like the project structure with folders and stuff

proud sparrow
#

full screen

celest crater
#

what about the run command

proud sparrow
#

wdym?

celest crater
#

scroll to the top of the terminal

#

what is the first command that is run

proud sparrow
#

yea I see it

#

I think that is for jav

#

java

celest crater
#

no i mean like the terminal where it shows the output of your code

proud sparrow
#

oh that

#

there is a keyboard interrupt message

celest crater
#

ok change all the subprocess commands to subprocess.run(["python", "IO stuff/FILENAME.py"])

celest crater
#

alternatively you could put the code in those files into a function, import the function and then run it without subprocess

proud sparrow
#

tysm πŸ˜„

celest crater
#

np

proud sparrow
#

oh

#

which method is better?

celest crater
#

true

proud sparrow
#

thanks a lot you have been helping me a lot recently πŸ™‚

celest crater
#

I would just have all the programs in the same file as functions since I'm assuming they are pretty short

proud sparrow
#

yeah they are mostly quite effecient

#

my dad is helping me learn he said to practice naming files and stuff

#

and to have good organization as it will help a lot

celest crater
#

that's a good idea

proud sparrow
#

thanks btw are the file names good?

celest crater
#

yup they are descriptive and they all use snake case so it's consistent

proud sparrow
#

he gave me a list of things to add now I got to do a digit breaker xD

#

anyways have a good day/night unseeyou

celest crater
#

u too

proud sparrow
#

!close

dusk duneBOT
#
Python help channel closed with !close

This help channel has been closed. 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.