Victor Binns | 1 Feb 01:18 2011
Picon

Need Help in installing MySQLdb-Python

I have Python 2.6.3
 
I went to the following link http://pypi.python.org/pypi/
Found - file (MySQL-python 1.2.3)
 
clicked on file - clicked on (MySQL-python-1.2.3.tar.gz)
 
unzipped the file in a created folder
 
clicked on the file called setup.py
 
following ERROR:
 
Traceback (most recent call last):
  File "C:\Users\victor\Desktop\mysql-python\MySQL-python-1.2.3\setup.py", line 15, in <module>
    metadata, options = get_config()
  File "C:\Users\victor\Desktop\mysql-python\MySQL-python-1.2.3\setup_windows.py", line 7, in get_config
    serverKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, options['registry_key'])
WindowsError: [Error 2] The system cannot find the file specified
 
I read the READ ME file
 
I do not understand it ...
 
I need some step by step on how to install this.
 
----------------------------------
 
What I am trying to do is create a window in which I input data which is stored and updated on MySQL.
MySQL is on a paid server (Yahoo).
 
any books or documentation or help would be greatly appreciated.
 
Victor
_______________________________________________
Tutor maillist  -  Tutor <at> python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Alan Gauld | 1 Feb 01:39 2011

Re: Need Help in installing MySQLdb-Python

"Victor Binns" <vic_prof <at> hotmail.com> wrote

> I have Python 2.6.3

Congratulatons SqlLite should already be installed as part
of the standard library.

Try:

>>> import sqlite3 as sql

> clicked on the file called setup.py

I usually run setup manually rarther than double click...

>     serverKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE,
> 
> options['registry_key'])
> WindowsError: [Error 2] The system cannot find the file specified
>
> I read the READ ME file
>
> I do not understand it ...

:-)

Try importing sqlite as above, you may find you don;t need to
install anything extra!

For a quick tutorial on using Sqlite from Python try the Databases
topic in my tutorioal (Version 2 only for now)

HTH,

--

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/

_______________________________________________
Tutor maillist  -  Tutor <at> python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Garry Willgoose | 1 Feb 03:38 2011
Picon
Picon

OS dependence of line separators

