SQLite3 and lastrowid

2010-11-16 Thread fuglyducky
I am fairly new to Python (no development experience) and brand new to using sqlite through Python. With that said, I created a database with two tables. The first has about 30,000 rows of static data. The second has 9 rows of static data. Before I added the second table I could simply run 'print(

Re: SQLite3 and lastrowid

2010-11-16 Thread fuglyducky
On Nov 16, 12:54 pm, Ian wrote: > On Nov 16, 1:00 pm, fuglyducky wrote: > > > Before I added the second table I could simply run > > 'print(cursor.lastrowid)' and it would give me the id number. However, > > with two tables I am unable to do this. > >

Re: SQLite3 and lastrowid

2010-11-16 Thread fuglyducky
On Nov 16, 1:52 pm, Ian wrote: > On Nov 16, 2:08 pm, fuglyducky wrote: > > > db_connect = sqlite3.connect('test.db') > > cursor = db_connect.cursor() > > > print(cursor.lastrowid) > > At this point you haven't executed a query yet, so there is no &

Newbie: Python 3 and MySQL???

2010-07-15 Thread fuglyducky
I am brand new Python and need to connect to a MySQL DB. The books I have been using are all Python 3 so I'd like to stick with what I know. Does anyone know if there is a library out there for connecting to MySQL with Python 3? If not, does anyone have any info on when MySQLdb may be ported? Than

Python 3 and setuptools

2010-07-16 Thread fuglyducky
I am trying to install a library that requires setuptools. Unfortunately, setuptools isn't available for Python 3 yet. Is this correct? Any idea when it may be available OR if there is a different tool/method of getting setuptools installed for Python 3? Thanks!!! -- http://mail.python.org/mailma

Confused: Newbie Function Calls

2010-08-11 Thread fuglyducky
I am a complete newbie to Python (and programming in general) and I have no idea what I'm missing. Below is a script that I am trying to work with and I cannot get it to work. When I call the final print function, nothing prints. However, if I print within the individual functions, I get the approp

Re: Confused: Newbie Function Calls

2010-08-11 Thread fuglyducky
On Aug 11, 9:31 am, Pinku Surana wrote: > On Aug 11, 12:07 pm, fuglyducky wrote: > > > > > I am a complete newbie to Python (and programming in general) and I > > have no idea what I'm missing. Below is a script that I am trying to > > work with and I cannot ge

re.sub and variables

2010-08-12 Thread fuglyducky
I have a function that I am attempting to call from another file. I am attempting to replace a string using re.sub with another string. The problem is that the second string is a variable. When I get the output, it shows the variable name rather than the value. Is there any way to pass a variable i

Re: re.sub and variables

2010-08-12 Thread fuglyducky
On Aug 12, 2:06 pm, fuglyducky wrote: > I have a function that I am attempting to call from another file. I am > attempting to replace a string using re.sub with another string. The > problem is that the second string is a variable. When I get the > output, it shows the variable name

Newbie: strftime object error message

2010-08-16 Thread fuglyducky
I am trying to call a function with a couple additional parameters. Unfortunately, for whatever reason I am unable to get this to work. I am assuming that line is not passing correctly but I don't understand why??? I can't share all of the code because it has IP in it but below are the pertinent s

Re: Newbie: strftime object error message

2010-08-16 Thread fuglyducky
On Aug 16, 10:27 am, Mark Lawrence wrote: > On 16/08/2010 17:47, fuglyducky wrote: > > > > > I am trying to call a function with a couple additional parameters. > > Unfortunately, for whatever reason I am unable to get this to work. I > > am assuming that line is not

Ugh! Python 3.1.x and MySQL

2010-09-10 Thread fuglyducky
Most of the python books coming out now are Py3K. I just started programming and have a need to access a MySQL database. I would like to use Python to do this. Unfortunately, I cannot find anyone that has created anything that allows my to do this. I've tried installing an ODBC driver and using sq

Re: Looping through files in a directory

2010-11-11 Thread fuglyducky
On Nov 10, 4:14 pm, James Mills wrote: > On Thu, Nov 11, 2010 at 8:46 AM, Matty Sarro wrote: > > Short story - I have a few thousand files in a directory I need to parse > > through. Is there a simple way to loop through files? I'd like to avoid > > writing a python script that can parse 1 file,