I am running a very basic pyscript code that accesses a python file.
The following is the HTML file:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PyScript Debug</title>
<!-- Using the latest stable version of PyScript -->
<link rel="stylesheet" href="https://pyscript.net/releases/2024.9.1/core.css">
<script type="module" src="https://pyscript.net/releases/2024.9.1/core.js"></script>
</head>
<body>
<h1>PyScript Debugging Example</h1>
<!-- Terminal display -->
<py-terminal></py-terminal>
<!-- Load the main.py file from the server -->
<script src="https:/vivliosyn.com/python/main_1.py" config ="https:/vivliosyn.com/python/pyscript.json" ></script>
</body>
</html>
'''
The python file - main_1.py - has a single line
'''
print ("1")
'''
Both the HTML and the Python file, as well as the pyscript.json file are store in the same folder on a server (vivliosyn.com/Python).
However, I am not getting the Python file output. I am able to get the output if I directly add the Python code directly to the HTML file.
However, I am trying to build an application that has to access a larger python file that is saved as a .py file.
main_1.txt. That may help with this simple test case, but when you will have multiple files, modules, etc, the original problem will have to be sorted out.