Open smanross opened 3 years ago
sidenote: I may have found a way around the different behavior from Python
Namely, if I include a python script that has a function in it, it seems to see the function correctly from the main code
<%@ LANGUAGE = "Python"%>
<html>
<body>
<center>
<h1>Testing</h1>
</center>
<!-- #include virtual="/inc/python/functions.inc" -->
<%
rs = query_sql("somedsn", 'select * from blah')
objDict = create_dictionary_from_results(rs, "ID")
row_data_horizontal(rs)
%>
</BODY>
</HTML>
Win32-Python still doesnt seem to handle multiple blocks correctly when the multiple blocks contain just python -- not functions, but this will work for now - and/or long term).
I hope this helps someone other than me and or helps better explain the issues and or working use cases versus the non-working use cases.
In IIS, using Server Side ASP code with VBScript, per: https://docs.microsoft.com/en-us/previous-versions/iis/6.0-sdk/ms524876(v=vs.90
I can do this...
Note: This works with IF... ELSE... END IF blocks as well as While loops, etc
As well, another example on the web some other example suggests we can do something similar to:
... which increments the font size in VBScript/ASP html (making each Hello World in a larger font as it progresses through the for loop).
However, in working with Python, I have found that this type of inter-weaving HTML and code is not possible in the current builds (even if I were to indent properly for python code blocks) because Python treats each code block as an individual script per se (confirmed on win32-python-users email list). The answer I received seemed to suggest that this was because "Active Scripting" doesn't support doing this across code blocks outside of VBScript.
However, today, I have also found that "PerlScript" can do something similar to VBScript in this coding style ($RS is an ADODB.Recordset object):
...which makes me believe it is possible outside of VBScript (i.e. Microsoft hasn't just given VBScript an advantage over other languages) and it may be possible in languages like Python with a code modification to handle these scenarios.
This request is made in hopes that Python could/would be changed to support this style of inter-weaving html and code (and not treat each code block as an independent script). This is functionality that VBScript and PerlScript currently support (at a minimum).
P.S. The Perl example is a snippet of code, distributed with Activestate Perl (5.8.8 build 820 which is extremely old -- filename = c:\perl\eg\aspSamples\ado1.asp). I had this build of Perl already downloaded from years ago and remembered they had ASP samples in that distribution I could look at and try and find samples of this kind of coding style in Perl.
I find this functionality VERY useful, and would love to see it implemented in Python (if possible).
I understand that this likely isn't a huge priority even if you are able to and decide to support this, but wanted to suggest this based on other languages supporting it already.
If you want further information, I'd be happy to supply it. I am very familiar with Classic ASP coding.
Please and Thank You for listening!
Windows Python 3.8.2 x64 Windows 2016 x64