Skip to content

Tag: windows

Use the python interpreter packaged with py2exe

I have a python script I want to distribute to Windows, where people might not have python installed. So I use py2exe. The problem is in the script I run other python scripts by using subprocess, which requires python interpreter as the program to execute. As I don’t have python interpreter installed on…

Python virtualenv questions

I’m using VirtualEnv on Windows XP. I’m wondering if I have my brain wrapped around it correctly: I ran virtualenv ENV and it created C:WINDOWSsystem32ENV. I then changed my PATH variable to include C:WINDOWSsystem32ENVScripts instead of C:Python27Scripts. Then, I checked out Django into C:WINDOWS…

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 {} lik…

How to get the text cursor position in Windows?

Is it possible to get the overall cursor position in Windows using the standard Python libraries? Answer This retrieves the cursor’s position, in screen coordinates – point = (x,y) Retrieves information about the global cursor. Links: http://msdn.microsoft.com/en-us/library/ms648389(VS.85).aspx ht…

How do I know what python scripts are running in Windows?

As I mentioned above, is there a way to find out what python scripts are running in Windows? Answer If you have PowerShell installed, you can get that information by using Windows Management Instrumentation (WMI) and some scripting… Open the PowerShell and use these two lines, it should could you starte…

Run Process and Don’t Wait

I’d like to run a process and not wait for it to return. I’ve tried spawn with P_NOWAIT and subprocess like this: However, the console window remains until I close Notepad. Is it possible to launch the process and not wait for it to complete? Answer This call doesn’t wait for the child proce…