pgcopy 1.2.0

2017-03-26 Thread altaurog
pgcopy 1.2.0 is now available! pgcopy is a small utility for fast inserts to postgresql using binary copy. features: * Support for many datatypes * Tested with python 2.7 and 3.3 - 3.6 * Works with postgresql versions 8.4 - 9.6 * Cache data on disk or in memo

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Δευτέρα, 27 Μαρτίου 2017 - 6:00:34 π.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: > On Mon, Mar 27, 2017 at 1:52 PM, Νίκος Βέργος wrote: > > Its NOT that i have not read it exactly, but for some strange reason i was > > under the belief that the way i had syntactically typed the UPDATE query >

RE: [Python-ideas] Proposal: Query language extension to Python (PythonQL)

2017-03-26 Thread Gerald Britton
(Forgot the subject) > >* On 25 Mar 2017, at 15:51, Gerald Britton >> wrote: > *> >* On 25 March 2017 at 11:24, Pavel Velikhov >> wrote: > *>* > No, the current solution is temporary

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Chris Angelico
On Mon, Mar 27, 2017 at 1:52 PM, Νίκος Βέργος wrote: > Its NOT that i have not read it exactly, but for some strange reason i was > under the belief that the way i had syntactically typed the UPDATE query was > correctly and more consistent and similar to thr INSERT query and it was > prefered

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Δευτέρα, 27 Μαρτίου 2017 - 5:43:01 π.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: > On Mon, Mar 27, 2017 at 1:39 PM, Νίκος Βέργος wrote: > >> MariaDB / MySQL shows part of your SQL from where they failed to parse. > >> In your case, your MariaDB can't parse from '(' > >> LIKE clause is not probl

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Chris Angelico
On Mon, Mar 27, 2017 at 1:39 PM, Νίκος Βέργος wrote: >> MariaDB / MySQL shows part of your SQL from where they failed to parse. >> In your case, your MariaDB can't parse from '(' >> LIKE clause is not problem for this issue? > > Yes indeed it is. > I was just so sure that UPDATE was working like I

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Δευτέρα, 27 Μαρτίου 2017 - 2:27:31 π.μ. UTC+3, ο χρήστης INADA Naoki έγραψε: > > i dont have to update table set column1 = this value, column2=that value and > > so on > > Why do you think so? Did you really read the manual? > > mysql> create table test_update (a int primary key, b int, c int

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-03-26 Thread Tim Chase
On 2017-03-27 02:37, Chris Angelico wrote: > > In DOS, (I don't remember if in all versions or only some) > > one could do all this and this opens very rich possibilities for > > approximating of objects with tiles. The only limitations > > that one uses 255 tiles, but even this enables to build >

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Steve D'Aprano
On Mon, 27 Mar 2017 07:13 am, Νίκος Βέργος wrote: > OMG!!! It actually worked! > > Can't believe that 3 days in a row i have tried everything concerning > string manipulation and mysql escaping nd the error was the UPDATE > itself You tried everything except what we told you, over and over a

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-03-26 Thread Mikhail V
On 26 March 2017 at 21:53, Chris Angelico wrote: > On Mon, Mar 27, 2017 at 6:25 AM, Mikhail V wrote: >> On 26 March 2017 at 20:10, Steve D'Aprano wrote: >>> On Mon, 27 Mar 2017 03:57 am, Mikhail V wrote: >>> >>> [...] >> And more important: can one use binary (bitmap) fonts in default modern

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread INADA Naoki
> i dont have to update table set column1 = this value, column2=that value and > so on Why do you think so? Did you really read the manual? mysql> create table test_update (a int primary key, b int, c int); Query OK, 0 rows affected (0.02 sec) mysql> insert into test_update values (1, 2, 3); Qu

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread breamoreboy
On Sunday, March 26, 2017 at 8:33:49 PM UTC+1, Νίκος Βέργος wrote: > Τη Κυριακή, 26 Μαρτίου 2017 - 10:23:27 μ.μ. UTC+3, ο χρήστης > bream...@gmail.com έγραψε: > > On Sunday, March 26, 2017 at 4:11:54 PM UTC+1, Νίκος Βέργος wrote: > > > Τη Κυριακή, 26 Μαρτίου 2017 - 5:49:00 μ.μ. UTC+3, ο χρήστης Ia

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread breamoreboy
On Sunday, March 26, 2017 at 4:11:54 PM UTC+1, Νίκος Βέργος wrote: > Τη Κυριακή, 26 Μαρτίου 2017 - 5:49:00 μ.μ. UTC+3, ο χρήστης Ian έγραψε: > > > The database wrapper won't do substitution into the middle of a string > > like that. Either concatenate the literal %'s on in the SQL statement > > or

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-03-26 Thread eryk sun
On Sun, Mar 26, 2017 at 6:57 PM, Chris Angelico wrote: > > In actual UCS-2, surrogates are entirely disallowed; in UTF-16, they *must* be > correctly paired. Strictly-speaking UCS-2 disallows codes that aren't defined by the standard, but the kernel couldn't be that restrictive. Unicode was a mov

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Κυριακή, 26 Μαρτίου 2017 - 11:59:21 μ.μ. UTC+3, ο χρήστης Larry Hudson έγραψε: > On 03/26/2017 01:21 AM, Νίκος Βέργος wrote: > > print('''UPDATE visitors SET (pagesID, host, ref, location, useros, > > browser, visits) VALUES (%s, %s, %s, %s, %s, %s, %s) WHERE host LIKE > > "%s"''', (pID, doma

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Larry Hudson via Python-list
On 03/26/2017 01:21 AM, Νίκος Βέργος wrote: print('''UPDATE visitors SET (pagesID, host, ref, location, useros, browser, visits) VALUES (%s, %s, %s, %s, %s, %s, %s) WHERE host LIKE "%s"''', (pID, domain, ref, location, useros, browser, lastvisit, domain) ) prints out: UPDATE visitors SET (pag

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Κυριακή, 26 Μαρτίου 2017 - 11:05:34 μ.μ. UTC+3, ο χρήστης Νίκος Βέργος έγραψε: > Τη Κυριακή, 26 Μαρτίου 2017 - 10:56:07 μ.μ. UTC+3, ο χρήστης Chris Angelico > έγραψε: > > On Mon, Mar 27, 2017 at 6:33 AM, Νίκος Βέργος wrote: > > > Since i'm incopetent as you suggest i'am show us your level of

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Κυριακή, 26 Μαρτίου 2017 - 10:56:07 μ.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: > On Mon, Mar 27, 2017 at 6:33 AM, Νίκος Βέργος wrote: > > Since i'm incopetent as you suggest i'am show us your level of skills and > > expertise and provide a solution, otherwise you are also what you claim of

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Chris Angelico
On Mon, Mar 27, 2017 at 6:33 AM, Νίκος Βέργος wrote: > Since i'm incopetent as you suggest i'am show us your level of skills and > expertise and provide a solution, otherwise you are also what you claim of me. It's not his problem. An expert does not have to provide solutions to prove his expert

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-03-26 Thread Chris Angelico
On Mon, Mar 27, 2017 at 6:25 AM, Mikhail V wrote: > On 26 March 2017 at 20:10, Steve D'Aprano wrote: >> On Mon, 27 Mar 2017 03:57 am, Mikhail V wrote: >> >> [...] > And more important: can one use binary (bitmap) fonts in default modern > linux console? If yes, can one patch them with cus

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Κυριακή, 26 Μαρτίου 2017 - 10:23:27 μ.μ. UTC+3, ο χρήστης bream...@gmail.com έγραψε: > On Sunday, March 26, 2017 at 4:11:54 PM UTC+1, Νίκος Βέργος wrote: > > Τη Κυριακή, 26 Μαρτίου 2017 - 5:49:00 μ.μ. UTC+3, ο χρήστης Ian έγραψε: > > > > > The database wrapper won't do substitution into the mi

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-03-26 Thread Mikhail V
On 26 March 2017 at 20:10, Steve D'Aprano wrote: > On Mon, 27 Mar 2017 03:57 am, Mikhail V wrote: > > [...] And more important: can one use binary (bitmap) fonts in default modern linux console? If yes, can one patch them with custom tiles at the application start? >>> >>> If you re

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Κυριακή, 26 Μαρτίου 2017 - 10:04:31 μ.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: > On Mon, Mar 27, 2017 at 5:52 AM, Νίκος Βέργος wrote: > > Τη Κυριακή, 26 Μαρτίου 2017 - 9:32:13 μ.μ. UTC+3, ο χρήστης Chris Angelico > > έγραψε: > >> On Mon, Mar 27, 2017 at 4:54 AM, Νίκος Βέργος wrote: > >> >

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Chris Angelico
On Mon, Mar 27, 2017 at 5:52 AM, Νίκος Βέργος wrote: > Τη Κυριακή, 26 Μαρτίου 2017 - 9:32:13 μ.μ. UTC+3, ο χρήστης Chris Angelico > έγραψε: >> On Mon, Mar 27, 2017 at 4:54 AM, Νίκος Βέργος wrote: >> > Τη Κυριακή, 26 Μαρτίου 2017 - 8:06:07 μ.μ. UTC+3, ο χρήστης INADA Naoki >> > έγραψε: >> >> Rea

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-03-26 Thread Chris Angelico
On Mon, Mar 27, 2017 at 5:37 AM, eryk sun wrote: > On Sun, Mar 26, 2017 at 5:58 PM, Chris Angelico wrote: >>> The Windows console can render any character in the BMP, but it >>> requires configuring font linking for fallback fonts. It's Windows, so >>> of course the supported UTF format is UTF-16

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Κυριακή, 26 Μαρτίου 2017 - 8:58:55 μ.μ. UTC+3, ο χρήστης alister έγραψε: > On Sun, 26 Mar 2017 07:43:51 -0700, Νίκος Βέργος wrote: > > > Τη Κυριακή, 26 Μαρτίου 2017 - 5:38:57 μ.μ. UTC+3, ο χρήστης alister > > έγραψε: > >> On Sun, 26 Mar 2017 07:24:49 -0700, Νίκος Βέργος wrote: > >> > >> > Τη Κ

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Κυριακή, 26 Μαρτίου 2017 - 9:32:13 μ.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: > On Mon, Mar 27, 2017 at 4:54 AM, Νίκος Βέργος wrote: > > Τη Κυριακή, 26 Μαρτίου 2017 - 8:06:07 μ.μ. UTC+3, ο χρήστης INADA Naoki > > έγραψε: > >> Read my mail again. > >> > >> > This error came from MySQL. If t

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread breamoreboy
On Sunday, March 26, 2017 at 3:11:50 PM UTC+1, Ian wrote: > On Sun, Mar 26, 2017 at 7:39 AM, MeV wrote: > > On Sunday, March 26, 2017 at 6:34:30 AM UTC-7, Νίκος Βέργος wrote: > >> with import cgitb; cgitb.enable() > >> > >> ProgrammingError(1064, "You have an error in your SQL syntax; check the >

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-03-26 Thread eryk sun
On Sun, Mar 26, 2017 at 5:49 PM, eryk sun wrote: > On Sun, Mar 26, 2017 at 5:29 PM, Chris Angelico wrote: >> Rounded corners? >> >> ╭─┬─╮ >> ├─┼─┤ >> ╰─┴─╯ > > This prints fine in the Windows console with Consolas as the font, but > the older Courier New and Lucida Console fonts lack glyphs for t

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-03-26 Thread eryk sun
On Sun, Mar 26, 2017 at 5:58 PM, Chris Angelico wrote: >> The Windows console can render any character in the BMP, but it >> requires configuring font linking for fallback fonts. It's Windows, so >> of course the supported UTF format is UTF-16. The console's UTF-8 >> support (codepage 65001) is to

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Chris Angelico
On Mon, Mar 27, 2017 at 4:54 AM, Νίκος Βέργος wrote: > Τη Κυριακή, 26 Μαρτίου 2017 - 8:06:07 μ.μ. UTC+3, ο χρήστης INADA Naoki > έγραψε: >> Read my mail again. >> >> > This error came from MySQL. If there are no logs in error_log, it's >> > your configuration issue. >> >> > See https://dev.mysql

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-03-26 Thread Chris Angelico
On Mon, Mar 27, 2017 at 5:10 AM, Steve D'Aprano wrote: >> And for own standalone app, I would not use any TTF or >> anything vector-based font, since why? > > Right, because your users will *love* to see their native language displayed > in a crappy bitmapped font with jagged or blurry edges. Sid

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-03-26 Thread Chris Angelico
On Mon, Mar 27, 2017 at 4:43 AM, Steve D'Aprano wrote: > On Mon, 27 Mar 2017 02:37 am, Chris Angelico wrote: > >> Just use Unicode. Everything else, these days, is a subset of Unicode >> anyway. Unless you're stuck on the default Windows shell/terminal, you >> should be able to use UTF-8 everywher

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-03-26 Thread Steve D'Aprano
On Mon, 27 Mar 2017 03:57 am, Mikhail V wrote: [...] >>> And more important: can one use binary (bitmap) fonts in default modern >>> linux console? If yes, can one patch them with custom tiles at >>> the application start? >> >> If you really need something completely custom, it's not text any >>

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread alister
On Sun, 26 Mar 2017 07:43:51 -0700, Νίκος Βέργος wrote: > Τη Κυριακή, 26 Μαρτίου 2017 - 5:38:57 μ.μ. UTC+3, ο χρήστης alister > έγραψε: >> On Sun, 26 Mar 2017 07:24:49 -0700, Νίκος Βέργος wrote: >> >> > Τη Κυριακή, 26 Μαρτίου 2017 - 5:19:27 μ.μ. UTC+3, ο χρήστης Ian >> > έγραψε: >> > >> >> You n

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-03-26 Thread Chris Angelico
On Mon, Mar 27, 2017 at 4:38 AM, eryk sun wrote: > On Sun, Mar 26, 2017 at 3:37 PM, Chris Angelico wrote: >> >> Just use Unicode. Everything else, these days, is a subset of Unicode >> anyway. Unless you're stuck on the default Windows shell/terminal, you >> should be able to use UTF-8 everywhere

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Κυριακή, 26 Μαρτίου 2017 - 8:06:07 μ.μ. UTC+3, ο χρήστης INADA Naoki έγραψε: > Read my mail again. > > > This error came from MySQL. If there are no logs in error_log, it's > > your configuration issue. > > > See https://dev.mysql.com/doc/refman/5.7/en/update.html for Update > > statement syn

Re: Installation issue with Python 3.6.1 for 64 bit Windows

2017-03-26 Thread Arjun Janah
Thank you, Eryk Sun. On Mar 26, 2017 12:40 PM, "eryk sun" wrote: > On Sun, Mar 26, 2017 at 4:01 AM, arjun.janah > wrote: > > > > I ran the file and it appeared to install properly. But when I tried to > run Python from > > the Windows All Programs menu tab, I got the following message, in a > s

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-03-26 Thread eryk sun
On Sun, Mar 26, 2017 at 5:29 PM, Chris Angelico wrote: > Rounded corners? > > ╭─┬─╮ > ├─┼─┤ > ╰─┴─╯ This prints fine in the Windows console with Consolas as the font, but the older Courier New and Lucida Console fonts lack glyphs for the rounded corners. -- https://mail.python.org/mailman/listin

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-03-26 Thread Steve D'Aprano
On Mon, 27 Mar 2017 02:37 am, Chris Angelico wrote: > On Mon, Mar 27, 2017 at 2:17 AM, Mikhail V wrote: Why? IIRC I can do good pseudographics on linux only with extended unicode character sets, so yes it is possible, is that what you mean? >>> >>> No. The same ASCII character set that

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-03-26 Thread eryk sun
On Sun, Mar 26, 2017 at 3:37 PM, Chris Angelico wrote: > > Just use Unicode. Everything else, these days, is a subset of Unicode > anyway. Unless you're stuck on the default Windows shell/terminal, you > should be able to use UTF-8 everywhere and have the entire Unicode > range available. The Win

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-03-26 Thread Chris Angelico
On Mon, Mar 27, 2017 at 3:57 AM, Mikhail V wrote: > On 26 March 2017 at 17:37, Chris Angelico wrote: >> On Mon, Mar 27, 2017 at 2:17 AM, Mikhail V wrote: > Why? IIRC I can do good pseudographics on linux only with extended > unicode character sets, so yes it is possible, is that what you

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
I do not see why my UPDATE fails. cur.execute('''UPDATE visitors SET (pagesID, host, ref, location, useros, browser, visits) VALUES (%s, %s, %s, %s, %s, %s, %s)''') works i dont have to update table set column1 = this value, column2=that value and so on It's just when the LIKE clause jumps in th

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread INADA Naoki
Read my mail again. > This error came from MySQL. If there are no logs in error_log, it's > your configuration issue. > See https://dev.mysql.com/doc/refman/5.7/en/update.html for Update > statement syntax. -- https://mail.python.org/mailman/listinfo/python-list

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Any ideas on how to make progress on that? After all its just an UPDATE with a WHERE clause?! Do you also think is DBI related issue? -- https://mail.python.org/mailman/listinfo/python-list

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-03-26 Thread Mikhail V
On 26 March 2017 at 17:37, Chris Angelico wrote: > On Mon, Mar 27, 2017 at 2:17 AM, Mikhail V wrote: Why? IIRC I can do good pseudographics on linux only with extended unicode character sets, so yes it is possible, is that what you mean? >>> >>> No. The same ASCII character set that wa

Re: Installation issue with Python 3.6.1 for 64 bit Windows

2017-03-26 Thread eryk sun
On Sun, Mar 26, 2017 at 4:01 AM, arjun.janah wrote: > > I ran the file and it appeared to install properly. But when I tried to run > Python from > the Windows All Programs menu tab, I got the following message, in a small > window by the window with a black screen: >

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Joel Goldstick
On Sun, Mar 26, 2017 at 11:48 AM, Νίκος Βέργος wrote: > Τη Κυριακή, 26 Μαρτίου 2017 - 6:39:01 μ.μ. UTC+3, ο χρήστης Steve D'Aprano > έγραψε: >> On Mon, 27 Mar 2017 02:11 am, Νίκος Βέργος wrote: >> >> > I just tried: >> > >> > domain = '.'.join( host.split('.')[-2:] ) >> > domain = '%' + domain +

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Currently to avoid any misinformations my code looks as follows: domain = '.'.join( host.split('.')[-2:] ) domain_query = '%%%s' % domain cur.execute('''UPDATE visitors SET (pagesID, host, ref, location, useros, browser, visits) VALUES (%s, %s, %s, %s, %s, %s, %s) WHERE host LIKE %s''', (pID, d

Re: Installation issue with Python 3.6.1 for 64 bit Windows

2017-03-26 Thread Sibylle Koczian
Am 26.03.2017 um 06:01 schrieb arjun.janah: Hello, I am using an HP PC, brought in 2009, which currently has on it Windows 7 Ultimate, Service Pack 1. Did you do all Windows updates? System type is 64-bit operating system. I went to https://www.python.org/downloads/windows/ and chose the f

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Chris Angelico
On Mon, Mar 27, 2017 at 2:48 AM, Νίκος Βέργος wrote: >> > which you can see at http://superhost.gr >> >> Ah, Nikos, its been a long time! I thought I recognised your style of >> posting. > > > Howdy Steve! > Yes its me and yes its have been a long time! How are you?! > Irony lost. ChrisA -- htt

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Κυριακή, 26 Μαρτίου 2017 - 6:39:01 μ.μ. UTC+3, ο χρήστης Steve D'Aprano έγραψε: > On Mon, 27 Mar 2017 02:11 am, Νίκος Βέργος wrote: > > > I just tried: > > > > domain = '.'.join( host.split('.')[-2:] ) > > domain = '%' + domain + '%' > > > > cur.execute('''UPDATE visitors SET (pagesID, host,

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Κυριακή, 26 Μαρτίου 2017 - 6:28:12 μ.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: > On Mon, Mar 27, 2017 at 2:11 AM, Νίκος Βέργος wrote: > > Τη Κυριακή, 26 Μαρτίου 2017 - 5:49:00 μ.μ. UTC+3, ο χρήστης Ian έγραψε: > > > >> The database wrapper won't do substitution into the middle of a string > >

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Steve D'Aprano
On Mon, 27 Mar 2017 02:11 am, Νίκος Βέργος wrote: > I just tried: > > domain = '.'.join( host.split('.')[-2:] ) > domain = '%' + domain + '%' > > cur.execute('''UPDATE visitors SET (pagesID, host, ref, location, useros, > browser, visits) VALUES (%s, %s, %s, %s, %s, %s, %s) WHERE host LIKE "%s"

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-03-26 Thread Chris Angelico
On Mon, Mar 27, 2017 at 2:37 AM, Chris Angelico wrote: > Just use Unicode. Everything else, these days, is a subset of Unicode > anyway. (Caveat: There are a few counter-examples to my statement, but I very much doubt that someone who's talking about PC OEM graphics is going to be running into th

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-03-26 Thread Chris Angelico
On Mon, Mar 27, 2017 at 2:17 AM, Mikhail V wrote: >>> Why? IIRC I can do good pseudographics on linux only with extended >>> unicode character sets, so yes it is possible, is that what you mean? >> >> No. The same ASCII character set that was available in DOS is >> available in Linux without unic

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Chris Angelico
On Mon, Mar 27, 2017 at 2:11 AM, Νίκος Βέργος wrote: > Τη Κυριακή, 26 Μαρτίου 2017 - 5:49:00 μ.μ. UTC+3, ο χρήστης Ian έγραψε: > >> The database wrapper won't do substitution into the middle of a string >> like that. Either concatenate the literal %'s on in the SQL statement >> or add them to the

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
domain = '.'.join( host.split('.')[-2:] ) domain = '%' + domain + '%' domain = '%%%s%%' % domain domain = '%{}%'.format(domain) cur.execute('''UPDATE visitors SET (pagesID, host, ref, location, useros, browser, visits) VALUES (%s, %s, %s, %s, %s, %s, %s) WHERE host LIKE "%s" ''',

Re: Python question

2017-03-26 Thread Steve D'Aprano
On Sun, 26 Mar 2017 10:35 pm, Cameron Simpson wrote: > On 26Mar2017 20:55, Steve D'Aprano wrote: >>On Sun, 26 Mar 2017 01:55 pm, c...@zip.com.au wrote: >>> 1: He BCCed the list, not us individually. Look at the headers. >> >>BCCed addresses aren't visible in the headers. That's why they're BLIND

Text-mode apps (Was :Who are the "spacists"?)

2017-03-26 Thread Mikhail V
On 26 March 2017 at 16:28, Wildman via Python-list wrote: > On Sun, 26 Mar 2017 15:18:06 +0200, Mikhail V wrote: > >> On 26 March 2017 at 06:16, Wildman via Python-list >> wrote: >>> On Tue, 21 Mar 2017 15:15:14 +0100, Mikhail V wrote: >>> And on linux console, by default one does not even h

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Κυριακή, 26 Μαρτίου 2017 - 5:49:00 μ.μ. UTC+3, ο χρήστης Ian έγραψε: > The database wrapper won't do substitution into the middle of a string > like that. Either concatenate the literal %'s on in the SQL statement > or add them to the string before you pass it in, i.e. '%' + domain + > '%' or '

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Ian Kelly
On Sun, Mar 26, 2017 at 8:24 AM, Νίκος Βέργος wrote: > Τη Κυριακή, 26 Μαρτίου 2017 - 5:19:27 μ.μ. UTC+3, ο χρήστης Ian έγραψε: > >> You need to change the placeholders back. The poster who told you to >> replace them was misinformed. > > okey altered them back to > > cur.execute('''UPDATE visitors

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
I see thank you for pointing that out. Now i'm receiving no error in error_log but when i'm running the script it displays this: ProgrammingError(1064, "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(pages

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Steve D'Aprano
On Mon, 27 Mar 2017 12:52 am, Νίκος Βέργος wrote: > cur.execute('''UPDATE visitors SET (pagesID, host, ref, location, useros, > browser, visits) VALUES ({}, {}, {}, {}, {}, {}, {}) WHERE host LIKE > "{}"'''.format(pID, domain, ref, location, useros, browser, lastvisit, > domain) ) > > Same kind o

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
i have tried that 2 days ago. Problem is that you maintained space before and after '%s' which wont work within like How would you type it without space as in "%%s%" ? Στις Κυρ, 26 Μαρ 2017 στις 5:32 μ.μ., ο/η INADA Naoki < songofaca...@gmail.com> έγραψε: > > I MEAN HOW TO DIFFERENTIATE '%S' F

Installation issue with Python 3.6.1 for 64 bit Windows

2017-03-26 Thread arjun.janah
Sent from my T-Mobile 4G LTE Device Hello, I am using an HP PC, brought in 2009, which currently has on it Windows 7 Ultimate, Service Pack 1. The processor is an AMD Turion 64 X2 Mobile Technology TL-62 2.10 GHz. Installed memory is 4.00 GB (3.75 GB usable) System type is 64-bit operating sy

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Steve D'Aprano
On Mon, 27 Mar 2017 01:24 am, Νίκος Βέργος wrote: > I MEAN HOW TO DIFFERENTIATE '%S' FROM LITERAL '%' character. Use %% for a literal percent character. py> '%s %% %s' % ('hello', 'world') 'hello % world' -- Steve “Cheer up,” they said, “things could be worse.” So I cheered up, and sure en

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Κυριακή, 26 Μαρτίου 2017 - 5:38:57 μ.μ. UTC+3, ο χρήστης alister έγραψε: > On Sun, 26 Mar 2017 07:24:49 -0700, Νίκος Βέργος wrote: > > > Τη Κυριακή, 26 Μαρτίου 2017 - 5:19:27 μ.μ. UTC+3, ο χρήστης Ian έγραψε: > > > >> You need to change the placeholders back. The poster who told you to > >> re

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread alister
On Sun, 26 Mar 2017 07:24:49 -0700, Νίκος Βέργος wrote: > Τη Κυριακή, 26 Μαρτίου 2017 - 5:19:27 μ.μ. UTC+3, ο χρήστης Ian έγραψε: > >> You need to change the placeholders back. The poster who told you to >> replace them was misinformed. > > okey altered them back to > > cur.execute('''UPDATE vi

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread INADA Naoki
I used space only for readability. It's not required. >>> '%%%s%%' % (42,) '%42%' On Sun, Mar 26, 2017 at 11:35 PM, Νίκος Βέργος wrote: > i have tried that 2 days ago. > > Problem is that you maintained space before and after '%s' which wont work > within like > > How would you type it without

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread INADA Naoki
> I MEAN HOW TO DIFFERENTIATE '%S' FROM LITERAL '%' character. > >>> '%% %s %%s' % (42,) '% 42 %s' Use %% -- https://mail.python.org/mailman/listinfo/python-list

Re: Who are the "spacists"?

2017-03-26 Thread Wildman via Python-list
On Sun, 26 Mar 2017 15:18:06 +0200, Mikhail V wrote: > On 26 March 2017 at 06:16, Wildman via Python-list > wrote: >> On Tue, 21 Mar 2017 15:15:14 +0100, Mikhail V wrote: >> >>> And on linux console, by default one does not even have good >>> possibilities for text-mode pseudographics, it was mor

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Κυριακή, 26 Μαρτίου 2017 - 5:19:27 μ.μ. UTC+3, ο χρήστης Ian έγραψε: > You need to change the placeholders back. The poster who told you to > replace them was misinformed. okey altered them back to cur.execute('''UPDATE visitors SET (pagesID, host, ref, location, useros, browser, visits) VAL

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Ian Kelly
On Sun, Mar 26, 2017 at 8:07 AM, Νίκος Βέργος wrote: > Τη Κυριακή, 26 Μαρτίου 2017 - 5:04:27 μ.μ. UTC+3, ο χρήστης INADA Naoki This > error came from MySQL. If there are no logs in error_log, it's >> your configuration issue. >> >> See https://dev.mysql.com/doc/refman/5.7/en/update.html for Upda

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Ian Kelly
On Sun, Mar 26, 2017 at 7:39 AM, MeV wrote: > On Sunday, March 26, 2017 at 6:34:30 AM UTC-7, Νίκος Βέργος wrote: >> with import cgitb; cgitb.enable() >> >> ProgrammingError(1064, "You have an error in your SQL syntax; check the >> manual that corresponds to your MariaDB server version for the rig

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Κυριακή, 26 Μαρτίου 2017 - 5:04:27 μ.μ. UTC+3, ο χρήστης INADA Naoki This error came from MySQL. If there are no logs in error_log, it's > your configuration issue. > > See https://dev.mysql.com/doc/refman/5.7/en/update.html for Update > statement syntax. cur.execute('''UPDATE visitors SET (

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Frank Millman
"Νίκος Βέργος" wrote in message news:8c5f0443-c61b-4059-8d6f-576152d59...@googlegroups.com... cur.execute('''UPDATE visitors SET (pagesID, host, ref, location, useros, browser, visits) VALUES (%s, %s, %s, %s, %s, %s, %s) WHERE host LIKE %s''', (pID, domain, ref, location, useros, browser,

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread INADA Naoki
On Sun, Mar 26, 2017 at 10:34 PM, Νίκος Βέργος wrote: > with import cgitb; cgitb.enable() > > ProgrammingError(1064, "You have an error in your SQL syntax; check the > manual that corresponds to your MariaDB server version for the right syntax > to use near '(pagesID, host, ref, location, useros

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
cur.execute('''UPDATE visitors SET (pagesID, host, ref, location, useros, browser, visits) VALUES ({}, {}, {}, {}, {}, {}, {}) WHERE host LIKE "{}"'''.format(pID, domain, ref, location, useros, browser, lastvisit, domain) ) Same kind of output in the error-log even with this attempt. -- https:/

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Κυριακή, 26 Μαρτίου 2017 - 4:39:44 μ.μ. UTC+3, ο χρήστης MeV έγραψε: > On Sunday, March 26, 2017 at 6:34:30 AM UTC-7, Νίκος Βέργος wrote: > > with import cgitb; cgitb.enable() > > > > ProgrammingError(1064, "You have an error in your SQL syntax; check the > > manual that corresponds to your Ma

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Κυριακή, 26 Μαρτίου 2017 - 4:39:44 μ.μ. UTC+3, ο χρήστης MeV έγραψε: > On Sunday, March 26, 2017 at 6:34:30 AM UTC-7, Νίκος Βέργος wrote: > > with import cgitb; cgitb.enable() > > > > ProgrammingError(1064, "You have an error in your SQL syntax; check the > > manual that corresponds to your Ma

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Ths is the whole snippert i'am trying so you can see what i'm tryong to do. [code] # if bot is contained in hostname update all previous database bot hostname entries with current bot hostname for bot in bots: if bot in host:

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread MeV
On Sunday, March 26, 2017 at 6:34:30 AM UTC-7, Νίκος Βέργος wrote: > with import cgitb; cgitb.enable() > > ProgrammingError(1064, "You have an error in your SQL syntax; check the > manual that corresponds to your MariaDB server version for the right syntax > to use near '(pagesID, host, ref, loc

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
with import cgitb; cgitb.enable() ProgrammingError(1064, "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(pagesID, host, ref, location, useros, browser, visits) VALUES (1, 'cyta.gr', '' at line 1") that i

Re: Who are the "spacists"?

2017-03-26 Thread Mikhail V
On 26 March 2017 at 06:16, Wildman via Python-list wrote: > On Tue, 21 Mar 2017 15:15:14 +0100, Mikhail V wrote: > >> And on linux console, by default one does not even have good >> possibilities for text-mode pseudographics, it was more relevant >> in DOS where one had rich possibilities and prog

Re: Python question

2017-03-26 Thread Cameron Simpson
On 26Mar2017 20:55, Steve D'Aprano wrote: On Sun, 26 Mar 2017 01:55 pm, c...@zip.com.au wrote: 1: He BCCed the list, not us individually. Look at the headers. BCCed addresses aren't visible in the headers. That's why they're BLIND CC. Of course, but the received headers etc show it passed t

Re: why and how to run forever and debug when error in for proc in psutil.process_iter()?

2017-03-26 Thread Ho Yeung Lee
On Sunday, March 26, 2017 at 7:40:20 PM UTC+8, Ho Yeung Lee wrote: > On Sunday, March 26, 2017 at 7:32:12 PM UTC+8, Ho Yeung Lee wrote: > > On Sunday, March 26, 2017 at 10:33:51 AM UTC+8, Deborah Swanson wrote: > > > Someone here can probably help you, but they'll need your Python > > > version, op

Re: why and how to run forever and debug when error in for proc in psutil.process_iter()?

2017-03-26 Thread Ho Yeung Lee
On Sunday, March 26, 2017 at 7:32:12 PM UTC+8, Ho Yeung Lee wrote: > On Sunday, March 26, 2017 at 10:33:51 AM UTC+8, Deborah Swanson wrote: > > Someone here can probably help you, but they'll need your Python > > version, operating system, and full traceback. They get tired of saying > > so. > >

Re: why and how to run forever and debug when error in for proc in psutil.process_iter()?

2017-03-26 Thread Ho Yeung Lee
On Sunday, March 26, 2017 at 10:33:51 AM UTC+8, Deborah Swanson wrote: > Someone here can probably help you, but they'll need your Python > version, operating system, and full traceback. They get tired of saying > so. > > In this case, the full traceback is needed to see what went wrong and > whe

Re: Python question

2017-03-26 Thread Steve D'Aprano
On Sun, 26 Mar 2017 01:55 pm, c...@zip.com.au wrote: > 1: He BCCed the list, not us individually. Look at the headers. BCCed addresses aren't visible in the headers. That's why they're BLIND CC. The lack of personal email addresses in the headers doesn't prove they weren't there. All the headers

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Jussi Piitulainen
Νίκος Βέργος writes: > print('''UPDATE visitors SET (pagesID, host, ref, location, useros, > browser, visits) VALUES (%s, %s, %s, %s, %s, %s, %s) WHERE host LIKE > "%s"''', (pID, domain, ref, location, useros, browser, lastvisit, > domain) ) > > prints out: > > UPDATE visitors SET (pagesID, host,

Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
print('''UPDATE visitors SET (pagesID, host, ref, location, useros, browser, visits) VALUES (%s, %s, %s, %s, %s, %s, %s) WHERE host LIKE "%s"''', (pID, domain, ref, location, useros, browser, lastvisit, domain) ) prints out: UPDATE visitors SET (pagesID, host, ref, location, useros, browser, vi