ANN: watch.py (updated!)

Olivier Dagenais olivierS.dagenaisP at canadaA.comM
Fri Oct 20 16:27:55 EDT 2000


A few people e-mailed me about watch.py and gave me some suggestions.  Since
I was finding my own output to be "not-so-nice", I thought it might be cool
if I made the output a little more "Pythonic" (it looks just like the
Traceback, except that it's offset two characters to the left), cleaned up
the code a bit and added some features (like output redirection and checking
for __debug__)...  Here's sample output:

C:\Program Files\Python\Lib>python watch.py
File "watch.py", line 33, in ?
  a <string> = something else
File "watch.py", line 29, in __testWatch
  secretOfUniverse <int> = 42
File "watch.py", line 36, in ?
  "This line was executed!" <string> = This line was executed!

C:\Program Files\Python\Lib>python -O watch.py

C:\Program Files\Python\Lib>


Have fun!

--
----------------------------------------------------------------------
Olivier A. Dagenais - Software Architect and Developer
"Someone called 'Type your name here' is impersonating me on the
internet and is posting exactly the same things I am posting!"




begin 666 watch.py
M:6UP;W)T('1Y<&5S+"!S=')I;F<L('-Y<PT*9G)O;2!T<F%C96)A8VL@:6UP
M;W)T("H-"@T*=V%T8VA/=71P=70@/2!S>7,N<W1D;W5T#0H-"B(B(E-H;W5L
M9"!P<FEN="!O=70@<V]M971H:6YG(&QI:V4Z#0I&:6QE(")W871C:"YP>2(L
M(&QI;F4@,CDL(&EN(%]?=&5S=%=A=&-H#0H@('-E8W)E=$]F56YI=F5R<V4@
M/&EN=#X@/2 T, at T*(B(B#0ID968@=V%T8V@@*"!V87)I86)L94YA;64@*3H-
M"@EI9B!?7V1E8G5G7U\Z#0H)"7-T86-K(#T at 97AT<F%C=%]S=&%C:R H("E;
M+3(Z75LP70T*"0EA8W1U86Q#86QL(#T@<W1A8VM;,UT-"@D);&5F=" ]('-T
M<FEN9RYF:6YD("@@86-T=6%L0V%L;"P@)R at G("D-"@D)<FEG:'0@/2!S=')I
M;F<N<F9I;F0@*"!A8W1U86Q#86QL+" G*2<@*0T*"0EP87)A;41I8W0@/2![
M('T-"@D)<&%R86U$:6-T6R)V87).86UE(ET@(" @/2!S=')I;F<N<W1R:7 @
M*"!A8W1U86Q#86QL6VQE9G0K,3IR:6=H=%T@*2 @(R!E=F5R>71H:6YG(&)E
M='=E96X@)R at G(&%N9" G*2<-"@D)<&%R86U$:6-T6R)V87)4>7!E(ET@(" @
M/2!S='(@*"!T>7!E("@@=F%R:6%B;&5.86UE("D@*5LW.BTR70T*"0EP87)A
M;41I8W1;(G9A;'5E(ET@(" @(" ]('-T<B H('9A<FEA8FQE3F%M92 I#0H)
M"7!A<F%M1&EC=%LB;65T:&]D3F%M92)=(#T@<W1A8VM;,ET-"@D)<&%R86U$
M:6-T6R)L:6YE3G5M8F5R(ET@/2!S=&%C:ULQ70T*"0EP87)A;41I8W1;(F9I
M;&5.86UE(ET@(" ]('-T86-K6S!=#0H)"6]U=%-T<B ]("=&:6QE("(E*&9I
M;&5.86UE*7,B+"!L:6YE("4H;&EN94YU;6)E<BED+"!I;B E*&UE=&AO9$YA
M;64I<UQN(" E*'9A<DYA;64I<R \)2AV87)4>7!E*7,^(#T@)2AV86QU92ES
M7&XG#0H)"7=A=&-H3W5T<'5T+G=R:71E("@@;W5T4W1R("4@<&%R86U$:6-T
M("D-"@T*#0ID968 at 7U]T97-T5V%T8V@@*" I. at T*"7-E8W)E=$]F56YI=F5R
M<V4@/2 T, at T*"7=A=&-H("@@<V5C<F5T3V95;FEV97)S92 I"0T*#0II9B!?
M7VYA;65?7R ]/2 B7U]M86EN7U\B. at T*"6$@/2 B<V]M971H:6YG(&5L<V4B
M#0H)=V%T8V@@*"!A("D-"@E?7W1E<W17871C:" H("D-"@DC('=A=&-H(&ES
M(&%L<V\@;FEC92!F;W(@<W!E=VEN9R!T<F%C92!O=71P=70Z#0H)=V%T8V@@
A*" B5&AI<R!L:6YE('=A<R!E>&5C=71E9"$B("D-"@T*
`
end




More information about the Python-list mailing list