post.py

2021-08-16 Thread Testing
Just got done writing this nice little posting script. Its my first python 
script ecer
so be nice lol.

#!/usr/bin/python3
import nntplib
import sys

NAME = 'testbunny'
EMAIL = 'te...@test.com'
SIG = 'Testbunny'
ORG = 'Python Pirates'
SERVER = 'nntp.aioe.org'
GROUPS = 'alt.test'

SUBJECT = input("What is the subject? ")

print("Enter/Paste your content. Ctrl-D or Ctrl-Z ( windows ) to save it.")
contents = []
while True:
try:
BODY = input()
contents.append(BODY)
except EOFError:
break

text = '\n'.join(contents)

open('article.txt', 'w').close()

with open('article.txt', 'a') as f:
f.write('From: ' + NAME + " <" + EMAIL + ">")
f.write("\n")
f.write('Subject: ' + SUBJECT)
f.write("\n")
f.write('Newsgroups: ' + GROUPS)
f.write("\n")
f.write('Organization: ' + ORG)
f.write("\n")
f.write('User-Agent: Python3')
f.write("\n")
f.write("\n")
f.writelines(text)
f.write("\n")
f.write("\n")
f.write('--')
f.write("\n")
f.write(SIG)
f.write("\n")
f.write('.')
print("Sending article")

s = nntplib.NNTP(SERVER)
f = open('article.txt', 'rb')
s.post(f)
print("done")
s.quit()

--
Python Test Script
.
-- 
https://mail.python.org/mailman/listinfo/python-list


fixed the from fiield

2021-08-16 Thread testing
heh

--
Python Test Script
.
-- 
https://mail.python.org/mailman/listinfo/python-list


I would like to learn scripting in Python too!

2008-04-20 Thread Software Testing
Hello There,

I am a software tester and I see lot of testers on the forums saying Python
is a wonderful scripting language that testers use on a daily basis.

I would also like to learn to script in Python but I do not have any
programming background.

Please help

Thanks
Mansa
-- 
http://mail.python.org/mailman/listinfo/python-list