packing

Does PIP/Python support multiple versions of the same package?

旧时模样 提交于 2021-02-07 08:48:12
问题 Let's say I have a package foo , and foo packages up binary shared objects that I use in multiple Python scripts. Foo v1 (shared objects) Bar v1 (requires Foo v1) Baz v1 (requires Foo v1) Now I want to push out a new breaking update to Foo. Foo v2 (shared objects) Bar v2 (requires Foo v2) Foo v1 (shared objects) Bar v1 (requires Foo v1) Baz v1 (requires Foo v1) Can old-dependencies with different major versions in semvar be distributed over PyPI? If so, how? 回答1: Pypi can and will track

Does PIP/Python support multiple versions of the same package?

烈酒焚心 提交于 2021-02-07 08:46:16
问题 Let's say I have a package foo , and foo packages up binary shared objects that I use in multiple Python scripts. Foo v1 (shared objects) Bar v1 (requires Foo v1) Baz v1 (requires Foo v1) Now I want to push out a new breaking update to Foo. Foo v2 (shared objects) Bar v2 (requires Foo v2) Foo v1 (shared objects) Bar v1 (requires Foo v1) Baz v1 (requires Foo v1) Can old-dependencies with different major versions in semvar be distributed over PyPI? If so, how? 回答1: Pypi can and will track

python tkinter packing

大憨熊 提交于 2021-01-29 03:50:20
问题 Could someone please explain why when you have an plain widget as one line Code A works Entry(root, width=10).pack(side=LEFT,anchor=W) but when you name it or attach a command to it, Code A no longer works and gives you Error Message B self.my_entry = Entry(root, width=10).pack(side=LEFT,anchor=W) and you must pack using a seperate line? self.my_entry = Entry(root, width=10) self.my_entry.pack(side=LEFT,anchor=W) Code A self.my_entry.get() Error Message B AttributeError: 'NoneType' object has

Tuple declaration in Python

江枫思渺然 提交于 2021-01-27 04:39:41
问题 In python, one can declare a tuple explicitly with parenthesis as such: >>> x = (0.25, 0.25, 0.25, 0.25) >>> x (0.25, 0.25, 0.25, 0.25) >>> type(x) <type 'tuple'> Alternatively, without parenthesis, python automatically packs its into a immutable tuple: >>> x = 0.25, 0.25, 0.25, 0.25 >>> x (0.25, 0.25, 0.25, 0.25) >>> type(x) <type 'tuple'> Is there a pythonic style to declare a tuple? If so, please also reference the relevant PEP or link. There's no difference in the "end-product" of

Packing nested structs in C++

北战南征 提交于 2021-01-01 07:30:41
问题 Using Visual Studio 2017, the following gives... struct AAA // 15 bytes { double d; short s; char a1; char a2; char a3; char s4; char s5; }; struct BBB { AAA d; char a4; }; int main() { std::cout << sizeof(AAA) << "\n"; // gives 16 std::cout << sizeof(BBB) << "\n"; // gives 24 getchar(); return 0; } The Question is... how do I get sizeof(BBB) to be 16. 回答1: Use #pragma pack(push, 1) or #pragma pack(1) to enforce compiler not to line up structure members on 2 byte or 4 byte boundaries which

D3 pack layout with comparable parents

我们两清 提交于 2020-01-05 04:19:09
问题 we are trying to create a visualisation with D3 which represents a stock portfolios assets with relative sized weightings with 3 levels deep nested data. We have used D3 Pack and a zoom function such as this as a template https://bl.ocks.org/mbostock/7607535 The issue we are facing is D3 pack works from the children up the parent chain, and the parents sizes are not relative to each other due to the fact D3 pack tries to pack the children most efficiently as possible and depending on the