473,394 Members | 1,696 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,394 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 842

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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.