Python Forum
Python script that transfer it self
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python script that transfer it self
#7
to run a python script you will need a secon python scrip to check when the program is launched.
taken from stack exchange:

def running():
n=0# number of instances of the program running
prog=[line.split() for line in subprocess.check_output("tasklist").splitlines()]
[prog.pop(e) for e in [0,1,2]] #useless
for task in prog:
if task[0]=="vlc.exe":
n=n+1
  if n>0:
return True
else:
  return False
Reply


Messages In This Thread
Python script that transfer it self - by iboman5 - Nov-11-2017, 05:27 PM
RE: Python script that transfer it self - by AceScottie - Nov-13-2017, 05:27 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Is there a *.bat DOS batch script to *.py Python Script converter? pstein 3 3,197 Jun-29-2023, 11:57 AM
Last Post: gologica
  python transfer Sql table to csv using BCP mg24 2 1,364 Oct-04-2022, 06:54 AM
Last Post: mg24
  file transfer via python SFTP SCP mg24 3 2,971 Sep-15-2022, 04:20 AM
Last Post: mg24
  DNP3 file transfer with python Aussie 0 1,445 Sep-01-2020, 10:45 PM
Last Post: Aussie
  How to kill a bash script running as root from a python script? jc_lafleur 4 5,881 Jun-26-2020, 10:50 PM
Last Post: jc_lafleur
  crontab on RHEL7 not calling python script wrapped in shell script benthomson 1 2,291 May-28-2020, 05:27 PM
Last Post: micseydel
  Package python script which has different libraries as a single executable or script tej7gandhi 1 2,620 May-11-2019, 08:12 PM
Last Post: keames
  How to run python script which has dependent python script in another folder? PrateekG 1 3,150 May-23-2018, 04:50 PM
Last Post: snippsat
  How to call one python script and use its output in another python script lravikumarvsp 3 32,390 May-16-2018, 02:08 AM
Last Post: lravikumarvsp
  Python script that transfer it self iboman5 2 3,033 Nov-10-2017, 06:56 PM
Last Post: iboman5

Forum Jump:

User Panel Messages

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