jilkka

jilkka

About Me

Connect

LOCATION
Not Specified
WEBSITE

Houdini Skills

Availability

Not Specified

Recent Forum Posts

post-render python script April 22, 2013, 4:29 a.m.

That did the trick!

post-render python script April 21, 2013, 2:50 a.m.

apparently I'm getting the following error on the node:
Python error: SyntaxError: ('invalid syntax', ('<stdin>, 1, 1, sendalertmessage.py'))

Here's the code

import datetime
import socket
import smtplib
import email
import os
import mimetypes
import sys
from email import encoders
from email.message import Message
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText

username = “me@mail.com
passwd = “xxxxxxx”

def mail(to, subject, text):
msg = MIMEMultipart()

msg = username
msg = to
msg = subject

msg.attach(MIMEText(text))
try:

server = smtplib.SMTP(“webmail.mail.com”, 25)
server.ehlo()
server.login(username, passwd)
try:
server.sendmail(username, to, msg.as_string())
finally:
server.close()

except Exception, exc:
sys.exit( “mail failed; %s” % str(exc) )

machine = socket.gethostname()
ftime = datetime.datetime.now().strftime(“%H:%M on %m-%d-%Y”)

mail(“me@gmail.com”, “Operation Complete”, “Operation completed on %r at %r” % (machine, ftime))

post-render python script April 20, 2013, 6:08 p.m.

I've got a python script that sends an email out whenever run. I want it to run whenever the renderop is completed, tried using as post-render script but it looks like it doesnt run. It's just a standard python email script. Do I have to add in anything houdini specific for it to be run?