Re: [Tutor] what am I not understanding?

2014-10-20 Thread Peter Otten
Clayton Kirkwood wrote: > raw_table = (''' > a: Asky: Dividend Yield > b: Bid d: Dividend per Share > b2: Ask (Realtime) r1: Dividend Pay Date > b3: Bid (Realtime)q: Ex-Dividend Date > p: Previous Close > o: Open''') > o: Open#why aren

[Tutor] Python Help

2014-10-20 Thread Taylor Ruzgys
Hi, I was wondering if you could help me with an assignment that I'm doing involving Python? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listi

Re: [Tutor] Python Help

2014-10-20 Thread Alan Gauld
On 20/10/14 03:56, Taylor Ruzgys wrote: Hi, I was wondering if you could help me with an assignment that I'm doing involving Python? Yes, we can help you do it. We won't do it for you. You need to tell us what the assignment is, how you have tried to solve it, including any code you've written

[Tutor] Insert time into email

2014-10-20 Thread Bo Morris
hello all, hope everyone is doing well. The below code works, however I am going back and trying to enter the time and date and I cant quite figure out how to do this without breaking the code. #!/usr/bin/python import smtplib from email.MIMEMultipart import MIMEMultipart from email.MIMEText imp

Re: [Tutor] Insert time into email

2014-10-20 Thread Chris “Kwpolska” Warrick
On Mon, Oct 20, 2014 at 2:34 PM, Bo Morris wrote: > hello all, hope everyone is doing well. > > The below code works, however I am going back and trying to enter the time > and date and I cant quite figure out how to do this without breaking the > code. > > #!/usr/bin/python > > import smtplib > f

[Tutor] Python sqlite3 issue

2014-10-20 Thread Juan Christian
I have this code (http://pastebin.com/Q21vQdHZ): import sqlite3 db = sqlite3.connect('db.sqlite') def create_db(): db.execute(''' CREATE TABLE TOPICS( ID INT PRIMARY KEY NOT NULL, URL VARCHAR NOT NULL, AUTHOR VARCHAR NOT NULL, MESSAGE VARCHAR NOT NULL ); ''') d

Re: [Tutor] Python sqlite3 issue

2014-10-20 Thread Danny Yoo
Hi Juan, On Mon, Oct 20, 2014 at 10:04 AM, Juan Christian wrote: > I have this code (http://pastebin.com/Q21vQdHZ): > > import sqlite3 [code cut] > def insert_db(_id, url, author, message): > db.execute("INSERT INTO TOPICS (ID, URL, AUTHOR, MESSAGE) VALUES ({}, > {}, {}, {})".format(_id,

Re: [Tutor] Insert time into email

2014-10-20 Thread Chris “Kwpolska” Warrick
Forwarding to list — please use Reply All… next time. On Mon, Oct 20, 2014 at 6:28 PM, Crush wrote: > Where does the ."format(time=t,date=d)" go? > > I would assume something like > > msgTime = MIMEText() > msgTime.add_header('not sure what to put here?' '' .format(time=t)) > msgRoot.attach(msgTi

Re: [Tutor] Python sqlite3 issue

2014-10-20 Thread Joel Goldstick
On Mon, Oct 20, 2014 at 1:04 PM, Juan Christian wrote: > I have this code (http://pastebin.com/Q21vQdHZ): > > import sqlite3 > > db = sqlite3.connect('db.sqlite') > > > def create_db(): > db.execute(''' > CREATE TABLE TOPICS( > ID INT PRIMARY KEY NOT NULL, > URL VARCHAR NOT NULL, >

Re: [Tutor] Python sqlite3 issue

2014-10-20 Thread Danny Yoo
insert_db(12, "abc.com", "author", "message") > INSERT INTO TOPICS (ID, URL, AUTHOR, MESSAGE) VALUES (12, abc.com, > author, message) > > I've never used format like that. It looks like you need to quote the > strings. I don't know if you can tell format to do that or if you > have to e

Re: [Tutor] Python sqlite3 issue

2014-10-20 Thread Juan Christian
Ok, new code using ?: import sqlite3 db = sqlite3.connect('db.sqlite') def create_db(): db.execute(''' CREATE TABLE TOPICS( ID INT PRIMARY KEY NOT NULL, URL VARCHAR NOT NULL, AUTHOR VARCHAR NOT NULL, MESSAGE VARCHAR NOT NULL ); ''') def insert_db(_id, ur

Re: [Tutor] Python sqlite3 issue

2014-10-20 Thread Alan Gauld
On 20/10/14 18:04, Juan Christian wrote: CREATE TABLE TOPICS( ID INT PRIMARY KEY NOT NULL, This means SQLite will automatically create the ID value, you do not need to provide one. URL VARCHAR NOT NULL, AUTHOR VARCHAR NOT NULL, MESSAGE VARCHAR NOT NULL ); ''') def insert_db(_id, url, auth

Re: [Tutor] Python sqlite3 issue

2014-10-20 Thread Alan Gauld
On 20/10/14 18:04, Juan Christian wrote: What's the problem? It's just a test script just to learn sqlite3 with python. If you are learning SQLite3 as well as how to access it from Python I strongly recommend installing the sqlite3 interpreter and typing the SQL commands directly into that.

Re: [Tutor] Insert time into email

2014-10-20 Thread Crush
Hey thanks for the help, it worked like a charm. I will post the complete code soon, so others may benefit should they ever need it. Thanks again. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.pyth