Re: Can't Add Variable

2010-01-04 Thread Joe Riopel
On Mon, Jan 4, 2010 at 12:28 PM, Victor Subervi victorsube...@gmail.com wrote:
 Hi;
 I have this code snippet:

     sql '''create table if not exists %sCustomerData (

I think you may have forgotten the = after sql.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Can't Add Variable

2010-01-04 Thread Stephen Hansen
On Mon, Jan 4, 2010 at 9:28 AM, Victor Subervi victorsube...@gmail.comwrote:

 Hi;
 I have this code snippet:

 sql '''create table if not exists %sCustomerData (


You left out the actual assignment operator.

--S
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Can't Add Variable

2010-01-04 Thread Chris Rebert
On Mon, Jan 4, 2010 at 9:28 AM, Victor Subervi victorsube...@gmail.com wrote:
 Hi;
 I have this code snippet:

     sql '''create table if not exists %sCustomerData (

You're missing an equal sign there to start with (i.e. sql = ''').

Cheers,
Chris
--
http://blog.rebertia.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Can't Add Variable

2010-01-04 Thread MRAB

Victor Subervi wrote:

Hi;
I have this code snippet:

sql '''create table if not exists %sCustomerData (
  ID tinyint(8) unsigned primary key auto_increment,
  Email varchar(120) not null,
  PhoneNumber varchar(20) not null,
  BillingName varchar(80) not null,
  BillingAddress1 varchar(100) not null,
  BillingAddress2 varchar(100) null,
  BillingCity varchar(50) not null,
  BillingState varchar(2) not null,
  BillingPostalCode varchar(8) not null,
  ShippingName varchar(80) not null,
  ShippingAddress1 varchar(100) not null,
  ShippingAddress2 varchar(100) null,
  ShippingCity varchar(50) not null,
  ShippingState varchar(2) not null,
  ShippingPostalCode varchar(8) not null,
  TypeOfCard set(VISA, MasterCard, AmEx, Discover, PayPal) 
null,

  CreditCardNumber tinyint(8) unsigned null,
  CreditCardExpMonth tinyint(2) unsigned null,
  CreditCardExpYear tinyint(4) unsigned null
  );''' % store

It throws this error:

[Mon Jan 04 09:23:54 2010] [error] [client 66.82.9.61]   File 
/var/www/html/angrynates.com/cart/cart2.py 
http://angrynates.com/cart/cart2.py, line 62, referer: 
http://angrynates.com/cart/cart.py
[Mon Jan 04 09:23:54 2010] [error] [client 66.82.9.61] );''' % 
store, referer: http://angrynates.com/cart/cart.py
[Mon Jan 04 09:23:54 2010] [error] [client 66.82.9.61] ^, 
referer: http://angrynates.com/cart/cart.py
[Mon Jan 04 09:23:54 2010] [error] [client 66.82.9.61] SyntaxError: 
invalid syntax, referer: http://angrynates.com/cart/cart.py
[Mon Jan 04 09:23:54 2010] [error] [client 66.82.9.61] Premature end of 
script headers: cart2.py, referer: http://angrynates.com/cart/cart.py


Variable store is defined. How is my syntax invalid? Total code follows.


If it was complaining that store wasn't defined, the exception would
have been NameError.

It's a SyntaxError because of the missing =.
--
http://mail.python.org/mailman/listinfo/python-list


Re: Can't Add Variable

2010-01-04 Thread Victor Subervi
On Mon, Jan 4, 2010 at 1:42 PM, Chris Rebert c...@rebertia.com wrote:

 On Mon, Jan 4, 2010 at 9:28 AM, Victor Subervi victorsube...@gmail.com
 wrote:
  Hi;
  I have this code snippet:
 
  sql '''create table if not exists %sCustomerData (

 You're missing an equal sign there to start with (i.e. sql = ''').


LOL. I think it's time to put a gun to my head ;/ Thanks.
beno
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Can't Add Variable

2010-01-04 Thread alex23
On Jan 5, 3:40 am, Joe Riopel goo...@gmail.com wrote:
 On Mon, Jan 4, 2010 at 12:28 PM, Victor Subervi victorsube...@gmail.com 
 wrote:
  Hi;
  I have this code snippet:

      sql '''create table if not exists %sCustomerData (

 I think you may have forgotten the = after sql.

Jesus wept. How long is this list going to continue to finish Victor's
project for him?

These questions _clearly_ belong on python-tutor.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Can't Add Variable

2010-01-04 Thread MRAB

alex23 wrote:

On Jan 5, 3:40 am, Joe Riopel goo...@gmail.com wrote:

On Mon, Jan 4, 2010 at 12:28 PM, Victor Subervi victorsube...@gmail.com wrote:

Hi;
I have this code snippet:
sql '''create table if not exists %sCustomerData (

I think you may have forgotten the = after sql.


Jesus wept. How long is this list going to continue to finish Victor's
project for him?

These questions _clearly_ belong on python-tutor.


Who is this Jesus person? You should remember that this is a
predominantly Guido-worshipping list! :-)
--
http://mail.python.org/mailman/listinfo/python-list