--> Thursday, February 5, 2004, 12:10:32 PM, [EMAIL PROTECTED] wrote:
> * [EMAIL PROTECTED] writes:
>> --> Wednesday, February 4, 2004, 5:16:43 PM, [EMAIL PROTECTED] wrote:
>> I'm not sure what you're trying to do but I just started my own set
>> of macros today and two of the macros may interest you. One evaluates
>> python expressions, and the other executes python code.
> YES! Release NOW!!1
> Hm, how do you pass variables from and to the Python code? I mean
> for example setting the subject from within Python.
> Actually, when I think about it, is this really necessary? One
> could do the following:
You can do a lot. This template results in the attached message.
I just started this yesterday, all for the sake of my spam solution.
Let me know if you have any suggestions, or if I missed something.
# Exec executes a dos command and returns the output
# Py executes python code, print statements go to msg
# Pyx evaluates a python expression, result to msg
# Python env is global and includes auto-imported tb module
# Python Exceptions and others go to msg with a stacktrace
%Exec("uptime")
%Py("
tb.set('from','[EMAIL PROTECTED]')
print tb.get('from')
print tb.get('215')
")
%Py("
tb.set('215','[EMAIL PROTECTED]')
")
%Py("
print 'm:'+tb.macro('%%FROM')
print 'v:'+tb.value('FROM')
print 'g:'+tb.get('215')
print 'g:'+tb.get('from')
")
%Py("phi = 1.618")
%Py("print phi")
%Pyx("phi")
%Pyx("5**5")
%Py("
for x in range(10):
print str(x)
")
%Py("
for i in range(tb.paramcount()):
print '%%d=%%s' %% (i,tb.param(i))
",123,456)
%Py(
"
import os, sys
from TMDA.Address import DatedAddress
address = DatedAddress().create('[EMAIL PROTECTED]','5d')
print str(address)
"
)
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
From: [EMAIL PROTECTED]
To:
Subject:
--------------------------------------------------------------------------------
\\IO has been up for: 20 day(s), 22 hour(s), 30 minute(s), 26 second(s)
[EMAIL PROTECTED]
[EMAIL PROTECTED]
m:[EMAIL PROTECTED]
v:[EMAIL PROTECTED]
g:[EMAIL PROTECTED]
g:[EMAIL PROTECTED]
1.618
1.618
3125
0
1
2
3
4
5
6
7
8
9
0=
for i in range(tb.paramcount()):
print '%d=%s' % (i,tb.param(i))
1=123
2=456
[EMAIL PROTECTED]
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
________________________________________________
Current version is 2.02.3 CE | "Using TBUDL" information:
http://www.silverstones.com/thebat/TBUDLInfo.html