Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations. Closed 1 year ago. Improve this quest…
Tag: python
Are all Python objects tracked by the garbage collector?
I’m trying to debug a memory leak (see question Memory leak in Python Twisted: where is it?). When the garbage collector is running, does it have access to all Python objects created by the Python interpreter? If we suppose Python C libraries are not leaking, should RSS memory usage grow linearly with r…
Finding points on a rectangle at a given angle
I’m trying to draw a gradient in a rectangle object, with a given angle (Theta), where the ends of the gradient are touching the perimeter of the rectangle. I thought that using tangent would work, but I’m having trouble getting the kinks out. Is there an easy algorithm that I am just missing? End…
Tkinter: Mouse drag a window without borders, eg. overridedirect(1)
Any suggestions on how one might create event bindings that would allow a user to mouse drag a window without borders, eg. a window created with overridedirect(1)? Use case: We would like to create a floating toolbar/palette window (without borders) that our users can drag around on their desktop. Here’…
How to call Wine dll from python on Linux?
I’m writing a python script in Linux, and need to call some Windows functions available in Wine. Specifically, AllocateAndInitializeSid and LookupAccountSidW, to determine who is logged in to a remote Windows computer. These functions are part of advapi32.dll in Wine (edit: using the answers, I was able…
How to get the number of active threads started by specific class?
code looks like below: Is there a way to get the number of threads being active by originating class ? Answer This is a minor modification of Doug Hellman’s multiprocessing ActivePool example code (to use threading). The idea is to have your workers register themselves in a pool, unregister themselves w…
Is it possible to use python suds to read a wsdl file from the file system?
From suds documentation, I can create a Client if I have a url for the WSDL. I currently have the WSDL file on my file system. Is it possible to use suds to read the WSDL file from my file system instead of hosting it on a web server? Answer try to use url=’file:///path/to/file’
Display help message with Python argparse when script is called without any arguments
Assume I have a program that uses argparse to process command line arguments/options. The following will print the ‘help’ message: or: But, if I run the script without any arguments whatsoever, it doesn’t do anything. What I want it to do is to display the usage message when it is called wit…
Why aren’t python nested functions called closures?
I have seen and used nested functions in Python, and they match the definition of a closure. So why are they called “nested functions” instead of “closures”? Are nested functions not closures because they are not used by the external world? UPDATE: I was reading about closures and it g…
Python: The _imagingft C module is not installed
I’ve tried lots of solution that posted on the net, they don’t work. So the system can find the _imaging but still can’t use truetype font Raises this error: Answer Your installed PIL was compiled without libfreetype. You can get precompiled installer of PIL (compiled with libfreetype) here …