I’m trying to get a list of filenames from tkinter.filedialog.askopenfilenames() in Python 3.2. I was expecting the output to be a tuple (or maybe a list) with each element containing a filename. As far as I can tell, it’s returning a string with each element contained within curly-brackets {} like so: {C:UsersBVCAPFile1.txt} {C:UsersBVCAPFile2.txt} This is what I get if I
How to update a plot in matplotlib
I’m having issues with redrawing the figure here. I allow the user to specify the units in the time scale (x-axis) and then I recalculate and call this function plots(). I want the plot to simply update, not append another plot to the figure. Answer You essentially have two options: Do exactly what you’re currently doing, but call graph1.clear() and
Great flask / other python micro framework code I could learn from [closed]
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 question I’d like to look at some good web-app code written in
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 respect to the GC object count? What about
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 Result So, this is going to
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’s where I’m at in my thinking (pseudo code): window.bind( ‘<Button-1>’,
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 to call the function, but LookupAccountSidW only works on the local computer). How
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 when they finish, using a threading.Lock to coordinate modification of
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 with no arguments. How is that done? Answer This