I have a code that needs to run on all platforms and generate text  
output files that can be read on other platforms. I'm a bit confused  
about how Python handles the age-old end of line character/s problem.  
I'm familiar with '\n' and '\r\n' dependence of Unix and Windows  
respectively. Also I'm familiar that the Python manual recommends that  
you use '\n' as the line terminator when writing a file for a  file  
that is to read on that same platform and not to use '\r\n' explicitly  
on Windows. Also os.linesep gives the line terminator for your current  
OS even thought the manual says not to use the value when writing  
files. So the question is what does python do on windows when writing  
a text file ... does it recognise that '\n' needs to be converted to  
'\r\n' and substitute it as its writing. Does this mean that if I have  
an option in my code that sets EOL to '\r\n' (I intend to ask the user  
what platform he's needs to generate the file for) when I need to  
write to a windows file that when on a UNIX machine '\r\n' will be  
output in the file but when I'm on a Windows machine '\r\r\n' will be  
output? If so then I need to find what os.linesep and check what its  
value is before I set what value I give to EOL.

Or is this the case where I need to set 'b' option when opening the  
new file ... which, ughh, requires me to explicitly convert all  
numbers to strings before I write them.

====================================================================
Prof Garry Willgoose,
email:  garry.willgoose <at> newcastle.edu.au; g.willgoose <at> telluricresearch.com
email-for-life: garry.willgoose <at> alum.mit.edu
personal webpage: www.telluricresearch.com/garry
====================================================================
"Do not go where the path may lead, go instead where there is no path  
and leave a trail"
                           Ralph Waldo Emerson
====================================================================

_______________________________________________
Tutor maillist  -  Tutor <at> python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Victor Binns | 1 Feb 06:38 2011
Picon

Need help on Setup.py

I have been trying to add some of the extras with python such as pywin32 and others.

when i click on setup.py it does not work.

I need help on the problem.

Victor
_______________________________________________
Tutor maillist  -  Tutor <at> python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Alan Gauld | 1 Feb 09:04 2011

Re: Need help on Setup.py


"Victor Binns" <vic_prof <at> hotmail.com> wrote
> I have been trying to add some of the extras with python
> such as pywin32 and others.
> when i click on setup.py it does not work. I need help on the 
> problem.

"It does not work" is pretty vague, can you give more specifics?
How are you running it? What error messages do you get?
What is the end state - is anything installed and if so where?

Also, is there a reason you are using setup.py for pywin32?
That is normally installed as a binary installer. See here:

http://sourceforge.net/projects/pywin32/files/pywin32/Build%20214/

There is an exe file for most Python versions...

Although I just noticed that a zip file including the source seems
to be the default option if you just hit the big geen button...

HTH,

--

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/

_______________________________________________
Tutor maillist  -  Tutor <at> python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Becky Mcquilling | 1 Feb 09:44 2011
Picon

Formatting a string

Quick question to the group to solve an immediate problem and then if anyone has a dead simple reference on formatting strings it would be greatly appreciated as I'm finding this to be pretty confusing.


Basically, I need to format a string as an example:

"He is {what}.format("{wild}")

I want to insert wild in place of what and output the resulting text WITH the curly braces.  This is not the actual code but is the idea of what I need to do.

Thanks all,

Becky

_______________________________________________
Tutor maillist  -  Tutor <at> python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Tommy Kaas | 1 Feb 09:54 2011
Picon

Re: Need Help in installing MySQLdb-Python

 

 

Fra: tutor-bounces+tommy.kaas=kaasogmulvad.dk <at> python.org [mailto:tutor-bounces+tommy.kaas=kaasogmulvad.dk <at> python.org] På vegne af Victor Binns
Sendt: 1. februar 2011 01:19
Til: Tutor python
Emne: [Tutor] Need Help in installing MySQLdb-Python

 

I have Python 2.6.3
 
I went to the following link http://pypi.python.org/pypi/
Found - file (MySQL-python 1.2.3)
 


 
I had similar problems last week. The windows installer file placed at this site helped. You just have to pick the right version.

http://www.lfd.uci.edu/~gohlke/pythonlibs/

 

Tommy

 

_______________________________________________
Tutor maillist  -  Tutor <at> python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Karim | 1 Feb 12:33 2011
Picon

Re: Formatting a string


Hello,

>>> "He is {what}".format(what="{wild}")
'He is {wild}'

Regards
Karim

On 02/01/2011 09:44 AM, Becky Mcquilling wrote:
Quick question to the group to solve an immediate problem and then if anyone has a dead simple reference on formatting strings it would be greatly appreciated as I'm finding this to be pretty confusing.

Basically, I need to format a string as an example:

"

I want to insert wild in place of what and output the resulting text WITH the curly braces.  This is not the actual code but is the idea of what I need to do.

Thanks all,

Becky

_______________________________________________ Tutor maillist - Tutor <at> python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

_______________________________________________
Tutor maillist  -  Tutor <at> python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
col speed | 1 Feb 13:29 2011
Picon

Re: decimal module and precision

You can always change the precision in decimal. Just an idea....

On 31 January 2011 22:23, Richard D. Moores <rdmoores <at> gmail.com> wrote:

Which is accurate to only 16 digits; my Windows Vista calculator gives
2.9231329473018093516404474158812 for 23.45**.34

And using mpmath with Python 2.6 does exactly as poorly:
>>> from mpmath import mp, mpf
>>> mp.dps=32;mp.pretty=True
>>> mpf(23.45)**mpf(.34)
2.9231329473018095467750783681372

So it seems I shouldn't use d(), or my revised d(), or mpmath for
maximum precision, which seems to be at least 32 when using the
decimal module the standard way.

> It would probably be a good idea, if the Python compiler would issue a warning
> when it encounters a `float` constant with excessive precision.

Well, it sure would have helped me!

Thanks, Eike.

Dick
_______________________________________________
Tutor maillist  -  Tutor <at> python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor



--


_______________________________________________
Tutor maillist  -  Tutor <at> python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
col speed | 1 Feb 13:35 2011
Picon

Re: Formatting a string

You're missing a "." that if your computer is the same as mine, looks like something left behind by a mosquito

On 1 February 2011 18:33, Karim <karim.liateni <at> free.fr> wrote:

Hello,

>>> "He is {what}".format(what="{wild}")
'He is {wild}'

Regards
Karim


On 02/01/2011 09:44 AM, Becky Mcquilling wrote:
Quick question to the group to solve an immediate problem and then if anyone has a dead simple reference on formatting strings it would be greatly appreciated as I'm finding this to be pretty confusing.

Basically, I need to format a string as an example:

"

I want to insert wild in place of what and output the resulting text WITH the curly braces.  This is not the actual code but is the idea of what I need to do.

Thanks all,

Becky

_______________________________________________ Tutor maillist - Tutor <at> python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor


_______________________________________________
Tutor maillist  -  Tutor <at> python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor




--


_______________________________________________
Tutor maillist  -  Tutor <at> python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Gmane