Re: String substitution VS proper mysql escaping

2010-08-19 Thread Nik Gr
Στις 20/8/2010 8:22 πμ, ο/η Cameron Simpson έγραψε: [...snip...] | Why does the page variable which is actually a string needs to be a | tuple or a list and not just as a string which is what it actually | is? With regard to the "%" operator, it considers the string on the left to be a format s

Re: String substitution VS proper mysql escaping

2010-08-19 Thread Nik Gr
Στις 19/8/2010 6:58 μμ, ο/η Tim Chase έγραψε: It can be written as a non-3-quote string, you just have to escape the inner quotes (single & double) and the backslash to be seen: name = 'My name is "Nikos" and I\'m from Thessaloniki\\Greece' name = "My name is \"Nikos\" and I'm from Thessal

Re: String substitution VS proper mysql escaping

2010-08-19 Thread Nik Gr
Στις 19/8/2010 2:32 μμ, ο/η Tim Chase έγραψε: (1,) + (2,) to return "(1,2)" This is actually joining two single element tuples (1,) and (2, ) to a new bigger tuple of two elements, correct? -- http://mail.python.org/mailman/listinfo/python-list

Re: String substitution VS proper mysql escaping

2010-08-19 Thread Nik Gr
Στις 19/8/2010 2:32 μμ, ο/η Tim Chase έγραψε: So Python needs a way to express that you *explicitly* mean "this is one of those rare one-element tuples, not an order of operations prioritization": (1,) + (2,) to return "(1,2)" Yes i can see the difference now!! I just had to look at the big

Re: String substitution VS proper mysql escaping

2010-08-18 Thread Nik Gr
Στις 18/8/2010 7:31 πμ, ο/η Cameron Simpson έγραψε: On 17Aug2010 20:15, Νίκος wrote: | === | cursor.execute( ''' SELECT host, hits, date FROM visitors WHERE page = | '%s' ORDER BY date DESC ''' % (page) ) | === | | Someone told me NOT to d

Re: Trying to set a cookie within a python script

2010-08-03 Thread Nik Gr
Στις 3/8/2010 10:39 πμ, ο/η Chris Rebert έγραψε: Please tell me the difference between 3 things. a) Asking Notepad++(my editor) to save all my python scripts as UTF-8 without BOM. That affects what encoding the text file comprising the source code itself is in. What does this practically mea