Python Forum
Help | Classes to use in real world
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help | Classes to use in real world
#4
Here's an example of a simple script I made using PyAutoGui

import pyautogui as pag

pag.FAILSAFE=True

#Call Chrome
pag.hotkey('command', 'space')
pag.typewrite('Chrome\n', 0.25)
pag.moveTo(412, 81, duration=2)
pag.click(button='left')
pag.typewrite('target_site_example.com\n')
pag.moveTo(927, 431, duration=5)
pag.click(button='left')
pag.moveTo(286, 132, duration=5)
pag.click(button='left')
pag.click(button='left')
pag.moveTo(1206, 946, duration=5)
pag.click(button='left')
pag.moveTo(1797, 587, duration=5)
pag.click(button='left')

pag.moveTo(768, 137)
pag.click(button='left')

# #Scrolling to second section
pag.scroll(-50)

# #Scrolling and click to sort rankings
pag.moveTo(1189, 735, duration=5)
pag.click(button='left')

# # Fire up Nimbus
pag.moveTo(1146, 84, duration=5)
pag.click(button='left')

# # Screenshot Entire Page
pag.moveTo(995, 331, duration=5)
pag.click(button='left')
What I meant was how can I wrote that in a Class kind of fashion? As I am really a bit confused since that module is already a class, what's the point in making a Class off of a already Class. And yes, I can't get my head around on how can I construct it to Class. How you guys that are well-rounded in Python can make a Class type script from that module?

Also, since I've mentioned they are all (probably most are written in Class) so whenever we create one then we always call's for inheritance, right?

If you can make that script I had wrote to a class and include in your response, that would be very, very helpful to me to study on how you guys construct a Class off of something/module.

Thanks for the response @Gribouillis & @perfringo
Reply


Messages In This Thread
RE: Help | Classes to use in real world - by soothsayerpg - Jul-06-2019, 07:44 AM
RE: Help | Classes to use in real world - by nilamo - Jul-08-2019, 07:30 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  World Clock syntax error OscarBoots 1 141 May-03-2024, 05:20 AM
Last Post: snippsat
  Hello World! rufenghk 0 984 Jun-02-2022, 09:48 PM
Last Post: rufenghk
  Very new to Python world daveseaman 0 1,496 Jun-25-2021, 07:17 PM
Last Post: daveseaman
  running python hello world Avarage_Joe 8 5,318 Apr-13-2018, 04:20 PM
Last Post: Avarage_Joe
  Hello world! program, window disappears nerio 3 5,667 Mar-16-2018, 07:03 PM
Last Post: knackwurstbagel
  Using classes? Can I just use classes to structure code? muteboy 5 5,107 Nov-01-2017, 04:20 PM
Last Post: metulburr
  'Hello, World!' Problem - Urgent OmarSinno 7 4,644 Sep-07-2017, 06:22 AM
Last Post: OmarSinno
  how to generate random 3d world (like minecraft) in python hsunteik 3 105,186 Jan-06-2017, 06:35 PM
Last Post: metulburr
  Hello World issues when using %% with ipython landlord1984 5 8,983 Dec-11-2016, 10:11 PM
Last Post: Yoriz

Forum Jump:

User Panel Messages

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