I need to automate a cross-platform application build. Entire build runs on Windows machine. Part of it is written in Python and compiles for OS X. Currently this part of build is done manually on OS X. I tried pyinstaller but it looks like it only building for the platform that it is running on. I also tried…
Tag: python
pymongo: remove duplicates (map reduce?)
I do have a Database with several collections (overall ~15mil documents) and documents look like this (simplified): They all have an unique _id field as well, but I want to delete duplicates accodring to another field (the external ID field). First, I tried a very manual approach with lists and deleting after…
Python grpc protobuf stubs generation issue: –grpc_out: protoc-gen-grpc: Plugin failed with status code 1
As the question says, I compiled grpc from source and also did sudo pip install grpcio, however, the which grpc_python_plugin doesn’t return anything. This is a problem because the grpc python example for route_guide requires me to run protoc -I . –python_out=. –grpc_out=. –plugin=prot…
Accessing a structure element in Python
I’m having trouble accessing a structure element. Notice that I have read something into the structure using sscanf (to simulate my actual routine) but Python does not seem to realize that. So I added a statement to assign a value, then Python realizes there is something there. This only happens when I&…
Exception in Boto3 – botocore.exceptions.EndpointConnectionError
When trying to connect to a database with this python code to test the connection. I am getting this error thrown at me. The strange part is that the connection was working earlier in the day and then at it stopped working the same thing happened to me yesterday at the same time so I am assuming it is a
Converting pandas.DataFrame to bytes
I need convert the data stored in a pandas.DataFrame into a byte string where each column can have a separate data type (integer or floating point). Here is a simple set of data: and df looks something like this: The DataFrame knows about the types of each column df.dtypes so I’d like to do something li…
NetworkX: How to find the source and target nodes of a directed edge
dito above.. I couldn’t find anything in the NetworkX docs… In Python Igraph, i can just use: Answer Event though I came too late I want to contribute with my proposal, since I was looking for the same answer: I am also looking for a command in the networkx package to find the “sources”…
Beautiful Soup if Class “Contains” or Regex?
If my class names are constantly different say for example: Normally I could do: There are way too many class names to work with here so a bunch of these are out. I know Python doesn’t have a “.contains” I would normally use but it does have an “in”. Though I haven’t been a…
Urwid: make cursor invisible
I’m using urwid, which is a Python “framework” for designing terminal user interfaces in ncurses. There’s one thing though that I’m not able to do in urwid that was easy in curses – make the cursor invisible. As it is now, the cursor is visible when selecting buttons, and i…
Is there a chain calling method in Python?
Is there a function in Python that would do this: by typing this (for example): I just figured, since python is (arguably) a functional language the function I’m looking for will make syntax brighter Answer Use the reduce() function to chain calls: I used the forward-compatible functools.reduce() functi…