Python Forum
Is it possible to have a script call itself?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is it possible to have a script call itself?
#1
Hi everyone I am trying to write a very very simple python script that opens up a .py file on my desktop using import os

this is what the script looks like in the shell:

import os
os.startfile("c:\Users\Trey\Desktop\Vote.py")


The problem with this scrip is it will find the file and open it, but it will close as soon as it opens.
This idea is that this scrip will find the vote.py file and open it so it will run. Whenever it does find it, it wont run b/c it closes as soon as it opens.

Please help! Thanks!
Reply


Messages In This Thread
Opening a .py file with a python script [HELP] - by treycoxiii - Feb-04-2017, 09:10 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Is possible to run the python command to call python script on linux? cuten222 6 932 Jan-30-2024, 09:05 PM
Last Post: DeaD_EyE
  Call a bash script from within a Python programme Pedroski55 6 2,577 Dec-06-2021, 01:53 PM
Last Post: DeaD_EyE
  Using VBA to Call a Python script causes error in pyodbc connector pcarra 1 2,919 Jun-11-2019, 04:14 PM
Last Post: pcarra
  How to call a variable declared in a function in another python script lravikumarvsp 2 3,011 Jun-04-2018, 08:45 AM
Last Post: Larz60+
  How to call one python script and use its output in another python script lravikumarvsp 3 32,583 May-16-2018, 02:08 AM
Last Post: lravikumarvsp
  Python cmd function call from script John_O 10 10,004 Feb-18-2017, 04:45 PM
Last Post: John_O
  Windows: python script call over ssh -> output jb7731 2 5,473 Feb-08-2017, 01:13 PM
Last Post: jb7731

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020