Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #19050

Re: pymysql only works under IDLE

References <11576187.1088.1326759502632.JavaMail.geo-discussion-forums@vbwl1>
Date 2012-01-16 17:11 -0800
Subject Re: pymysql only works under IDLE
From Chris Rebert <clp2@rebertia.com>
Newsgroups comp.lang.python
Message-ID <mailman.4801.1326762671.27778.python-list@python.org> (permalink)

Show all headers | View raw


On Mon, Jan 16, 2012 at 4:18 PM, Saul Spatz <saul.spatz@gmail.com> wrote:
> I've been using pymysql to connect to a database, and it has suddenly stopped working on the one machine (a virtual server) where I really need it to work.  I have a function with hard-coded parameters to do the connection, and now I'm getting an error that says, "Can't connect to MySQL server on ...".  The strangest thing is that while I can't connect if I run the script from the command line, or from the shell under Wing IDE, I can connect if I run the script under the IDLE shell.
>
> I noticed that the command line shell prints
>
> Python 2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
>
> at startup, but the IDLE shell prints
>
> Python 2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)] on win32
> Type "copyright", "credits" or "license()" for more information.
>
> So, while the first lines are identical, the second lines are different.  Is this a different interpreter then?  Can anyone tell me what the difference is?  I'm hoping that may help me figure out what's gone wrong.

You can check the value of `sys.executable` in each to see whether
they're the same, and if not, where the other one is from.

Cheers,
Chris
--
http://rebertia.com

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

pymysql only works under IDLE Saul Spatz <saul.spatz@gmail.com> - 2012-01-16 16:18 -0800
  Re: pymysql only works under IDLE Chris Rebert <clp2@rebertia.com> - 2012-01-16 17:11 -0800
    Re: pymysql only works under IDLE Saul Spatz <saul.spatz@gmail.com> - 2012-01-16 19:25 -0800
    Re: pymysql only works under IDLE Saul Spatz <saul.spatz@gmail.com> - 2012-01-16 19:25 -0800

csiph-web