Skip to content

Tag: python

How can I import subpackage?

I have a file structure like this: Dir2.__init__.py have has the same code, but with .Something2 Something.py has simple add method, Something2.py has simple sub method. What I need: But I get an error AttributeError: module ‘Dir1’ has no attribute ‘Dir2’. If I use from .Dir2 import * …

Using Tkinter, Threading and After method

im working on a selenium project using tkinter in python. I want to execute many selenium task at one time(could be up to 100), so I used threading to accomplish this goal, but I came to a problem, due to the fact that I need all individual selenium task to wait a couple seconds between instructions, I used t…

Can’t i use the variable in a formula?

I’m coding a math model using gurobiy, but an error occurs. the error is ‘Var’ object cannot be interpreted as an integer. i tried to solve it using search, but I don’t have enough information. spi: required space of block i cft: area of factory f at t time s_Time : Start time p_Time :…

Why is there no module named queue in PyPy?

I need to use PyPy because speed is of the essence. I want to use priority queue and normally with Python I’d use queue module but PyPy gives me an error. error: Why is this module not available? I thought that PyPy is compatible with Python’s standard library. Answer Thanks to @user2357112support…