#๐Ÿ”’ when i double click on main.py to open script this only open for 1 sec and later close black scree

163 messages ยท Page 1 of 1 (latest)

silk tangle
#

when i double click on main.py to open script this only open for 1 sec and later close black screen from administration cmd

paper epochBOT
#

@silk tangle

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.

silk tangle
#

HElp mepleasee

scenic crater
silk tangle
#

.py

south gorge
#

You should probably run your python file from the command line instead of double clicking it

#

python path/to/file.py

loud heath
#

py, since you're on windows

#

@silk tangle You wanted to share a photo?

silk tangle
#

@loud heath

#

when i click on main i see only black screen from administraction cmd like 0.1 sec

loud heath
#

okay, but, where's the command prompt I told ya to pull up

silk tangle
#

give me link for download

loud heath
#

it's preinstalled with every windows machine

silk tangle
#

I had python a long time ago and it opened normally every file after two clicks and now it doesn't want to

silk tangle
#

i preinstalled my windows

loud heath
#

I'm not sure if it's called command prompt, since the language setting you have looks like polish, but

#

if you hit the windows key

loud heath
#

YES

#

that

#

open that

silk tangle
#

done what now

loud heath
#

do you see the text left to the flashing cursor

#

what does it say

silk tangle
loud heath
#

ah, you opened it in administrative mode

silk tangle
#

yes

#

no admin?

loud heath
#

yeah, admin is unnecessary

silk tangle
loud heath
#

awesome, so

#

can you type "dir" and hit enter for me

silk tangle
loud heath
#

Fantastic

#

next, type "cd Desktop"

silk tangle
loud heath
#

you said your python file was on the desktop, correct?

silk tangle
#

tes

#

yes

loud heath
#

what is the name of your file?

silk tangle
#

python g

loud heath
#

AH, it's a folder

#

okay, before that then

#

type cd "Python g"

#

include the quotes

silk tangle
#

๐Ÿ˜ฎ

loud heath
#

no no, include the quotes

silk tangle
#

what

loud heath
#

you see "Python g"?

#

write it as is

#

every character included

silk tangle
#

I WROTE

#

Python g

loud heath
#

you did not put the " around it

plush prawn
#

ddfhd

silk tangle
#

nope

loud heath
#

you have to put those around it

silk tangle
#

"Python g"

#

?

loud heath
#

correct

silk tangle
loud heath
#

and put cd before that

silk tangle
#

ah

#

cd

#

cd "Python g"

loud heath
#

yup!

silk tangle
#

im inside

loud heath
#

FANTASTIC

#

alright, you want to run main, right?

silk tangle
#

YESS

loud heath
#

try py main.py

#

in your terminal

silk tangle
#

terminal?

#

not cmd?

loud heath
#

cmd is terminal

silk tangle
#

?

loud heath
silk tangle
loud heath
#

okay, well, at least you can run the code now

#

it's erroring, but

silk tangle
#

ok how

loud heath
#

to fix the traceback you're getting? okay

#

uhhh, are you familiar with pip

silk tangle
#

wha ti need write

#

pip pup pap

#

idk

loud heath
#

LMAO

#

pip is the thingie that lets you download python packages online

silk tangle
#

ok

#

how get that

loud heath
#

you're using requests, which does not come with your python install

#

dw, you have pip

silk tangle
#

where find pip

loud heath
#

what you wanna do

#

is type

#

py -m pip install requests

#

into cmd

silk tangle
#

DOWNLADING

loud heath
loud heath
#

now try py main.py again

loud heath
#

well shit

#

hold on

#

where did you get this code from?

silk tangle
loud heath
#

OH WELL

#

I'm stupid lol

#

uhm, type py -m pip install -r requirements.txt

#

i did not realize there was a requirements file in there

silk tangle
#

instalinig

#

done

loud heath
#

when it's done, try py main.py once more

loud heath
#

WAIT NO NO, HOLD ON

#

it worked

#

nothing printed

#

but it did not error, SO

#

it working fine

silk tangle
#

so where is it

loud heath
#

there it is

#

it just doesn't print anything

silk tangle
#

SO HOW OPEN

loud heath
#

you did

silk tangle
#

but

#

where script

#

where options

#

why this is clear

surreal slate
#

what are u expecting the file to do

silk tangle
#

that was image grabber i dont made this

#

only someone other

#

from hacking forum on vacbanwtf

#

so this file is clear?

#

have nothing?

#

ok thanks bye

south gorge
#

!paste

paper epochBOT
#
Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

silk tangle
#

.py files dont work for my

#

like .bat works

#

.py no

lost hemlock
#

pythonw.exe script.py perhaps

south gorge
# silk tangle

If it didn't work and if it was empty you would not have had this error

#

Show the code

paper epochBOT
#
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.