Skip to content
Advertisement

Parsing the results of askopenfilenames()?

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

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

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

Advertisement