python class method invocation missing 1 required positional argument

I created class method to easen file reading. But the end result gives me error of file_read=Read_file.file_reading_through_class(‘./ConfigurationFile/configFile.csv’) TypeError: Read_file.file_reading_through_class() missing 1 required positional argument: ‘fileName’ the code is below; import pandas as pd import sys,os, time,re class Read_file(): def file_reading_through_class(self,fileName): if getattr(sys, ‘frozen’, False) and hasattr(sys, ‘_MEIPASS’): path_actual = os.getcwd() path_main_folder = path_actual[:-4] path_result =… Read More python class method invocation missing 1 required positional argument

How do i make a light dark specific css tag?

Light Dark Css body.light + .mat-medium { background: rgba(246,246,246,0.60); backdrop-filter: blur(30px) saturate(1); } <body class="light"> <div class="mat-medium"></div> </body> I was hoping that the div would display the mat-medium class because the body had the class light but it displayed a blank div. View the repl. >Solution : You need to fix your selector to select… Read More How do i make a light dark specific css tag?

fraction class in java

I created a fraction Java class but it gives wrong results. Sometimes it gives good answers and sometimes bad or maybe it doesn’t give any results just random digits? Any help or hints are welcome import java.util.Scanner; public class Ulamek{ public static void main(String[] args){ Scanner input = new Scanner(System.in); System.out.println("Podaj licznik i mianownik pierwszego… Read More fraction class in java

How to make a class where one attribute is a generated list of the attributes of another list in the class?

I have a class of prices in a store. It does not accept price_range as an input but I want it to produce a list of all the prices of the products for itself. { "mall": [ { "store_id": 1, "price_range": [], "products": [ { "product_id": 1, "price": 9.99 } ] }, { "store_id": 2,… Read More How to make a class where one attribute is a generated list of the attributes of another list in the class?

Why can I set properties during instantiation through __init__, but not through another method?

This is working class a: def __init__(self,ka,sif): self.ka = ka self.sif = sif def b(self): pass c = a("d","e") c print(c.ka,c.sif) but This is not working class a: def __init__(self): pass def b(self,ka,sif): self.ka = ka self.sif = sif c = a().b("d","e") c print(c.ka,c.sif) Why? I expected the get same result. Why these are not… Read More Why can I set properties during instantiation through __init__, but not through another method?

Flutter Class Auth error; When I'm creating this class I'm experiencing undefined class error

I was creating a class but I’m experiencing error as below. I do not understand I’m experiencing this error. I’ve added picture to see the error visually. import ‘package:firebase_auth/firebase_auth.dart’; Class Auth { final FirebaseAuth firebaseAuth = FirebaseAuth.instance; User? get currentUser => firebaseAuth.currentUser; Stream<User?> get authStateChanges => firebaseAuth.authStateChanges(); Future<void> signIn({ required String email, required String password,… Read More Flutter Class Auth error; When I'm creating this class I'm experiencing undefined class error

Class1 inside Class: Error: Page1.__init__.My_Data.__init__() got an unexpected keyword argument 'Name'

When i try to start my script, i get a error. I have main class Page1 and inside is My_Data class and function1 function. The error is: TypeError: Page1.__init__.<locals>.My_Data.__init__() got an unexpected keyword argument ‘Name’ MyCode.py: class Page1(tk.Frame): def __init__(self, master, other, **kw): super().__init__(master, **kw) self.configure(bg=’white’) class My_Data(): def __init__(self): self.Name: str self.Year: float def… Read More Class1 inside Class: Error: Page1.__init__.My_Data.__init__() got an unexpected keyword argument 'Name'

Why does the value of this class variable persist even after resetting it?

I have the following code, which is executed multiple times on different binary trees class Solution: ans = [] def getLonelyNodes(self, root: Optional[TreeNode]) -> List[int]: def helper(root): if root.left is None and root.right: self.ans.append(root.right.val) return helper(root.right) if root.left and root.right is None: self.ans.append(root.left.val) return helper(root.left) if root.left and root.right: return helper(root.left), helper(root.right) if root.left is… Read More Why does the value of this class variable persist even after resetting it?

How to replace a commas with periods in text for decimal numbers in python

To replace commas with periods in text for decimal numbers in Python, you can use the `replace()` method of the `string` class. Here is an example of how you could do this: This will print the following output: Keep in mind that this will only work if the commas are used as decimal separators. If… Read More How to replace a commas with periods in text for decimal numbers in python