How to declare a module deprecated in python

You want to warn with a DeprecationWarning. Exactly how you call it doesn’t matter that much, but the stdlib has a standard pattern for deprecated modules, like this: # doc string, top-level comments, imports, __all__ = import warnings warnings.warn(“the spam module is deprecated”, DeprecationWarning, stacklevel=2) # normal module code See the 2.7 sets source for … Read more

How to resolve Node.js ES6 (ESM) Modules with the TypeScript Compiler (TSC). TSC doesn’t emit the correct file-ext

This is a confusing design choice in TypeScript. In the short term you can work around it by specifying the output file: in main.ts specify the .js extension and path: import { testText } from ‘./module1.js’; alert(testText); This will pick up module.ts correctly, but output with the .js extension included. Note that you also need … Read more

asp.net, url rewrite module and web.config

I was able to get this working in Visual Studio 2010. Start with Ruslan’s post here and download the 2.0 IntelliSense file. Then, just follow the directions he posted previously here. All I ended up doing was running the following command as Ruslan instructs: C:\download_directory\rewrite2_intellisense>cscript UpdateSchemaCache.js As Christoph points out in his comment, make sure … Read more

How do I install Python libraries in wheel format?

You want to install a downloaded wheel (.whl) file on Python under Windows? Install pip on your Python(s) on Windows (on Python 3.4+ it is already included) Upgrade pip if necessary (on the command line) pip install -U pip Install a local wheel file using pip (on the command line) pip install –no-index –find-links=LocalPathToWheelFile PackageName … Read more

How to reference to the top-level module in Python inside a package?

This should do the job: top_package = __import__(__name__.split(‘.’)[0]) The trick here is that for every module the __name__ variable contains the full path to the module separated by dots such as, for example, top_package.level_one_a.my_lib. Hence, if you want to get the top package name, you just need to get the first component of the path … Read more

RequireJS: Multiple main.js?

The requirejs team has some samples for multipage applications on github. Have a look at: https://github.com/requirejs/example-multipage Basically you are going to have the following structure: page1.html: page 1 of the app. page2.html: page 2 of the app. js app: the directory to store app-specific modules. lib: the directory to hold third party modules, like jQuery. … Read more

Homebrew + Python on mac os x 10.8: Fatal Python error: PyThreadState_Get: no current thread importing mapnik

It looks like you are running the homebrew python but either boost python or mapnik’s python bindings ended up linking against the system python provided by apple. If a full clean and reinstall of boost and Mapnik does not fix this then I recommend stopping by #mapnik irc on freenode for help debugging. Generally to … Read more

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