473,238 Members | 1,590 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,238 software developers and data experts.

marked-up Python code

Hi,

I would like to experiment with marked-up Python source code. A more
elaborate explanation of the use-case is at the end of this mail. The
short story is that I would like to do things like assign colors to
pieces of text in my editor and have this information saved _in my
source code_
smth like
<red>
else :
print "ERROR"
return -1
</red>

"all" the Python parser has to do is skip the mark-up.

Has something like this been done before? Is there a way to do this
without changing the Python executable? If not, where in the source
code should I start looking?

cheers,
Luc

PS1
I know I can put the mark-up after a # and the problem is solved
trivially, but this will not work for all cases (e.g. mark-up of
single identifiers) and to be honest I was thinking of recycling some
mark-up capable editor and an existing mark-up language

PS2
here's the real use case
I have a small application in Python. The code shares a recurring
feature: within methods 20% of the code lines is about the actual
handling of the correct case, 40% is about the handling of the
incorrect cases, 40% is instrumenting (logging and timing).
A case for aspect oriented programming? I would certainly think so,
but unfortunately there is no obvious way to map this to the
prevailing aspect-advice-joint point-point cut model. Moreover, I
really do not want this code to become fragmented over multiple
source code files, I just want the aspects to be readily visible in
my editor, and be able to selectively show/hide some of them (like
expanding/collapsing code blocks).
Nov 20 '07 #1
0 838

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Chan | last post by:
Hi I am getting the following error when I call a web service method from .Net 2002 Application "One or more header elements marked as mustUnderstand was not understood BUT it works from...
0
by: David Elliott | last post by:
I have a 3rd Party DLL that is a Win32 NOT .NET Assembly that is misbehaving. I am trying to isolate it in its own AppDomain. I got to load but can not create an instance. I receive the following...
0
by: Matt | last post by:
Hi everyone, I'm using the command "mysqlcheck --all-databases --auto-repair --silent" and I see these warnings and errors (listed below) on a daily occurrence. What could cause these indexes to...
5
by: Mark Barinstein | last post by:
Hello. db2v8 fp3 or fp4. ftp://adm-gw.vsi.ru/pub/db2v8crash/files.zip In this zip file (~1.4M) there are: 1. script for creating a small test database with 3 tables and 1 view. 2. 3 ixf...
0
by: Page | last post by:
I have a C# system service that is marked as interactive and use local system account (default) and marked to automatically start. When I restart the system the application is not visible. When...
2
by: jeffpriz | last post by:
I'm having trouble.. I created a small class that I pass to my Pages, and I want to put that class into Viewstate.. I do: Viewstate.add("thisVar", myClassVariable) and i receive the lovely...
0
by: Baiju | last post by:
Does anyone know where I can get a version of the Date Time Picker control that's marked safe for scripting? The cab file I have from the Microsoft site is not marked safe for scripting. So I...
2
by: Frank Uray | last post by:
Hi again I have a little problem with "serializable" a control ... I am creating AppDomain, Assembly and Instance. All works fine. My "base" class for the instance inherit from: -...
4
by: Jack | last post by:
Hi guys, I am writing a simple script that sends an email to a user using mail(). The problem is when the mail is received it is marked as phishing. I am wondering if there is a way to fix this...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.