environment variable set in make not seen by all sub-shells

I need to set env variables in a makefile and use them in a python script invoked by the makefile. For some reason the python script is not able to see these env variables. export VAR := env_var PY_VAR := python -c "import os; print(‘VAR=’ + str(os.environ.get(‘VAR’)))" all: @echo -n "echoing: VAR=" @echo $${VAR} @echo… Read More environment variable set in make not seen by all sub-shells

Flask render template doesn't render my html page keep getting "internal server error"

Running flask 2.1 w/ python 3.10 trying to create a small app here’s my main.py file contents and directory setup from waitress import serve app = Flask(__name__, template_folder=’/templates’) @app.route("/") def startService(): return "Simple Web app" @app.route("/home") def ohok(): return render_template(‘home.html’) if __name__ == "__main__": serve(app, host="127.0.0.1", port=8080) I have my home.html file correctly formatted placed… Read More Flask render template doesn't render my html page keep getting "internal server error"

How to call the Win32 GetCurrentDirectory function from C#?

The prototype of GetCurrentDirectory DWORD GetCurrentDirectory( [in] DWORD nBufferLength, [out] LPTSTR lpBuffer ); DWORD is unsigned long, LPTSTR is a pointer to wchar buffer in Unicode environment. It can be called from C++ #define MAX_BUFFER_LENGTH 256 int main() { TCHAR buffer[MAX_BUFFER_LENGTH]; GetCurrentDirectory(MAX_BUFFER_LENGTH, buffer); return 0; } I tried to encapsulate this win32 function in C#,… Read More How to call the Win32 GetCurrentDirectory function from C#?

Why is StreamWriter adding random bytes to a file?

I’m trying to translate a virtual key code with ToAsciiEx() and write it to a debug file. For some reason, the output file contains a load of random trash bytes interspersed with the key codes I want to log. I’m importing ToAsciiEx() like this: [DllImport("user32.dll")] static extern int ToAsciiEx(uint uVirtKey, uint uScanCode, byte[] lpKeyState, [Out]… Read More Why is StreamWriter adding random bytes to a file?

Why is this requests get not working with this url

If i run this Python code my program just hangs up. (I don`t get any error.) import requests url = "https://raw.githubusercontent.com/tensorflow/docs/master/site/en/tutorials/generative/dcgan.ipynb" r = requests.get(url) But this works perfectly fine as expected. import requests url = "https://stackoverflow.com" r = requests.get(url) Using curl to get the github file worked also fine. curl https://raw.githubusercontent.com/tensorflow/docs/master/site/en/tutorials/generative/dcgan.ipynb So can you reproduce… Read More Why is this requests get not working with this url