Python IOError: File not open for reading

You opened the file for writing by specifying the mode as ‘w’; open the file for reading instead: ‘r’ is the default, so it can be omitted. If you need to both read and write, use the + mode: w+ opens the file for writing (truncates it to 0 bytes) but also lets you read from it. If you use r+ it … Read more

“Cross origin requests are only supported for HTTP.” error when loading a local file

My crystal ball says that you are loading the model using either file:// or C:/, which stays true to the error message as they are not http:// So you can either install a webserver in your local PC or upload the model somewhere else and use jsonp and change the url to http://example.com/path/to/model Origin is defined in RFC-6454 as So even though your file … Read more

“Cross origin requests are only supported for HTTP.” error when loading a local file

My crystal ball says that you are loading the model using either file:// or C:/, which stays true to the error message as they are not http:// So you can either install a webserver in your local PC or upload the model somewhere else and use jsonp and change the url to http://example.com/path/to/model Origin is defined in RFC-6454 as So even though your file … Read more

Get file version in PowerShell

Since PowerShell can call .NET classes, you could do the following: Or as noted here on a list of files: Or even nicer as a script: https://jtruher3.wordpress.com/2006/05/14/powershell-and-file-version-information/

How to find out whether a file is at its `eof`?

fp.read() reads up to the end of the file, so after it’s successfully finished you know the file is at EOF; there’s no need to check. If it cannot reach EOF it will raise an exception. When reading a file in chunks rather than with read(), you know you’ve hit EOF when read returns less … Read more