Onaylı Üye
I made this quick tool that just opens up a website a specified amount of times. You can use this as a template for your own code to run it on different websites like in Code Block 2 (which basically does the same thing), or you can repurpose the organization because I think I did pretty well on the organization/assembly of the logic behind this.
Code Block #1
Code Block #2 (Just about the same thing, just showing how you can manipulate this to do what you want)
If you see any problems with the code or have any suggestions on how you would optimize or change it in any way. I would love constructive criticism.
Code Block #1
Python:
### Imports Go Here ###
import time
import os
import webbrowser
### Define VARiableS Here ###
clear = lambda: os.system('cls')
chrome_path = "C:/Program Files/Google/Chrome/Application/chrome.exe %s --incognito"
uAmt = ""
uW = ""
uH = ""
x = ""
### Functions ###
def start():
clear ()
print ("Welcome to Trainer Cheddars Random Photo Finder")
print ("This small program is designed to grab random images in the internet for you (at your size specifications)")
print ("If you have any questions regarging anything ask @Trainer Cheddar#2174 on discord")
print ("PLEASE check the README before you send me a DM")
wait = input ("Press Enter to continue...")
def userAmount():
clear ()
print ("Type Desired AMOUNT of Images")
def userWidth():
clear ()
print ("Type Desired WIDTH of Images")
def userHeight():
clear ()
print ("Type Desired HEIGHT of Images")
def uRange():
for x in range(uAmt):
chromeOpener()
def chromeOpener():
webbrowser.get(chrome_path).open("https://picsum.photos/" + (uW) + "/" + (uH) + "/?random")
### Main Program Logic ###
start()
while True:
userAmount()
uAmt = int (input (""))
userWidth()
uW = str (input (""))
userHeight()
uH = str (input (""))
uRange()
Code Block #2 (Just about the same thing, just showing how you can manipulate this to do what you want)
Python:
### Imports Go Here ###
import time
import os
import webbrowser
import psutil
### Define VARiableS Here ###
clear = lambda: os.system('cls')
chrome_path = "C:/Program Files/Google/Chrome/Application/chrome.exe %s --incognito"
uAmt = ""
x = ""
### Functions ###
def start():
clear ()
print ("Welcome to Trainer Cheddars Infinite Random Photo Finder Possibly NSFW Edition")
print ("This small program is designed to grab random images in the internet for you")
print ("If you have any questions regarging anything ask @Trainer Cheddar#2174 on discord")
wait = input ("Press Enter to continue...")
def chromeOpener():
webbrowser.get(chrome_path).open("https://r.sine.com/index")
def chromeCheck(exename='chrome.exe'):
for proc in psutil.process_iter(['pid', 'name']):
if proc.info['name'] == exename:
print ("Chrome is running")
else: chromeOpener()
### Main Program Logic ###
start()
while True:
chromeCheck()
If you see any problems with the code or have any suggestions on how you would optimize or change it in any way. I would love constructive criticism.