[help+]Does Construct access SQL Databases?

For questions about using Classic.

Post » Thu May 12, 2011 11:34 am

Yes, I looked through the example the module real quick and I don't see why it shouldn't work. The module supports Python 2.6 so that is good.
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Fri May 13, 2011 2:19 am

[quote="scidave":190k6j86]Yes, I looked through the example the module real quick and I don't see why it shouldn't work. The module supports Python 2.6 so that is good.[/quote:190k6j86]
can u help me use it in construct?
I'm trying to follow your tutorial but i got some questions..
do i need to first install the module then use py2exe and then add the libraries into the construct folder?
if so, how do i install the module? tryed but can't..
B
30
S
6
G
5
Posts: 433
Reputation: 6,061

Post » Fri May 13, 2011 11:43 pm

How do I install this module plz some1 help me..
http://sourceforge.net/projects/mysql-python

I downloaded already and i think i need to run this setup.py but i can't.. i extracted the folder mysql-python-1.2.3 into c:\python26\ ..this is what i tryed:
1-open cmd
2-cd MySQL-python-1.2.3
3-python setup.py build

but i get an error..''python is not recognized a command...etc"
and if i just type setup.py build
i get:
importerror: no module named setuptools

can any1 help plz?
B
30
S
6
G
5
Posts: 433
Reputation: 6,061

Post » Sat May 14, 2011 12:10 am

Normally you can just do a "python setup.py install".


If you type python at the command line and it is not recognized then you don't have Python installed correctly. Install this version of Python:
http://www.python.org/download/releases/2.6.6/


After you install Python and test with a "python" at the command line then try the "python setup.py install"

If that doesn't work you could try setuptools:
http://pypi.python.org/pypi/setuptools

Let me know how it goes.
p.s. Even if we get a networking plugin, it wont interface with SQL databases; so you would still need a Python solution for this or somebody would have to write an SQL access plugin.

Edit... also try "setup.py install". ... you might not need the python in front...but you do need Python installed.

Edit2: You may also want to try an executable build.
http://www.codegood.com/archives/4
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Sat May 14, 2011 4:52 am

[quote="scidave":24o32ob8]Normally you can just do a "python setup.py install".


If you type python at the command line and it is not recognized then you don't have Python installed correctly. Install this version of Python:
http://www.python.org/download/releases/2.6.6/


After you install Python and test with a "python" at the command line then try the "python setup.py install"

If that doesn't work you could try setuptools:
http://pypi.python.org/pypi/setuptools

Let me know how it goes.
p.s. Even if we get a networking plugin, it wont interface with SQL databases; so you would still need a Python solution for this or somebody would have to write an SQL access plugin.

Edit... also try "setup.py install". ... you might not need the python in front...but you do need Python installed.

Edit2: You may also want to try an executable build.
http://www.codegood.com/archives/4[/quote:24o32ob8]
but as I said i tryed to just 'setup.py build' and 'setup.py install' but none worked too..
the command python to work, do I need to be in the in the python directory or the command works at any folder in CMD?
like i'm im C:\Program Files\ and type python, it should recognize the command?

edit: Downloaded setuptools and tryed to build and install, now i'm getting a different problem, something about my windows registration key
B
30
S
6
G
5
Posts: 433
Reputation: 6,061

Post » Sat May 14, 2011 5:19 am

Even if python is installed...by default it wont necessarily recognized "python" on command line.
The fact that you got an error saying "setuptools not found" suggests you should install setup tools.

If you don't want to try that you're best bet is an executable build (pick the 2.6 build for 32-bit):
http://www.codegood.com/archives/4
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Sat May 14, 2011 5:43 am

I downloaded the executable build and already installed, now im trying to follow your tutorial
python_library_quickguide.pdf but can't get to work.. i made the script to import mysqldb and saved it, made then a setup p2exe script:

[code:3th9b3gq]from distutils.core import setup
from pyexpat import *
import py2exe

setup( console=["mysqldb.py"])[/code:3th9b3gq]

but i got some errors.. if it's possible can u send me the library already done to put at construct or at last help me get this to work? i really apreciate.. thanks


edit: I was running from the pythonw.exe so now i used cmd and i think it worked... made 2 folders...build and dist, at dist have library and dll.. i can now just make a folder named 'mysqldb' unzip them at python folder in construct?
B
30
S
6
G
5
Posts: 433
Reputation: 6,061

Post » Sat May 14, 2011 12:53 pm

[quote="Guif0DA":2744avy6]build and dist, at dist have library and dll.. i can now just make a folder named 'mysqldb' unzip them at python folder in construct?[/quote:2744avy6]

Yes, that sounds about right...you could just unzip all of the .pyc files in the dist directory in your Python folder. If you follow the quickguide step for that everything should work.

You could also put them all in a separate directory like you mentioned.
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Sat May 14, 2011 6:57 pm

[quote="scidave":339hmj4c][quote="Guif0DA":339hmj4c]build and dist, at dist have library and dll.. i can now just make a folder named 'mysqldb' unzip them at python folder in construct?[/quote:339hmj4c]

Yes, that sounds about right...you could just unzip all of the .pyc files in the dist directory in your Python folder. If you follow the quickguide step for that everything should work.

You could also put them all in a separate directory like you mentioned.[/quote:339hmj4c]

but do i need to substitute the filesi n the python directory in construct or i can just make a new folder and add all of em?
cause i want to use podsixnet too but i don't know if by substituing the existing files ill cause any problem to other modules..
B
30
S
6
G
5
Posts: 433
Reputation: 6,061

Post » Sat May 14, 2011 10:42 pm

Either way works fine...I've done both. As long as your version of Python is 2.6..it isn't a problem to replace the current files with the ones you copy (but it is not necessary..just select "no" to overwriting existing files.
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

PreviousNext

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests