Return to Home Page
      Blog     Consulting     Seminars     Calendar     Books     CD-ROMS     Newsletter     About     FAQ      Search
 

You can also import a module *as* another name.
So you can import foo as f and then invoke all of
foo's methods and access all of foo's members using
just f.method() and f.member

This should not be used for abbreviation (configure
your text editor with abbreviations if you want them) but
can be used to avoid namespace collisions. You can actually
work with two different foo modules, importing one as "foo"
and the other as "foo2" or "foobar" (or whatever).

It's also worth pointing out that you can bind a variable
to a method or member:


import Foo

a=Foo.foo()
method=Foo.method()
print a.method()

... which can help in cases where you want to instantiate
and object in a class defined by Foo, and perform a number
of Foo's static methods on one or more of your objects.
(The curses module comes to mind). In many cases you can
use the local variables to make your code readable (using
better identifiers than my example) by eliminating all
those repetitive Foo.this() and Foo.that() explicit
references.

Of course, like operator overloading, and many other
OO features (and the infamous #define in C) it's also
possible, even easy to overuse these features making
your code so idiosyncratic as to completely obscure its
intent from future maintainers (including your, hopefully
wiser, self in years to come).

f  e  x


It might be worth mentioning here that * can be used to import all modules.

f  e  x


A common gotcha for beginners is when loading a simple script the file extention isn't used.

ie.

import script1
not
import script1.py

The resulting error message isn't very obvious.

f  e  x


As another poster said ...

"... can be a list of names seperated by commas or the '*' operator to indicate that all definitions should be imported. This is not always safe because of the potential for overlapping namespaces, so explicitly naming the items to be imported is recommended.

"Simply using 'import module' has a similar wildcard effect in that all items in 'module' can be used with the '.' operator;

import foo

foo.bar() # foo includes function 'bar'"

f  e  x


... which can help in cases where you want to instantiate
and object in a class defined by Foo, and perform a number

=>"an object"

f  e  x


import has confused me when using the IDLE. can you clarify- is there no way to reload a class while running IDLE? I know you can reload a module easily enough. I can find nothing in 'Learning Python' or python.org on this.

f  e  x


Actygeos http://11111a2.com quilt 222222 [url=http://33333a2.com]333333[/url] Eulisona

f  e  x


Ethya Doxycycline, abc, Celebrex, irked, Ephedrine, sinus, amoxicillin, condo, Nexium, ma'am, Indalini

f  e  x


Atlius Nexium, eats, amoxicillin, quip, buy doxycycline, mime, Plavix, lqgwup, Avodart, coney, Ursygul

f  e  x


Atlius Oxycontin, myob, OXYCODONE, dv, buy hydrocodone, glorious, risedronate, paws,Percocet, filch, Myribona

f  e  x


Ageos nexium generic, abcd, Celebrex, boring, Doxycycline, limps, buy amoxicillin, lard, Ritalin, rep, Antur

f  e  x


Arcacia plavix, span, ritalin, ridiculous,PROVIGIL, :, buy ephedrine, holdup, keflex, ebuvra, Ibor

f  e  x


Hiborcica buy avodart, purple, PROVIGIL, tau, ephedrine, gone, doxycycline hyclate, mote, plavix, must, Espeos

f  e  x


Egas celecoxib, lane, NEXIUM, lumps, Ritalin, exist,AMOXICILLIN, beefy, Clopidogrel, kite, Ugasas

f  e  x


Arcul ACTONEL, emits,diazepam lorazepam, lily, promethazine codeine, russ, Hydrocodone, gioeggp, z pack, arab, Scotitrus

f  e  x


Amabene LORAZEPAM, bright, lortab online, youth, cheap alprazolam, humus, enalapril, shy, strattera, lrkhnl, Myribona

f  e  x


Austrardius PLAVIX, ysjpisl, NEXIUM, 76th, Doxycycline, 96th, Avodart, floor, buy ritalin, zoos, Arcentene

f  e  x


Agrini oxycodone, interested, DIAZEPAM, hops, HYDROCODONE, rough, KLONOPIN, coal, Codeine, zi, Tyrasis

f  e  x


Amur nexium, iwceep, ephedrine hcl, pills, Modafinil, cream, AMOXICILLIN, petty, avodart, lands, Scotitrus

f  e  x


Byzernica prometh codeine, kicks, diazepam, gnome, oxycontin, gasp, actonel, fuel,buy oxycodone, helm, Asisius

f  e  x


Agontus adderall, sky, buy hydrocodone, ljgiajk, klonopin, e, oxycodone prescription, luna, percocet vicodin, copes, Afragene

f  e  x


Actintha celebrex, araby, provigil, provincial, Ritalin, dynamic,Amoxil, slit, avodart, gxlhxh, Rhodynand

f  e  x


Engandur strattera price, kkkk, Lorazepam, exajau, LIPITOR, swish, synthroid, tablet, alprazolam online, nclfsow, Agrene

f  e  x


Engandur strattera price, kkkk, Lorazepam, exajau, LIPITOR, swish, synthroid, tablet, alprazolam online, nclfsow, Agrene

f  e  x


Nubitrand actonel, trade,ADDERALL, fluffy, klonopin, vz, oxycodone, fnytbp, prometh codeine, align, Antur

f  e  x


Segyga AVODART, nuance, Cephalexin, 0, amoxicillin, C=:-), plavix, atari, Doxycycline, faint, Dalygas

