Questions tagged [init]

May refer to Linux init, an abbreviation of initialization - giving variables a "starting" value, or Python's __init__ class initiation method.

init
Filter by
Sorted by
Tagged with
2 votes
1 answer
30 views

Run a function just after init() completes in Swift

I am testing to run delegation pattern from initializers. Here is my data supplier test class and its' data source : protocol MyClassDataSource : AnyObject{ func returnString(string: String) } ...
incelemeTRe's user avatar
0 votes
1 answer
17 views

Why is my custom.rc file not executing frida-server while it is being executed?

I am trying to run frida-server on boot on LDplayer Android 9. For this I found this post I have used the INIT method and created a custom.rc file: #/etc/init/custom.rc # execute the binary when ...
Martijn Deleij's user avatar
0 votes
0 answers
26 views

Unable to run Flask application after adding __init__.py to root folder

New to python and Flask development. I have an application algo.trader located at ~/algo.trader. I am trying to use the Application Factory pattern to initialize the app using a create_app() function ...
Sriram's user avatar
  • 10.4k
0 votes
1 answer
38 views

List > numpy.ndarray using np.array(list) not working in class __init__ . Problem with numpy?

I'm currently building a class called 'system' that takes in 4 arguments: A, B, C, D which are matrices of a state-space system. The intent is that the user can input these using nested built-in <...
IsaacB's user avatar
  • 11
-1 votes
2 answers
44 views

How to relative import a package create by me using python and strucure it better? [duplicate]

Hi I'm creating a package/Module (hysysview), I have created some tests so that I can test the packages, therefore I need to import the module, however, I'm getting this error when I import HysysCOM....
andguez's user avatar
  • 11
0 votes
1 answer
41 views

Python calling function defined in __init__.py not working [closed]

I created sub folder module1 with just __init__.py def print_hello(): print('Hello') __all__ = ["print_hello"] print('Init loaded') inside main.py i have import module1 print_hello() ...
Roman Toasov's user avatar
0 votes
1 answer
43 views

Getting imports right using grpc

I know, this question was probably asked a lot. I consider myself a newbie on Python and sometimes I don't quite get how the importing system works. Especially in my case I have not found any ...
CSharper96's user avatar
0 votes
1 answer
34 views

Parameter in subclass without init-block is null although parameter was non-null

