Python Forum
Not having to rewrite 'obj.' on each line
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not having to rewrite 'obj.' on each line
#2
No. Even using a context manager, you'd just be substituting. Obviously you could create a function that could take a class/instance and call methods for that. Examples on SO.

Are you trying to save on typing?
I am trying to help you, really, even if it doesn't always seem that way
Reply


Messages In This Thread
RE: Not having to rewrite 'obj.' on each line - by gruntfutuk - Sep-29-2018, 09:24 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Optmized way to rewrite this very slow code liva28 0 1,514 Jul-18-2021, 12:16 PM
Last Post: liva28
  Cleaner way to rewrite fakka 5 3,142 Dec-05-2019, 04:53 AM
Last Post: stullis
  How do I rewrite this .bat file code onto Python? SteampunkMaverick12 4 2,914 Nov-02-2019, 11:28 PM
Last Post: snippsat
  Rewrite a function to make it work with 'bottle-pymysql' nikos 1 2,017 Feb-26-2019, 02:59 PM
Last Post: nikos
  piexif rewrite exif data yawstick 2 3,358 Oct-09-2018, 08:56 PM
Last Post: yawstick
  How to rewrite image file name based on ocr data.txt kevinchr 0 3,670 Apr-16-2018, 07:09 PM
Last Post: kevinchr
  how do i rewrite this code to give me 10 outputs BlackPimpernel 2 2,722 Mar-29-2018, 11:29 AM
Last Post: BlackPimpernel
  Rewrite variable every n times andrea0913 0 2,631 Aug-20-2017, 05:54 PM
Last Post: andrea0913

Forum Jump:

User Panel Messages

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