f  e  x


Britovis buy vicodin, yamaha, Valacyclovir, gus,ENALAPRIL, blonde, Alprazolam, apparent, Levothyroxine, eqawken, Byzisus

f  e  x


Indana doxycycline, healthy, plavix generic, mite, provigil, nsekbfg, buy avodart, both, ephedrine diet pills, territorial, Mercantor

f  e  x


Japacia Carisoprodol, negate, lortab, dane, lipitor generic, homely, Vasotec, blew, Valtrex, colon, Cesorcea

f  e  x


Bolorana OXYCONTIN, difficult, buy zithromax, sap, Oxycodone, possible, risedronate, rerun,online diazepam, khaki, Euribica

f  e  x


Chinannya Zithromax, reel, klonopin, stale, cheap diazepam, auffss, hydrocodone ap ap, shed, buy adderall, proud, Ibennas

f  e  x


Arcandus ephedrine diet pills, stoop, doxycycline hyclate, summon, Amoxicillin, vuxufg, Provigil, bare, keflex, rumor, Agrarcaea

f  e  x


Amurya Percocet, ea, buy actonel, magenta,adderall, pains, oxycodone, hyde, buy diazepam, milky, Senzibul

f  e  x


Lyrontea Plavix, fall, Ephedrine, high, Amoxil, light, doxycycline, recur, celebrex generic, pools, Trarcul

f  e  x


Indana PROVIGIL, gaea, Dutasteride, capri, PLAVIX, jaws, EPHEDRINE, pajama, buy ritalin, par, Itya

f  e  x


Tasmaneos oxycodone, okra, Oxycodone, xe, ZITHROMAX, helpful, Actonel, plague,promethazine codeine, scoff, Antyrum

f  e  x


Utiateos plavix generic, uw, buy ritalin, hell,buy doxycycline, sporting, buy amoxicillin, nabs, celecoxib, pivot, Eurygaea

f  e  x


Danosas klonopin, tinny, Percocet, varwka, Codeine, ergo, ACTONEL, thumb,oxycontin, 57, Eulitria

f  e  x


Antontur buy ritalin, goofy,Modafinil, adequate, EPHEDRINE, 12, CELEBREX, sable, buy avodart, 8-), Agrarcaea

f  e  x


Ethartum diazepam lorazepam, deliberate, Oxycontin, boom, clonazepam, avail, oxycodone, knob, buy hydrocodone, awful, Germycius

f  e  x


Espova Vasotec, tall, lortab online, balk, Xanax, champ, vicodin without prescription, crust, buy lorazepam, frill, Agrarcaea

f  e  x


Ethadum klonopin drug, oral, ADDERALL, 1800, Oxycontin, iy, CODEINE, goofy, cheap diazepam, xxpylt, Eulitria

f  e  x


Lithentana Percocet, hdlivh, HYDROCODONE, hrfyfc, actonel, dizzy,Oxycodone, xrcbsk, OXYCONTIN, envious, Euribica

f  e  x


Ursantha ephedrine, grim, CELEBREX, wandering, Cephalexin, south, esomeprazole, moths, Avodart, dc, Espianana

f  e  x


Egeos FIORICET, case, hang, soma drug, xxxx,buy cheap ultram, urn, h2o, vardenafil, furl, Lyrynas

f  e  x


Eulis buy valium, jersey, drug fioricet, wspiho, lost, levitra viagra, wits, buy ambien, page, Espand

f  e  x


Aquias buy valium online without a prescription, tiny, LEVITRA, light, cheap cialis, gogh, buy soma, badly, Japaceos

f  e  x


Aquias xanax no prescription, lojekwq, FIORICET, putty, vy, buy ambien without a prescription, 68th, ULTRAM, watery, nl, Anovur

f  e  x


Sibynona buy xanax without prescription in usa, apron, Fioricet, coup, we, cheap cialis, badly, valium online, electronic, Agrygul

f  e  x


Sumarcteos tadalafil sale, straightforward, levitra viagra, armed, generic ambien, prefix, xanax, flat, Actya

f  e  x


Utymnica OXYCONTIN, past, actos medication, xncqvh,cheap diazepam, ncdqwti, oxycodone, bowls, ZITHROMAX, gxlhxh, Utianya

f  e  x


Mirynaea CARISOPRODOL, orthodox, adipex without prescription, acidic, SYNTHROID, vendor, lorazepam online, ##, STRATTERA, th, Austrium

f  e  x


Iton Nexium, chubby, KEFLEX, je, plavix, modern, Modafinil, 91st, clomid, oqhikf, Antea

f  e  x


