SunQuest
           Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
  #1  
Old November 22nd, 2003, 12:23 PM
telex4's Avatar
telex4 telex4 is offline
Wacky hack
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2001
Location: London, England
Posts: 512 telex4 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 25 m 29 sec
Reputation Power: 8
Class not loading properly in CGI

Hullo,

I've got a very, very odd problem here which I can't seem to solve. I'm creating a class instance in a CGI script, but that instance isn't inheriting all of the methods associated with that file. Confused? Here's what I mean:

the commands to check:
import db
mydb = db.mySQL()
str(dir(mydb))

done in a python shell on my machine:
"['__doc__', '__init__', '__module__', 'connectTime', 'cursor', 'delete', 'fetchRow', 'fetchRows', 'info', 'insert', 'mysql', 'update']"

in the cgi script online:
['connectTime', 'cursor', 'mysql']

What on earth is going on?

Reply With Quote
  #2  
Old November 22nd, 2003, 04:30 PM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,529 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 17 h 19 m 5 sec
Reputation Power: 63
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
Hey telex, its a nice idea thats for sure! I gave it a try earlier but i couldnt get it to connect?

Anyway this is pretty wierd.. i guess.. are both your computer and the server running the same version of Python on the same OS etc? Oh, is it just this class of does this happen with classes from other modules?

Mark.
__________________
programming language development: www.netytan.com Hula


Reply With Quote
  #3  
Old November 22nd, 2003, 05:08 PM
telex4's Avatar
telex4 telex4 is offline
Wacky hack
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2001
Location: London, England
Posts: 512 telex4 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 25 m 29 sec
Reputation Power: 8
Ah, well the Python installation on the web server is 1.5.2, whilst I'm using 2.2.3... could this be it? Is there anything that the 2.x series changed in this regard?

http://www.newtolinux.org.uk/techne/install.py

That page shows useful info relating to this problem.

Reply With Quote
  #4  
Old November 22nd, 2003, 05:27 PM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,529 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 17 h 19 m 5 sec
Reputation Power: 63
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
Could well be , an increadable amount has changed since Python 1.5 although i wasn't Pythoning bach then . I first came across Python a month of two before Python 2 was released..

So obviously my best sugestion would be UPDATE YOUR PYTHON VERSION - i'd give you a long list of reasons to do this but i'm sure you already have plenty of reasons - and see if that fixes the bug.

Mark.

Reply With Quote
  #5  
Old November 22nd, 2003, 06:29 PM
telex4's Avatar
telex4 telex4 is offline
Wacky hack
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2001
Location: London, England
Posts: 512 telex4 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 25 m 29 sec
Reputation Power: 8
Yers, well I can bug my web host to do it, but it'd be good to isolate the problem anyway, in case they don't and so the code is backwards compatable. If anyone knows what they might have done to the class system to cause this problem, I'd appreciate help!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > Class not loading properly in CGI


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway