#๐ run a script always
37 messages ยท Page 1 of 1 (latest)
@fringe scroll
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.
I really don't know much about programming, so I'm here to ask, I hope you can help me
the computer itself has to be running for the program to keep running, but you can have it run in the background. what OS is this?
im on windows 10
okay, do you use powershell, or what?
What is that? I don't know much about this
the program that you've written--what action do you perform to run it?
oh, you're using CMD
one moment
@fringe scroll try putting start /b before the command. so it might look like start /b python your_program.py
I did it and nothing happened; the script ran normally
okay, so it should keep running, even if you close cmd
lemme try
nevermind, closing cmd will stop it
its not working
ChatGPT told me to create a .bat file to run it in the background, but it didn't work for me
@fringe scroll in CMD, please run where python and tell me the whole output in this chat (no screenshots)
C:\Users\renat\AppData\Local\Microsoft\WindowsApps\python.exe
okay, open powershell (it comes with windows) and run the command that runs the program you want to keep running, but with a & after it. it might look like python your_program.py &
in powershell, you might have to cd to the directory containing the py file.
PS C:\Users\renat\Desktop\Discord-Auto-message-main> python auto.py &
Line: 1
Character: 16
- python auto.py &
-
~
The ampersand (&) character is not allowed. The & operator is reserved for future use; enclose an
ampersand character in double quotes ("&") to pass it as part of a string.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : AmpersandNotAllowed
okay, try this
Start-Process python your_program.py -NoNewWindow
It ran normally, as if it were in cmd
okay, see if it continues even if you close powershell
I thought it would be easier; I don't know anything about programming. I'm sorry for wasting your time
You are not still using a self bot right....?
it should be. the problem is that windows is shit.
I have to sign off, unfortunately
actually, I might have figured it out
nope, I didn't.
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.