i don't know what happened but all of a sudden, my cgi.fieldstorage has
two extra keys, 'x' and 'y', does anyone know how i can remove them in
python?
--
http://mail.python.org/mailman/listinfo/python-list
I have the following if statement that checks if a form is empty:
if form.has_key("date") and form["date"].value != "":
date=form['date'].value
else:
print "ERROR: No date entered!"
raise Exception
I would also like to add another if statement checking if 'da
Tim Chase wrote:
>> for col in range(0, numcols):
>> print "", record[col], ""
>
> This is the point at which you want to intercept the column data and
> make your change:
>
> print "", str(record[col]).replace("00:00:00.0", ""), "
> If it's possible/plausible that other fie
[EMAIL PROTECTED] wrote:
> Kun> i have the following python-cgi which extracts data from a mysql
> Kun> table, how do i parse the date so that it doesn't display the time
> Kun> '00:00:00.00'?
>
> I have no idea which column in your table is a da
Fredrik Lundh wrote:
> "Kun" wrote:
>
>> because in my sql database, the date is only 'date' (as in -mm-dd),
>> only when i extract it with my python-cgi does the date turn into
>> (-mm-dd 00:00:00.00), thus i figured the best way to fix thi
Fredrik Lundh wrote:
> "Kun" wrote:
>
>> I have a python-cgi file that pulls data from an sql database, i am
>> wondering what is the easiest way to remove all instances of
>> '00:00:00.00' in my date column.
>>
>> how would i writ
I have a python-cgi file that pulls data from an sql database, i am
wondering what is the easiest way to remove all instances of
'00:00:00.00' in my date column.
how would i write a python script to scan the entire page and delete all
instances of '00:00:00.00', would i use regular expressions?
does anyone know how to attach an excel file to send out using smtplib
and MIME?
--
http://mail.python.org/mailman/listinfo/python-list
I V wrote:
> Kun wrote:
>> mail currently gets the body from an input box.
>>
>> this is where mail.py gets invoked:
>
> OK, I'm a bit confused. Where is the "initial python program" in all
> this? You seem to have an one python program (mail.py) and
I V wrote:
> Kun wrote:
>> This works fine but instead of typing in a 'body', i would like the
>> initial python program to just send a string as the body of the email.
>> now normally i'd just set the msg in the mail.py file equal to the
>> string, howeve
Kun wrote:
> I have a python-cgi form whose sole purpose is to email.
>
> It has the fields 'to', 'from', 'subject', 'body', etc. and if the user
> fills them out and clicks submit, it will invoke another file called
> mail.py which use
I have a python-cgi form whose sole purpose is to email.
It has the fields 'to', 'from', 'subject', 'body', etc. and if the user
fills them out and clicks submit, it will invoke another file called
mail.py which uses smtplib to send the message.
This works fine but instead of typing in a 'body'
Felipe Almeida Lessa wrote:
> Em Dom, 2006-04-16 às 19:22 -0400, Kun escreveu:
>> i have a form
>
> Which kind of form? Which toolkit?
>
>> which takes in inputs for a mysql query. one of the inputs
>> is 'date'. normally, a user has to manually ent
i have a form which takes in inputs for a mysql query. one of the inputs
is 'date'. normally, a user has to manually enter a date, but i am
wondering if there is a way to create a button which would automatically
insert today's date in the date form field if the user chooses to use
today's dat
I currently have a python-cgi script that extracts data from a mysql
table. I would like to save this data as a string and send it to a
recipient via email.
I know how to send email using the smtp lib, but what I do not know his
how to save a portion of the page as a string. Any pointers?
--
[EMAIL PROTECTED] wrote:
> Kun wrote:
>> I am trying to make an if-statement that will not do anything and print
>> 'nothing entered' if there is nothing entered in a form. I have the
>> following code that does that, however, now even if I enter something
>
&
I am trying to make an if-statement that will not do anything and print
'nothing entered' if there is nothing entered in a form. I have the
following code that does that, however, now even if I enter something
into the form, the code still outputs 'nothing entered'. This violates
the if state
i have a python cgi script that displays tables from a mysql database in
html.
the problem is, i want to use excel's web query to pull this data and
the web query doesn't read .py files.
thus i am wondering what is the easiest way to just turn my .py html
output into a .html output.
you can c
I have an html form that takes dates and inserts them into a mysql file.
Currently, users have to type in dates in the -mm-dd format. As
of now, this process works with the sql. However, I would like to make
this process easier by:
1) providing drop down menus for year, month, and date
i have an html/cgi input that takes in values to a mysql database,
however, if i stick in $20 instead of 20, it crashes the program because
of the extra $ sign. I was wondering if anyone has a quick regular
expression in python to remove the $-sign if it is present in the input.
--
http://mail
i have the following simple html that asks for a price:
--
http://mail.python.org/mailman/listinfo/python-list
Kun wrote:
> i have the following code:
>
> --
> import smtplib
>
> from email.MIMEText import MIMEText
> fp = open('confirmation.txt', 'rb')
> msg = MIMEText(fp.read())
>
> From = '[EMAIL PROTECTED]'
i have the following code:
--
import smtplib
from email.MIMEText import MIMEText
fp = open('confirmation.txt', 'rb')
msg = MIMEText(fp.read())
From = '[EMAIL PROTECTED]'
msg['Subject'] = 'Purchase Confirmation'
msg ['From'] = From
msg['To'] = emails
s = smtplib
i have a regular expression that searches a string and plucks out email
addresses however it doesn't work for email addresses w/a subdomain e.g.
[EMAIL PROTECTED]
emails = re.findall('([EMAIL PROTECTED])', senderlist) <-- my code
is there any way to modify that to include email addresses that
hey guys, here's my code,
senders = [('460 (BODY[HEADER.FIELDS (FROM)] {46}', 'From: Friend
<[EMAIL PROTECTED]>\r\n\r\n'), ')', ('462 (BODY[HEADER.FIELDS
(FROM)] {37}', 'From: Kun <[EMAIL PROTECTED]>\r\n\r\n'), ')
the code below outputs a string of emails (e.g. ['[EMAIL PROTECTED]',
'[EMAIL PROTECTED]']
i would like to somehow send an email to everyone on the string of
emails telling them 'thanks for emailing me'
anyone know how to do this? much thanks ahead of time.
from imaplib import *
import getpas
[EMAIL PROTECTED] wrote:
> Use Regular expressions
> http://docs.python.org/lib/module-re.html
>
i tried to parse (below) with the regular expression: emails =
re.findall('\S*\s([EMAIL PROTECTED])', senders)
and got the following error:
Traceback (most recent call last):
File "/Life/School/H
i have a list of that is:
[('460 (BODY[HEADER.FIELDS (FROM)] {46}', 'From: Friend
<[EMAIL PROTECTED]>\r\n\r\n'), ')', ('462 (BODY[HEADER.FIELDS (FROM)] {37}',
'From: Kun <[EMAIL PROTECTED]>\r\n\r\n'), ')']
how do i p
what is the best way to parse
the email address out of the entire string.
sample string:
>>> print status, senders
OK [('460 (BODY[HEADER.FIELDS (FROM)] {46}', 'From: Friend
<[EMAIL PROTECTED]>\r\n\r\n'), ')', ('462 (BODY[HEADER.FIELDS (FROM)]
#x27;
> mail['Subject'] = "Spam machine"
> mail['To'] = to = '[EMAIL PROTECTED]'
> server = smtplib.SMTP('localhost')
> errors = server.sendmail(fro, to, mail.as_string())
> server.quit()
>
> That
Okay So I got the 'search' part to work, which outputs me a long list of
message numbers. how do i use that list of message numbers to fetch the
'from' address for each one and send them a confirmation email?
is this some sort for loop?
any help would be greatly appreci
Hey guys, I would like to have a code in python (as simple as possible)
to scan a specific folder in my mailbox and if the subject is equal to,
say, 'BIKES', I would like to have the code automatically send the
SENDER an email saying something like "We have received your Email".
Furthermore, I
32 matches
Mail list logo