Python and a Database

For the discussion of Perl, Python, Ruby, and PHP and other interpreted languages.

Python and a Database

Post by edkelly255 on Mon Feb 21, 2011 9:53 pm
([msg=54023]see Python and a Database[/msg])

Phantom wolf requested more information about my problem. First i would like to thank you for even replying and to answer your first question (What kind of database is it) I was thinking of using Microsoft Access, because it is easy to use, or a SQL database, because I have seen on the net that python can talk to that one really good but i have yet to learn SQl and I have not found a understandable tutorial for that aspect of my problem.

As to your second question (What do I do when I look up the tariff manually). I am going to tell you step by step just like my pseudo:
get price from amazon($50 + shipping and handling)
open big blue folder
search through a lot of pages for the type of item(tariff heading) being ordered (e.g: electronic/computer etc)
look at percentage to be applied (5%)
apply percentage(0.05 * 50 = $2.50 + 50 = $52.50)
*just so you know the numbers are made up ;)*


After all that is done when the item arrives my father has to fill out a 'waste of time' form, sometimes i do it. The form asks for a description of the item, how much units, who is the customs broker, the supplier, and the owner. I plan to have the program put that information into a form template, I have not researched this part as yet but if i get stuck I will be back

Thanks,

edkelly255
edkelly255
New User
New User
 
Posts: 4
Joined: Mon Feb 21, 2011 11:03 am
Blog: View Blog (0)


Re: Python and a Database

Post by Phantom Wolf on Mon Feb 21, 2011 10:10 pm
([msg=54025]see Re: Python and a Database[/msg])

First off, Goatboy told you not to make a new thread. *Sigh* oh well . . .

I don't know anything about Microsoft Access, or Python support for it. I do know that Python doesn't nativity support communications with a SQL server, but there are plenty of third-party libraries for that (if you decided to use PyQt, you can use it for SQL as well), it does support SQLite, though, which is pretty much the same as regular SQL, except there is no server, all the data is stored in a local file. So, instead of connecting to a server, you open a file

Is this "big blue folder" a folder on your computer?
"Well it isn't my fault. I shouldn't have been allowed to do something to crash it." "No, you shouldn't have been allowed to buy a computer in the first place"
Phantom Wolf
Poster
Poster
 
Posts: 271
Joined: Wed Mar 03, 2010 8:45 pm
Blog: View Blog (0)


Re: Python and a Database

Post by edkelly255 on Mon Feb 21, 2011 10:47 pm
([msg=54027]see Re: Python and a Database[/msg])

oh boy...he's gonna hate me.
Nope the 'big blue folder' is not on my computer it literally is a big blue folder lol.
Q:
If i go with the third party libraries, installing them to python would just be putting their files into the python folder?

The reason i ask is because I did see something like that in my research and tried it but i was lost when it came to installing the libraries. PyQt4 looks good, I am reading the introduction on that site u directed me to.

thanks alot,
edkelly255

p.s: Goatboy am terribly sorry
edkelly255
New User
New User
 
Posts: 4
Joined: Mon Feb 21, 2011 11:03 am
Blog: View Blog (0)


Re: Python and a Database

Post by Phantom Wolf on Mon Feb 21, 2011 11:07 pm
([msg=54030]see Re: Python and a Database[/msg])

Most third-party Python libraries have some sort of installer you run that takes care of everything for you, sometimes it's an executable file, sometimes it's a python script.

So, you want to make your own database of percentages? If that's the case, then I would recommend SQLite. There's some good reading in the official Python documentation on it, SQL tutorials are all over the Internet, Google.
"Well it isn't my fault. I shouldn't have been allowed to do something to crash it." "No, you shouldn't have been allowed to buy a computer in the first place"
Phantom Wolf
Poster
Poster
 
Posts: 271
Joined: Wed Mar 03, 2010 8:45 pm
Blog: View Blog (0)


Re: Python and a Database

Post by Defience on Tue Feb 22, 2011 11:29 am
([msg=54057]see Re: Python and a Database[/msg])

I wrote a report writing system in Python for my work and it uses MySQL. For Python, just get the MySQLdb module.
User avatar
Defience
Addict
Addict
 
Posts: 1277
Joined: Thu Jun 12, 2008 3:16 pm
Blog: View Blog (0)


Re: Python and a Database

Post by kujinR on Thu Feb 24, 2011 4:16 am
([msg=54180]see Re: Python and a Database[/msg])

I don't know Python so this may be a stupid question. But, why not just use a comma separated file or XML? Wouldn't that be easier than having to install 3rd party libraries?
"Better to keep your mouth shut and be thought a fool than to open it and remove all doubt."
"red = changed"
User avatar
kujinR
Poster
Poster
 
Posts: 270
Joined: Thu Jul 29, 2010 4:39 am
Blog: View Blog (0)


Re: Python and a Database

Post by Phantom Wolf on Thu Feb 24, 2011 6:00 am
([msg=54182]see Re: Python and a Database[/msg])

kujinR wrote:I don't know Python so this may be a stupid question. But, why not just use a comma separated file or XML? Wouldn't that be easier than having to install 3rd party libraries?


SQLite doesn't require third-part libraries. But, an XML file(s) wouldn't be a bad idea either
Phantom Wolf
Poster
Poster
 
Posts: 271
Joined: Wed Mar 03, 2010 8:45 pm
Blog: View Blog (0)



Return to Interpreted Languages

Who is online

Users browsing this forum: No registered users and 0 guests