python - Class nested in for loop -


i have loop, inside loop class. don't think that's how supposed laid out. i'm unsure terms search solve problem.

for x,y in something:     stuff:      class someclass:       def__init__(self):       stuff 

the full code can seen http://pastebin.com/g7fyeqwa

i have tried importing both modules each other didn't work ended circular dependency

moving of non class code file , importing 1 module ran db inserts on last team scraped( understand why)

this first attempt @ oop in language advice on front appreciated well. program not oop begin why class inside loop begin with. of aspects oop added after initial program( work) written.

from can tell need able call kind of scrape function teamscraper, , put in loop, im not sure how go it

don't that.

a class, in object oriented language class of objects. objects have attributes , methods. class defines how create new object of particular type. main ideas of oo encapsulation, inheritance , polymorphism.

putting definition of class loop asking compiler create definition on , on , serves absolutely no purpose whatsoever. class, itself, tell program how create objects of particular type -- if not creating , using objects, have no use class definition.

have @ this tutorial sense of how python implements oo , this understand why oo used in many modern, multi-paradigm languages.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -