GIDForums  

Go Back   GIDForums > Computer Programming Forums > Python Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 24-Sep-2005, 00:39
admin's Avatar
admin admin is offline
Administrator
 
Join Date: Sep 2002
Posts: 730
admin will become famous soon enough
Arrow

GIDForums enables New [PY] (python) bbcode.


The GIDForums™ Team is proud to announce that GIDForums™ is now among one of the very first Webmaster / Programming forums to offer a custom-written Python Syntax Highlighter BBCode ([py] bb code) to it's valued members and readers.

Please use the [py] and [/py] tag pair to enclose any python code so that it appears like in the sample effect below:

Sample Effect of [py] BB Code Tag

Python Code:
# Example by python.org
# http://docs.python.org/lib/SMTP-example.html

import smtplib

def prompt(prompt):
    return raw_input(prompt).strip()

fromaddr = prompt("From: ")
toaddrs  = prompt("To: ").split()
print "Enter message, end with ^D (Unix) or ^Z (Windows):"

# Add the From: and To: headers at the start!
msg = ("From: %s\r\nTo: %s\r\n\r\n"
       % (fromaddr, ", ".join(toaddrs)))
while 1:
    try:
        line = raw_input()
    except EOFError:
        break
    if not line:
        break
    msg = msg + line

print "Message length is " + repr(len(msg))

server = smtplib.SMTP('localhost')
server.set_debuglevel(1)
server.sendmail(fromaddr, toaddrs, msg)
server.quit()
__________________
Custom BB codes you can use here:
[HTML] | [C++] | [CSS] | [JAVA] | [PY] | [VB]
  #2  
Old 24-Sep-2005, 21:09
crystalattice's Avatar
crystalattice crystalattice is offline
Flame War Instigator
 
Join Date: Apr 2004
Location: San Diego
Posts: 1,534
crystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nice

Re: GIDForums enables New [PY] (python) bbcode.


Cool deal! Might have to "borrow" the bbcode for my site.
__________________
Common Sense v2.0-Striving to make the world a little bit smarter.
 

Recent GIDBlogLast Week of IA Training by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
GIDForums enables New [C] / [C++] bbcode. admin CPP / C++ Forum 17 17-Jul-2007 03:11
GIDForums enables New [JAVA] bbcode. admin Java Forum 10 19-May-2007 04:13
GIDForums enables New [KBD] bbcode. admin GIDForums™ 0 24-Jul-2003 06:26
GIDForums enables New [CSS] bbcode. admin GIDForums™ 0 01-Jun-2003 23:57

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 20:28.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.