I have two classes that control buttons in Android. SortingButton class for a simple Button with which you can choose ascending/descending sort open class SortingButton( protected val context: ...
Owlon's user avatar
  • 5
0 votes
0 answers
34 views

Circular import issue on multiple python files

I'm currently making an arcade-like system game with python. I separated my project into multiple files. gtn.py is responsible for the "Guess the Number" game. startup.py was supposedly used ...
ClamorBits's user avatar
0 votes
2 answers
81 views

mutiple inheritance: use __init__ method of two superclasses

I want to make multiple inheritance, making a subclass inherit from two different super classes. This subclass should have an __init__ method in which the __init__ methods of the super classes are ...
Arkeor's user avatar
  • 29
1 vote
0 answers
21 views

Python: load resources without using __init__.py files

I have a directory of JSON Schema files that's distributed with a python package. Some code in the package uses the schema files to validate data. The way I'm currently loading the schema files is ...
Ken Williams's user avatar
  • 23.4k
1 vote
3 answers
120 views

how to use setter/getters during init()?

I've never quite grasped what's going on with init(). Is there a clean, simple way to achieve what I'm trying to do in the code below ? Edit: I'd like to avoid duplicating the data = value / 2 logic, ...
orion elenzil's user avatar
0 votes
1 answer
91 views

Fastapi with tortoise-orm models early init models still not found

I am new to API dev, and I am trying to use tortoise-orm with fastapi but with a bit different folder structure (for user model for example src-> models->user.py): project structure The main.py ...
ramrane's user avatar
0 votes
3 answers
1k views

AttributeError: module 'pinecone' has no attribute 'init'

I am following the Pinecone API and I received this error message: Traceback (most recent call last): File "/Users/leonardjin/Dev/lodge/openAI/collegeAssistant/academicAssisstants/apush/...
Leonard Jin's user avatar
0 votes
0 answers
11 views

can't find self.connection.report documentation for comet_ml

I installed comet_ml on conda and after trying to run my code, it's giving the error File "/Users/christhomas/miniforge3/envs/condenv/lib/python3.11/site-packages/comet_ml/__init__.py", ...
Christian's user avatar
0 votes
0 answers
23 views

Accidentally Modified tkinter Module: How to Restore Original State?

I’ve accidentally deleted all the content in the __init__.py and commandialog.py file in python tkinter. Someone please tell me how to overcome or just give me the code so I can paste it. I am ...
Haris Bin Nasir's user avatar
0 votes
0 answers
32 views

first time installing sanity and having a error which shows as following

Trying to install **sanity **for the first time I am facing error when init, start etc. Can anyone suggest me the answer. I tried to search it everywhere but unable to find it. Error: Error while ...
Abdul Kaif's user avatar
0 votes
0 answers
8 views

'int' is not callable on my Object with a custom Function

I'm learning Objects & Classes and am doing some practice. I've essentially done the exact same thing before but now with different names for my Classes and Objects. Here's my code (the error ...
J_D's user avatar
  • 1
-2 votes
1 answer
454 views

Why are goGTK widgets not initialized in the init() function?

I am using Go 1.21.4 on a Windows 11 Pro machine and GTK 3 binding for Go. Simple sample code: package GTKView import ( "github.com/gotk3/gotk3/gtk" ) var mToolbar *gtk.Toolbar func ...
Gramps's user avatar
  • 11.3k
-1 votes
1 answer
60 views

Amplify init UnauthorizedException

I am learning about amplifier using below documentation https://docs.amplify.aws/angular/start/getting-started/installation/ https://docs.amplify.aws/angular/start/getting-started/setup/ But while ...
Ash's user avatar
  • 1
0 votes
0 answers
127 views

super.__init__() either complains about too many positional arguments or KeyErrors

I'm trying to generate an FMU using pythonfmu, but I'm having problems with my init(). I've also added the main code, where the the class FmuGenerator gets initialized: My Application opens a gui ...
till12mann's user avatar
0 votes
0 answers
41 views

Swift - function paramter of type Data can't be stored in local state variable [duplicate]

@State private var selectedPhotoData: Data? init(friendID: String, friendUsername: String, friendName: String, friendBio: String, friendSelectedPhotoData: Data?) { self.id = ...
Student's user avatar
  • 89
0 votes
0 answers
41 views

HAL define bug with STM32WLE5CCU microcontroller

Im trying to use interrupts from UART DMA and SubGhz with STM32WLE5CCU in STM32Cube IDE. I noticed that I don’t get interrupts from both when I don’t define delay time between the configurations. The ...
hezki's user avatar
  • 1
0 votes
0 answers
25 views

How to deal with the relative path in spyder

I have an ImportError when I run a python file in spyder that have "form .tool import *" althought, the __init__.py exist in all directory of the package. I want to run a python file in ...
Tarek's user avatar
  • 1
-3 votes
3 answers
75 views

does __new__ over ride __init__ in python

I have the following code: class Demo: def __new__(self): self.__init__(self) print("Demo's __new__() invoked") def __init__(self): print("Demo's ...
DCR's user avatar
  • 15.3k
1 vote
0 answers
166 views

Why is my customtkinter Frame's width not working?

Okay so I'm trying to make a Sidebar using customtkinter, but I can't set the width of the frame. Every other property that I'm defining in the __init__ function works, but width and height don't. My ...
Bird's user avatar
  • 29
0 votes
1 answer
68 views

Override parent init block in Kotlin

When i create instance of a subclass i don't want parent's class init block to print the message. Example: fun main() { var instance2 = Child() } open class Parent() { init{ println(&...
NeoRuss's user avatar
0 votes
0 answers
28 views

Python Module not recognized in same folder

I'm trying to import my class ODSFileExtractorfrom my file ods_extractor.py into my main.py. For that reason I have an __init__.py in my odsrw folder where I import the class. However, I seem unable ...
schwitzky's user avatar
1 vote
1 answer
52 views

Why does Python recognize my imports and sometimes not?

My imports are acting strangely depending where I run Python. I have a project with the following structure: repo-name |_ .github |_ actual_code |_ __init__.py |_ main.py |_ constants.py |_ ...
Luca Mircea's user avatar
0 votes
0 answers
96 views

name 'objc' is not defined in pyttsx3.init()

I'm working on a project for university, it's a voice assistant with python. And in the debug when starting pyttsx3.init() I get the error name 'objc' is not defined. Does anyone know how to fix it? ...
Luis Angel Eleazar Santiago's user avatar
0 votes
1 answer
874 views

Create a react native app with javascript instead of typescript

I recently tried to crate a new react native app by using the ` npx react-native@latest init AwesomeProject ` command but it created a folder with a app.tsx file. How can I force it to create a app.js ...
FireKill213's user avatar
0 votes
0 answers
25 views

Missing argument for parameter 'from' in call. Insert 'from: <#Decoder#>' while model already consists of decoder

I am trying to create a variable and initializing it in the init of class that consists of first object of a Codable Struct Array @Published private var CoreData: [WeatherModel] self.model = CoreData....
Izza Khawar's user avatar
0 votes
1 answer
42 views

passing args to threading.Thread to a CLASS without override class self?

Pretty sure that this should be a simple noob thing or a conceptual confusion of mine but I am not seeing it. Context: I need to do several focused plotly figures from a HUGE figure (used as base ...
Carlos's user avatar
  • 27
0 votes
1 answer
219 views

inheriting all __init__ arguments' type hints from parent class

note: my question could be duplicated or nonessential, or I could even be wrong the whole time. but I couldn't search it because it was a rabbit hole and I need someone's advice. Hi, it's my first ...
Abdulrahman Sheikho's user avatar
0 votes
1 answer
109 views

buildroot inittab spawns multiple processes even though its not dead

I have a buildroot inittab run by busybox init with following entry. ::respawn:/sbin/abcd -C /tmp/abc.conf If I remove above line and start process manually, "/sbin/abcd -C /tmp/abc.conf" ...
RootPhoenix's user avatar
  • 1,707
0 votes
0 answers
65 views

How to attach a Python Notebook to a Databricks cluster's Init Script

I would like to have a python notebook stored as a Databricks Workbook loaded when I startup a particular cluster to that specified python functions are automatically loaded into any workbook that I ...
Andrew Hicks's user avatar
0 votes
1 answer
389 views

Swiper thumbnail navigation do not work in build mode work in dev mode react next js application

in local mode swiper thumbnail navigation work but in build mode initial slide is not set active and thumbnail navigation do not work but its work through arrow click . in local its work through thumb ...
Rakesh Tiwari's user avatar
1 vote
1 answer
48 views

Aws python lambda returns same result

I have my python code deployed to aws lambda where I get the same response no matter how many times I trigger it even with different inputs. Here is my code: handler.py import lambdaLogicClass from “./...
Bratty Neal's user avatar
2 votes
2 answers
623 views

Can I skip the init method in golang?

I run unit tests in debug mode in a large project. However, this project references too many libs, which causes me to execute the init functions of these libs first when executing a single test. This ...
guohuang zhan's user avatar
0 votes
1 answer
35 views

Multiple constructors with different parameters in Python [duplicate]

I am getting an error in the following code. I used to write the same and it was working correctly. We can do multiple constructors with different parameters. When we run the program, the constructor ...
Salma bukhari's user avatar
0 votes
0 answers
134 views

InitContainer read-only issues in configuring vm.max_map_count

An init container is unable to get completed. It's giving me a sysctl: setting key "vm.max_map_count": Read-only file system error initContainers: - name: sysctl image: busybox ...
titanium1905's user avatar
0 votes
0 answers
243 views

starting init: /bin/sh exists but couldn't execute it (error -8)

I'am building Root filesystem for the Linux Kernel(6.2.11). I want to compile the GNU Bash Shell(4.1) as the init program of the system. I built bash and installed it to the path /bin/, then linked /...
nut Cautious's user avatar
-1 votes
1 answer
36 views

Python Custom Class __init__ not initializing class instance variables

Custom Python class __init__ function not properly generating variables or calling functions. I have the following code which I wish to use to store and manipulate information about a mesh face. I'm ...
Decaff_42's user avatar
0 votes
1 answer
168 views

Cannot import from my custom python package. ModuleNotFoundError: No module named 'a_python_file_inside_my_custom_module'

I am trying to build a python package following this tutorial. So I have made a base folder, then a module folder, then inside it I have placed the file starting_template.py, which contains the ...
Tms91's user avatar
  • 3,722
0 votes
1 answer
24 views

How to know if init operation of empty data structure costs us O(1) or more? (on general)

I didn't find resources about how to choose the time complexity of init of empty data structure. I know it is based on implementation and programing languages, but I assume there are conventions. For ...
Daniel Mass's user avatar
2 votes
1 answer
1k views

ERROR: module or package not found: esmf (missing __init__.py?)

I followed the instructions to install xesmf (https://xesmf.readthedocs.io/en/latest/installation.html). conda create -n xesmf_env conda activate xesmf_env conda install -c conda-forge xesmf conda ...
Diego Santos's user avatar
4 votes
0 answers
396 views

SwiftData - 'self' used in property access 'persistentBackingData' before 'super.init' call

I was trying to set a class to be a persistent data source using @Model annotation, and somehow this happened: The code above is generated by the compiler and the error is located in it. Here is my ...
catmotionmachine's user avatar
0 votes
2 answers
166 views

push to git remote repo using a local copy

Given an existing private remote repository, to which I have access to, which contains only a README.md and a .gitingore file. Lets call this repo "myRepo". Locally on my machine, I created ...
Simon's user avatar
  • 313
0 votes
0 answers
132 views

Why is the mount() syscall not picking up a selinuxfs path?

I am trying to port Android to an x86 device, but the question should be universal. My kernel tree is the android13-5.15 (so kernel 5.15) branch, and I am using the LineageOS source code from the ...
TheNXGuy's user avatar
2 votes
2 answers
48 views

Is it possible to limit init values for ExpressibleByIntegerLiteral struct?

I want to implement Digit struct which should be initialized by integer literal. Like: let digit: Digit = 5 But swift shouldn't allow doing this (or, as an option, an exception should be raised): let ...
Alexey_BH's user avatar
  • 133

1
2 3 4 5
39