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?
#11
I can't get it. How is this different from writing a simple loop?
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#12
(Feb-05-2017, 01:37 AM)wavic Wrote: I can't get it. How is this different from writing a simple loop?

in my script i connect to a server and send requests. if the requests become to frequent it bans my ip. using a vpn, spoof ips, and this idea of killing and reviving my program it is able to send fresh requests with a different spoof. 

when i looped the code w/out killing it first the server would recognize what was happening so it would just ban my ip for a longer period of time. For some reason when i killed the program and restarted it this ban would not occur

so i needed the program to terminate then restart itself so that i could get around this ban problem i was having
Reply
#13
You can delay requests. Or you do your request, sys.exit() the program and run it again from a bash script.

#!/bin/bash

while :
    do
        python3 ./super-duper.py
        sleep 2
    done
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Is possible to run the python command to call python script on linux? cuten222 6 710 Jan-30-2024, 09:05 PM
Last Post: DeaD_EyE
  Call a bash script from within a Python programme Pedroski55 6 2,424 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,800 Jun-11-2019, 04:14 PM
Last Post: pcarra
  How to call a variable declared in a function in another python script lravikumarvsp 2 2,926 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,370 May-16-2018, 02:08 AM
Last Post: lravikumarvsp
  Python cmd function call from script John_O 10 9,799 Feb-18-2017, 04:45 PM
Last Post: John_O
  Windows: python script call over ssh -> output jb7731 2 5,344 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