It looks that some users cannot do "from freecad import app". I know some windows users for which is is the case, cf. https://forum.freecadweb.org/viewtopic. ... 36#p280485.
I don't have problems with it on Ubuntu:
OS: Ubuntu 18.04.1 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.15592 (Git)
Build type: Release
Branch: master
Hash: a7c0f4bc5b62ec304a5855796ca3d10a42c7a46e
Python version: 2.7.15rc1
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
I though that "from freecad import app" was the way to go because it is more pythonic and that the changes associated to the possibility to import "app" from module "freecad" also allowed to install add-ons with pip.
There should be only one way to import freecad modules and it should work everywhere. Of course, I would prefer "from freecad import app" as you understood.
Thanks for any feedback, especially on other operating systems.
Gaël
"from freecad import app" everywhere
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
-
- Posts: 437
- Joined: Wed Sep 15, 2010 9:38 am
-
- Posts: 437
- Joined: Wed Sep 15, 2010 9:38 am
Re: "from freecad import app" everywhere
Any reaction or decision on this?
Re: "from freecad import app" everywhere
For existing macros i am guessing:
Should do.
P.S. Using the new import style, porting the existing macros, would lead to things like dropping FreeCAD 0.16 support and investing effort with little benefit in return. As for the new macros, that do want to use the new import style. Or i guess if somebody wants to make a macro available with pip. I agree there should be a straightforward guideline on what to use, and that should work everywhere.
Code: Select all
import FreeCAD as App
P.S. Using the new import style, porting the existing macros, would lead to things like dropping FreeCAD 0.16 support and investing effort with little benefit in return. As for the new macros, that do want to use the new import style. Or i guess if somebody wants to make a macro available with pip. I agree there should be a straightforward guideline on what to use, and that should work everywhere.