Tagged Questions
0
votes
2answers
29 views
How do I provide proper arguments for a class?
I have this code I am playing with but have no idea on how to call it?
class Slide:
def __init__(self, pictureFile, soundFile):
self.picture - makePicture(pictureFile)
self.sound = ...
1
vote
3answers
27 views
Importing functions from classes outside original file
I'm working on a text based adventure game. One of the things that I want to do, is build the game using classes, have the main data classes in a separate file, and then have the actual main loop that ...
0
votes
1answer
41 views
How to get the value of a dictionary declared inside a class as a local variable with Python
I am wondering how can I get the value of a dictionary declared as local variable inside a class? look at my source below.
Note: If I declare this variable inside the function get_current_weather it ...
1
vote
1answer
20 views
python objectlist adds to all objects
I'm trying to have a class (dprObject) that is a container for several dprVariables
each variable has a list with integers (for now)
but when I change something to one variable, it changes to all the ...
1
vote
2answers
20 views
Override multiple methods with a wrapper (Python 3)
In my effort to subclass float and override multiple numeric operations with a wrapper, I looked at this example and tried the following:
def naturalize(*methods):
def decorate(cls):
for method ...
-1
votes
0answers
48 views
In Python, what are classes, objects and methods? [closed]
Can I just have a simple beginner's (I'm not, but everything I've read describes it in very technical terms) definition of a class, an object and a method.
I think a class is a group of functions ...
1
vote
0answers
28 views
Class Inheritance: could you explain this behavior? [duplicate]
In my program, I have different classes that all inherit from the same one. These classes process different kind of operations, they store the operations in an inherited attribute, and then sometime ...
0
votes
3answers
45 views
Python Method Call
class AlarmBox(Widget):
hour = ["12","1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"]
tensMin = ["0", "1", "2", "3", "4", "5"]
onesMin = ["0", "1", "2", "3", "4", "5", "6", "7", ...
0
votes
2answers
48 views
Python 2.7 - Classes
I'm trying to edit a library in python (perfmon) - the file is session.py
I want to add a module that can record some readings from a USB port.
This is also my first trial with classes in python
...
0
votes
3answers
70 views
Python: Child instance class of an instance of Parent Class
I am new to OOPS
I want to know when a Parent Class instance P is initialized and I want to initialize a child class instance C
like
class A(object):
def __init__(self):
print "A ...
1
vote
2answers
46 views
Python: how to save a list with objects in a file?
im trying to create diferent objects (using Clases and objects) and saving them in a file to edit or retrive them later. However this how it looks.
GlobalCategories=[]
GlobalContent=[]
def ...
0
votes
3answers
27 views
Removing an entry from a list (class[function])
I'm using a class which has a function with the following code:
#delete the specified entry from the list if entry in list
def deleteEntry(self,entry):
if entered in self.alist():
...
5
votes
2answers
82 views
Python : why a method from super class not seen?
i am trying to implement my own version of a DailyLogFile
from twisted.python.logfile import DailyLogFile
class NDailyLogFile(DailyLogFile):
def __init__(self, name, directory, rotateAfterN = ...
0
votes
1answer
12 views
Problems Remains inserting two different classes within the same frame into a notebook using Tkinter and Python
yesterday I was having a problem inserting two different classes into a notebook. unfortunately the problem still remains. You can find it following the link below:
Problems inserting two different ...
2
votes
3answers
76 views
Why are parent constructors not called when instantiating a class? [duplicate]
class A:
def __init__(self):
print 'A'
class B(A):
def __init__(self):
print 'B'
b = B()
B
In C++, I would have expected to see A B output, but in Python I am getting ...