All Questions
216 questions
0
votes
1
answer
49
views
multiple `thisArg`s with module function?
There are lots of questions on here about this, but "multiple this args" is getting me answers about how to declare multiple properties under this, which isn't what I'm after. If this is ...
0
votes
0
answers
36
views
How to connect graphical interface with tcp server class
I am trying to create a local cloud for my family.I have 2 classes:TcpServer class:
public class TcpServer
{
ServerSocket s;
Socket[]sockets = {};
GUIHandler guiHandler;
String ...
1
vote
1
answer
148
views
__call__ method as classmethod not working?
I was wondering why the call method inside of my class was not functioning when i declared the function as a classmethod.
Here is an example:
class Foo:
bar = 0
@classmethod
def __call__(...
-4
votes
1
answer
120
views
How Would I Call Class1 method to Class 2 So I can Print it out on class 2
I have 2 Class here. One that creates the random number and one that prints out the random number except class 2 cannot retrieve the random number and I'm not sure why, any help?
{
class Class1
...
0
votes
1
answer
54
views
Why I cannot call the object function from other class?
As the title mentioned.
Why the main class unable to call the event.java function and print out the message i want it to print? Is there anything I missing for that? Many Thanks.
App.java: (The main ...
-1
votes
3
answers
80
views
my code give my this errore after call it takes 1 positional argument but 3 were given
class Samadateconverter:
def __init__(self, y , m , d ):
self.y = y
self.m = m
self.d = d
def gregorian_to_hijri(self):
# Calculate the Julian ...
0
votes
0
answers
41
views
class variable doesn't update after __call__
I have probably an easy question. Why if I run get_predictions method inside print it gives me [] and not a [1,2,3]? Value assignment should be done at object creation (__call__).
class Learner():
...
-1
votes
1
answer
98
views
Dynamically change class call path?
In the code below, is it possible to dynamically call MyFunction() by changing OtherClass1 with strings a and b?
string a = "OtherClass1", b = "OtherClass2";
myClass = new MyClass(...
0
votes
0
answers
27
views
call class attributer in a class menu
I am probably making a big mess right now... But I want to create a menu that can activate different classes that holds attributes. What would be the easiest way to write this?
import replit
class ...
3
votes
2
answers
2k
views
Why use constructor at all?
I came across the thought that I honestly never had to use class nor constructor all this time and started to wonder if there are cases where I should use them? For example, below codes are basically ...
1
vote
0
answers
668
views
Why am I getting "__call__: missing one positional argument", when I pass the correct number of arguments?
I am getting the following pytest error:
@pytest.fixture
def mts_parser():
"""MTS parser fixture
"""
mts = exchanges.get("MTS.CASH", ...
0
votes
1
answer
1k
views
Can you create a list of class objects and use class functions that way?
I am trying to create a list of class objects, so that I can access functions and properties of a class/object by refering to that list. I looks something like this:
class Modul:
def __init__(self, ...
1
vote
1
answer
239
views
How to write Kotlin class in one project and call this class in other Kotlin project (All in Kotlin)?
I am new to Kotlin and I am struggle with the designing of one Kotlin project that its classes and functions can be called from other Kotlin project. The language I use is pure Kotlin.
What is the ...
1
vote
1
answer
2k
views
Python how to call function base on different input value in a class?
I have a class with multiple functions. Given an id outside the class, is it possible to call a function based on the id value?
For example,
if id = 1, run fun1
if id = 2, run fun2
class functions:
...
1
vote
1
answer
394
views
How to call/instantiate linked list
I am trying to call/print the following linked list:
#--the following code is taken from the most upvoted solution at codesignal--
class ListNode(object):
def __init__(self, x):
self.value = ...