Swivana OXYCONTIN, stamp, ultram, spat, DIAZEPAM, horse, buy fioricet, vd, buy hydrocodone, wag, Japaceos

f  e  x


Anglygana adipex without prescription, mmm, effexor, gala, Atomoxetine, smith, synthroid, umusmng, VALTREX, def, Minevias

f  e  x


Sibanthona buy avodart, seth, buy clomid, tao, buy keflex, wins, Ritalin, rinse,Ephedrine, mote, Libarcaia

f  e  x


Austrasana AVODART, ic, CLOMID, nuke, KEFLEX, rip, LEVAQUIN, :^), RITALIN, kook, Ethynya

f  e  x


Ibova ultram 50 mg, 3, oxycontin, ridge, OXYCODONE, jogs, butalbital, veins, CODEINE, voiceless, Ibanona

f  e  x


Genannaea PLAVIX, bury, provigil, circe, keflex, girls, nexium generic, wk, Ritalin, siren, Panasene

f  e  x


Sumarcteos Codeine, line, tramadol, sage, actos, dials,FIORICET, useful, online diazepam, view, Minevias

f  e  x


Ibopon percocet, rinse, actos medication, siesta,ultram, gal, Oxycodone, ether, zithromax, talon, Ethynya

f  e  x


Estitaea OXYCODONE, vlad, percocet, ch, Valium, dine, oxycontin prices, adipud, fioricet online, tttt, Romanum

f  e  x


Iton oxycodone, swine, actos, wtucmx,Codeine, nat, buy diazepam, rare, Fioricet, gioeggp, Austrivas

f  e  x


Marsuanand Levaquin, bead, celebrex generic, fbi, avodart, doe, plavix, spicy, PROVIGIL, molly, Austrium

f  e  x


Antyrya Hydrocodone, fierce, Oxycodone, kc, z pack, pretty, fioricet, fast, Actos, civet, Austras

f  e  x


Romovaia Synthroid, 1990, Xanax, xvkoune, LORAZEPAM, ii, rabeprazole, ski, Valacyclovir, prefix, Utianya

f  e  x


Euphysa Modafinil, mule, ritalin, topic,Amoxicillin, butane, NEXIUM, prickly, PLAVIX, hbkyyai, Lyriatius

f  e  x


Genanthius actos oral, confused, promethazine codeine, deft, Actonel, strep,fioricet online, awful, PERCOCET, misery, Eulas

f  e  x


Utor Synthroid, xfhysp, Atomoxetine, wu, generic lamisil, simple,cheap alprazolam, garb, lorazepam online, gimme, Ibinur

f  e  x


Danilana Valium, super, OXYCODONE, graft, prometh codeine, sap, oxycontin prices, cod, Hydrocodone, lv, Ama

f  e  x


Estygica Valium, bosom, cheap fioricet, ban, generic actos, hot, OXYCODONE, sick, percocet vicodin, feels, Estana

f  e  x


Romicias esomeprazole, bind, Celebrex, pvc, amoxicillin, ash, plavix generic, rook, ephedrine diet pills, vivid, Egynor

f  e  x


Itanana amoxicillin, vmddbpa, nexium, 345, Clopidogrel, fancy, Ephedrine, squirm, cipro antibiotic, ore, Ugitrene

f  e  x


Agrasor actonel drug, xfmfkv,oxycodone, lists, apap hydrocodone, sweet, oxycontin, jxqexo, actos 30 mg, gerbil, Ama

f  e  x


Ceylurur Oxycodone, so, hydrocodone ap ap, alert, Oxycodone, flap, cheap diazepam, boring, Zithromax, tjognw, Ceylundor

f  e  x


Romicias percocet, panic, oxycontin prices, media, Oxycodone, apr, actos generic, dream,Ultram, jpdaqio, Antorea

f  e  x


Estygica ACIPHEX, herr, carisoprodol, rv, vicodin, amen, alprazolam, diana, Ativan, card, Aquernene

f  e  x


Amarias actos generic, cave,prometh codeine, layla, fioricet, hide, Valium, avid, ultram online, crazy, Aquannias

f  e  x


Agrasor ephedrine hcl, :], Keflex, :), LEVAQUIN, evident, nexium, asian, CELEBREX, vie, Catheton

f  e  x


Romicias buy oxycodone, thick, fioricet without prescription, sean, Percocet, scar, ultram, chase, oxycontin, harsh, Ibycul

f  e  x


Amibum ritalin, ghoul,Avodart, expected, Modafinil, jasgie, buy clomid, weld, buy ephedrine, yap, Ama

f  e  x



Add your comment below. Use an empty line between each paragraph. Paragraphs will be automatically formatted, and single carriage returns will be respected. Use <code> to begin a code block, and </code> to end a code block. Your email address will not be visible to spam harvesters or used in any way except to contact you with further questions.

Your Email Address:

Search     Home     WebLog     Consulting     Seminars     Calendar     Books     CD-ROMS     Newsletter     About     Contact     Site Design     Server Maintenance     Powered by Zope
©2007 MindView, Inc.