using user input to find information in a Mysql database


hi,
I have recently started a project that will involve a user inputing a barcode manually into a python program. the python program will then take this barcode and look for it in a mysql database, if the barcode matches that of one in the database it will then display the product that corresponds to that barcode. for the moment the user will enter the barcode amnually, but in the future i will use a barcode scaner. the program will run on my laptop, but in the future the program will be used in a domestic appliance. can anyone give me some tips, because I am not really sure how to go about it.
Posted On: Tuesday 27th of November 2012 01:09:10 AM Total Views:  52
View Complete with Replies

RELATED TOPICS OF Python Programming PROGRAMMING LANGUAGE




Re: creating yaml without tags using pyyaml

Stephen Moore wrote: > I have come to the conclusion that this is the fault of the tags (for > example, !!python/tuple) as getting rid of them gets rid of the > errors. > > So I'm wondering if there ...
VIEWS ON THIS POST

150

Posted on:

Sunday 25th November 2012
View Replies!

How to parse xml with ISO-8859-1 encoding using ElementTree andSimpleXMLTreeBuilder?

Hi , I got trouble parsing xml returned by web service. XML data contains characters above 128, so ET.fromstring throws an error. Error is thrown from python's xmllib.py file, where it detects char above 128. I am replacing utf-8 encoding ...
VIEWS ON THIS POST

163

Posted on:

Sunday 25th November 2012
View Replies!

using PIL for good screenshots

I'm using PIL to enhance screenshots for print and online publication. I'm writing to see if someone else is doing similar work. The shots are dialogs, menus, etc. -- my workflow to create the print images: (1) writer takes ...
VIEWS ON THIS POST

194

Posted on:

Sunday 25th November 2012
View Replies!

Problem using copy.copy with my own class

(Pdb) myclass MyClass( 0, 0, 'A string', 123.45) (Pdb) copy.copy(myclass) *** TypeError: TypeError('__new__() takes at least 4 arguments (2 given)',) I see 4 arguments (actually, 5 because Python is passing cls invisibly to __new__). Does anyone have an idea what ...
VIEWS ON THIS POST

145

Posted on:

Sunday 25th November 2012
View Replies!

Delete rows using xlrd?

I want to delete some rows (by creating a loop may be) using xlrd. Is this possible, if not how do I do that with python Please help
VIEWS ON THIS POST

150

Posted on:

Sunday 25th November 2012
View Replies!

Excel Manipulation using Python

I was trying to delete rows in an existing .xls file using python. How do I do that I was using the following code, it seem to work if I type in python window, but if I save it in ...
VIEWS ON THIS POST

157

Posted on:

Sunday 25th November 2012
View Replies!

Re: Reading new mail from outlook using Python

Thanks... I could access the folders in outlook express using the COM interface. Now I am stuck with how to read to a file only new mails. Anyone knows how to achieve this Thanks SPJ --- On Tue, 3/25/08, Pete ..
VIEWS ON THIS POST

130

Posted on:

Sunday 25th November 2012
View Replies!

How to factor using Python?

How do I factor a number I mean how do I translate x! into proper Python code, so that it will always do the correct math
VIEWS ON THIS POST

135

Posted on:

Sunday 25th November 2012
View Replies!

OT: Ideas for a first course using Python

Sorry to butt in but I am shopping for some ideas. I am interested in putting together a programming course for non- programmers (outside the computer science domain) based on Pyhton. I envision the course similar to ones that used ...
VIEWS ON THIS POST

125

Posted on:

Sunday 25th November 2012
View Replies!

Error messages when using the Console Module

I am developing code using the effbot Console module, which gives control over the Windows terminal settings. My problem is that while this module redirects standard output to a new console window, it seems to redirect standard error messages to ...
VIEWS ON THIS POST

169

Posted on:

Sunday 25th November 2012
View Replies!

using scons as a library

I've been reading up on the SCons build tool. It's intended to work by the end-user calling 'scons' on a buildscript. However, I'd like to use it from my own python project as an imported module, and have my ...
VIEWS ON THIS POST

174

Posted on:

Sunday 25th November 2012
View Replies!

building psycopg2 on windows using mingw, "cannot find -lpq"

The compile works, BUT linking fails: 2.5\Release\psycopg\_psycopg.def -Lc:\python25\libs -Lc: \python25\PCBuild -Lc:/p ostgres/83RC2/lib -lpython25 -lpq -lws2_32 -ladvapi32 -o build \lib.win32-2.5\psy copg2\_psycopg.pyd c:\mingw\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe: cannot find -lpq collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 if I ...
VIEWS ON THIS POST

272

Posted on:

Sunday 25th November 2012
View Replies!

Why my program (using pexpect to switch user) doesn't work well?

I'm new to python I want to write a simple script to switch user,for example,from user_A to user_B. This my codes: #!/usr/bin/python import pexpect import os passwd="user_B" child = pexpect.spawn('su user_B') child.expect('Password:') child.sendline(passwd) child.expect('$') child.close() Maybe it's the easiest pexpect ...
VIEWS ON THIS POST

124

Posted on:

Sunday 25th November 2012
View Replies!

Re: Redirecting STDOUT using C calls.

Christian Heimes wrote: > Tom Gaudasinski wrote: > >> Greetings, >> I'm trying to redirect python's stdout to another location. The >> reason for this is that I'm embedding python in an application. Now, >> originally my code was developed ...
VIEWS ON THIS POST

72

Posted on:

Monday 26th November 2012
View Replies!

CPython and a C extension using Boehm GC

Hi , Is it possible to write a Python extension that uses the Boehm garbage collector I have a C library written that makes use of boehm-gc for memory management. To use that, I have to call GC_INIT() at the ...
VIEWS ON THIS POST

22

Posted on:

Monday 26th November 2012
View Replies!

Releasing malloc'd memory using ctypes?

I am starting to experiment with ctypes. I have a function which returns a pointer to a struct allocated in heap memory. There is a corresponding free function for that sort of struct, e.g.: from ctypes import * cdll.LoadLibrary("libthing.so") c_thing ...
VIEWS ON THIS POST

43

Posted on:

Monday 26th November 2012
View Replies!

Multiple Windows in Pygame, using true concurrency in python via Kamaelia

Just thought some people may be interested to hear that I've recently been looking at adding true concurrency into Kamaelia, by using Paul Boddie's pprocess as the core mechanism to allow us to run multiple Kamaelia systems in the ...
VIEWS ON THIS POST

67

Posted on:

Monday 26th November 2012
View Replies!

Create thumbnail image (jpg/png) of PDF file using Python

Is there any way to do this directly within python If not is there any other good way to achieve it
VIEWS ON THIS POST

59

Posted on:

Monday 26th November 2012
View Replies!

Anyone had success using NetUseAdd() on shares accessed through aWindows 2003 DFS root?

Has anyone had success using NetUseAdd() on shares that were replica links on a Windows 2003 DFS root In my code, I'm getting error: pywintypes.error: (67, 'NetUseAdd', 'The network name cannot be found.') This is my scenario: Win2003 Server hosting ...
VIEWS ON THIS POST

90

Posted on:

Monday 26th November 2012
View Replies!

HELP me with using the Nested For LOOP to generate a combination sequence

Just a brief description of my question The exercise is to define and test a program, full-names that will help parents avoid such unintended clashes by listing, in full, every possible first-name/surname and first-name/middle-name/surname combination that can be formed from the names that the parents are actively considering. For instance, let's suppose that the Doyles' list of possible first names included Emily, Lindsey, Carrie, and Sarah, and the possible middle names are Anne, Lynn, and Lucy. Your program should read from the user: 1 surname, 3 middle names and 4 first names. It should then print the combination of names as follows: "Emily Doyle" "Lindsey Doyle" "Carrie Doyle" "Sarah Doyle" "Emily Anne Doyle" "Emily Lynn Doyle" "Emily Lucy Doyle" So far, I have written the code but everytime i try to run my code, I have an Error. Please what am I doing wrong. I have attached a copy of my code below. I also included comments Python Syntax (Toggle Plain Text) mid = {}last = {}first = {}def main():# I created a string arraysfor i in range(3): first[1]=raw_input("Please Type the next First name:")for i in range(4): mid[i]=raw_input("Please Type the next middle name:")for i in range(1): last[i]=raw_input("Please Type the next last name:")# I am trying to use nested loops to generate the combination sequence. This is were I have the major pronblemfor i in first[1] :for i in mid[1] :for i in last[1] :main() mid = {} last = {} first = {} def main(): # I created a string arrays for i in range(3): first[1]=raw_input("Please Type the next First name:") for i in range(4): mid[i]=raw_input("Please Type the next middle name:") for i in range(1): last[i]=raw_input("Please Type the next last name:") # I am trying to use nested loops to generate the combination sequence. This is were I have the major pronblem for i in first[1] : for i in mid[1] : for i in last[1] : main()
VIEWS ON THIS POST

89

Posted on:

Tuesday 27th November 2012
View Replies!