Fix Python – Getting name of windows computer running python script?

I have a couple Windows computers on my network that will be running a python script. A different set of configuration options should be used in the script depending on which computer is running this script.
How would I get that computer name in the python script?
Let’s say the script was running on a computer named DARK-TOWER, I’d like to write ….

Fix Python – Request UAC elevation from within a Python script?

I want my Python script to copy files on Vista. When I run it from a normal cmd.exe window, no errors are generated, yet the files are NOT copied. If I run cmd.exe “as administator” and then run my script, it works fine.
This makes sense since User Account Control (UAC) normally prevents many file system actions.
Is there a way I can, from within ….

Fix Python – Can I install Python windows packages into virtualenvs?

Virtualenv is great: it lets me keep a number of distinct Python installations so that different projects’ dependencies aren’t all thrown together into a common pile.
But if I want to install a package on Windows that’s packaged as a .exe installer, how can I direct it to install into the virtualenv? For example, I have pycuda-0.94rc.win32-py2.6…..

Fix Python – Connecting to Microsoft SQL server using Python

I am trying to connect to SQL through python to run some queries on some SQL databases on Microsoft SQL server. From my research online and on this forum the most promising library seems to be pyodbc. So I have made the following code
import pyodbc
conn = pyodbc.connect(init_string=”driver={SQLOLEDB}; server=+ServerName+;

Fix Python – Getting MAC Address

I need a cross platform method of determining the MAC address of a computer at run time. For windows the ‘wmi’ module can be used and the only method under Linux I could find was to run ifconfig and run a regex across its output. I don’t like using a package that only works on one OS, and parsing the output of another program doesn’t seem very e….

Fix Python – How do you fix “runtimeError: package fails to pass a sanity check” for numpy and pandas?

This is the error I am getting and, as far as I can tell, there is nothing useful on the error link to fix this.

RuntimeError: The current Numpy installation
(‘…\\venv\\lib\\site-packages\\numpy\\’) fails to pass a
sanity check due to a bug in the windows runtime.

See this issue for more information: https://developercommunity.visua….

Fix Python – How do I install PyCrypto on Windows?

I’ve read every other google source and SO thread, with nothing working.
Python 2.7.3 32bit installed on Windows 7 64bit. Download, extracting, and then trying to install PyCrypto results in “Unable to find vcvarsall.bat”.
So I install MinGW and tack that on the install line as the compiler of choice. But then I get the error “RuntimeError: chmod ….

Fix Python – pip install access denied on Windows

I am trying to run pip install mitmproxy on Windows, but I keep getting access denied, even with cmd and PowerShell using the Run as Administrator option.
WindowsError: [Error 5] Access is denied: ‘c:\\users\\bruno\\appdata\\local\\temp\\easy_install-0fme6u\\cryptography-0.9.1\\.eggs\\cffi-1.1.2-py2.7-win-amd64.egg\\_cffi_backend.pyd’

How can I m….