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


Groups > comp.lang.python > #19049 > unrolled thread

pymysql only works under IDLE

Started bySaul Spatz <saul.spatz@gmail.com>
First post2012-01-16 16:18 -0800
Last post2012-01-16 19:25 -0800
Articles 4 — 2 participants

Back to article view | Back to comp.lang.python


Contents

  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

#19049 — pymysql only works under IDLE

FromSaul Spatz <saul.spatz@gmail.com>
Date2012-01-16 16:18 -0800
Subjectpymysql only works under IDLE
Message-ID<11576187.1088.1326759502632.JavaMail.geo-discussion-forums@vbwl1>
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.  

I'm running on Windows 7.

I'll be grateful for any help you can give me.

Saul

[toc] | [next] | [standalone]


#19050

FromChris Rebert <clp2@rebertia.com>
Date2012-01-16 17:11 -0800
Message-ID<mailman.4801.1326762671.27778.python-list@python.org>
In reply to#19049
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

[toc] | [prev] | [next] | [standalone]


#19051

FromSaul Spatz <saul.spatz@gmail.com>
Date2012-01-16 19:25 -0800
Message-ID<21298399.2044.1326770736045.JavaMail.geo-discussion-forums@yqhh6>
In reply to#19050
Thanks a lot; I didn't know about sys.executable.  For the record, IDLE is running pythonw.exe.  I won't have a chance to test if this helps till tomorrow, unfortunately.

[toc] | [prev] | [next] | [standalone]


#19052

FromSaul Spatz <saul.spatz@gmail.com>
Date2012-01-16 19:25 -0800
Message-ID<mailman.4805.1326770745.27778.python-list@python.org>
In reply to#19050
Thanks a lot; I didn't know about sys.executable.  For the record, IDLE is running pythonw.exe.  I won't have a chance to test if this helps till tomorrow, unfortunately.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web