Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Call a variable
#16
I'm beginning to see now. You never instantiate your classes. When you want to persist data, you pickle it and then unpickle it again later. You are not using classes anything like they were intended to be used. It is no wonder that you are running into problems.

If you don't instatiate your classes, you can't save data in instance attributes using self. The only way to store data would be to make meth22 a class method, with a cls paramter instead of a self parameter, and then store it as a cls attribute. But that's just extra effort for no real gain.

You really need to go through a tutorial on classes, and you need to get a better understanding of the object-oriented programming paradigm. Then you need to rewrite your code from the ground up.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
Call a variable - by jmf08 - Jan-16-2019, 03:48 AM
RE: Call a variable - by ichabod801 - Jan-16-2019, 03:52 AM
RE: Call a variable - by jmf08 - Jan-16-2019, 04:41 AM
RE: Call a variable - by ichabod801 - Jan-16-2019, 03:36 PM
RE: Call a variable - by woooee - Jan-16-2019, 10:07 AM
RE: Call a variable - by jmf08 - Jan-16-2019, 12:38 PM
RE: Call a variable - by jmf08 - Jan-17-2019, 01:10 PM
RE: Call a variable - by ichabod801 - Jan-17-2019, 01:59 PM
RE: Call a variable - by jmf08 - Jan-17-2019, 02:12 PM
RE: Call a variable - by ichabod801 - Jan-17-2019, 03:11 PM
RE: Call a variable - by jmf08 - Jan-17-2019, 04:16 PM
RE: Call a variable - by ichabod801 - Jan-17-2019, 04:30 PM
RE: Call a variable - by jmf08 - Jan-17-2019, 04:39 PM
RE: Call a variable - by ichabod801 - Jan-17-2019, 04:44 PM
RE: Call a variable - by jmf08 - Jan-17-2019, 04:54 PM
RE: Call a variable - by ichabod801 - Jan-17-2019, 05:57 PM
RE: Call a variable - by jmf08 - Jan-18-2019, 05:50 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Simple automated SoapAPI Call with single variable replacement from csv asaxty 1 2,145 Jun-30-2020, 06:38 PM
Last Post: asaxty
  variable call back into an array yamifm0f 3 2,443 Jun-07-2019, 02:44 PM
Last Post: heiner55
  call a variable from one function to another ... evilcode1 4 4,052 Sep-16-2018, 10:50 AM
Last Post: gruntfutuk
  How to call a variable declared in a function in another python script lravikumarvsp 2 2,984 Jun-04-2018, 08:45 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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