a class containg a set of data members

Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Oct 2007
Posts: 30
Reputation: jliu66 is an unknown quantity at this point 
Solved Threads: 0
jliu66 jliu66 is offline Offline
Light Poster

a class containg a set of data members

 
0
  #1
Oct 20th, 2007
Hi, my friends,

I am new to python. I have a question to ask you a empty class with a set of data memebers. The data members could be array. what is wrong with the following code?
Thanks in avvance.

# define an empty calss
class temp:
pass

# copy1 is a copy of class with only data members (could be 1-dimension array
copy1 = temp
tem2 = ones(100)
copy1.x( = tem2(

when I run this code to debug, it says invalid syntax in the last line of code. I could not figure out why. Help please. Is there any place to find good source about CLASS usage in python.

John
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 311
Reputation: BearofNH is on a distinguished road 
Solved Threads: 40
BearofNH's Avatar
BearofNH BearofNH is offline Offline
Posting Whiz

Re: a class containg a set of data members

 
0
  #2
Oct 23rd, 2007
You probably needed to say copy1 = temp(), otherwise copy1 is a copy of the class temp instead of an instance of the class temp.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 1157 | Replies: 1
Thread Tools Search this Thread



Tag cloud for Python
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC