python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
how to import packages properly in an __init__.py files?
I am having issues creating a basic library. This is my first time attempting this so a complete noob here. I am running a simple example case as shown below.
packagetest
|-> _init_.py
|-...
Sushi
Votes: 0
Answers: 0
Import specific items from module file in Python, while ignoring other imports in same module file?
Let's say I have this file as lib_my.py:
import smbus
main_array = [1, 10, 20, 100]
Now, I run this usually on Raspberry Pi Raspbian, where I have the smbus package.
However, now for a test, I'd lik...
sdbbs
Votes: 0
Answers: 0
swig-3.0.12 generates python2 style import statements
I am converting a large swig based codebase to python3. My current problem is that in-sub directories swig generates import statements as: 'import xxx' vs 'import dir_name.xxx'. The former causes impo...
uuu777
Votes: 0
Answers: 1
Is it possible to import a function from another script without importing the variables from such file?
I have two scripts 1 and 2, I would need these two script to work independently from one another, but I also need script 2 to be able to use the function in script 1 if needed. I tried to automate as ...
ArabJohnny
Votes: 0
Answers: 2