Visual Studio: Relative Assembly References Paths

To expand upon Pavel Minaev’s original comment – The GUI for Visual Studio supports relative references with the assumption that your .sln is the root of the relative reference. So if you have a solution C:\myProj\myProj.sln, any references you add in subfolders of C:\myProj\ are automatically added as relative references. To add a relative reference … Read more

Determining application path in a Python EXE generated by pyInstaller

I found a solution. You need to check if the application is running as a script or as a frozen exe: import os import sys config_name=”myapp.cfg” # determine if application is a script file or frozen exe if getattr(sys, ‘frozen’, False): application_path = os.path.dirname(sys.executable) elif __file__: application_path = os.path.dirname(__file__) config_path = os.path.join(application_path, config_name)

What’s a “canonical path”?

The whole point of making anything “canonical” is so that you can compare two things. For example, both ../../here/bar/x and ./test/../../bar/x may refer to the same location, but you can’t do a textual comparison on the two paths. However, if you turn them into their canonical representation, they both become ../bar/x, and we see that … Read more

Importing from a relative path in Python

EDIT Nov 2014 (3 years later): Python 2.6 and 3.x supports proper relative imports, where you can avoid doing anything hacky. With this method, you know you are getting a relative import rather than an absolute import. The ‘..’ means, go to the directory above me: from ..Common import Common As a caveat, this will … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)