Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #103877
| X-Received | by 10.182.87.2 with SMTP id t2mr21962797obz.20.1456932133010; Wed, 02 Mar 2016 07:22:13 -0800 (PST) |
|---|---|
| X-Received | by 10.50.111.100 with SMTP id ih4mr20712igb.3.1456932132990; Wed, 02 Mar 2016 07:22:12 -0800 (PST) |
| Path | csiph.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!news.glorb.com!hb3no10718799igb.0!news-out.google.com!k1ni6547igd.0!nntp.google.com!hb3no10718790igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail |
| Newsgroups | comp.lang.python |
| Date | Wed, 2 Mar 2016 07:22:12 -0800 (PST) |
| In-Reply-To | <mailman.55.1456815164.20602.python-list@python.org> |
| Complaints-To | groups-abuse@google.com |
| Injection-Info | glegroupsg2000goo.googlegroups.com; posting-host=117.215.22.187; posting-account=mBpa7woAAAAGLEWUUKpmbxm-Quu5D8ui |
| NNTP-Posting-Host | 117.215.22.187 |
| References | <645cdd46-d4a4-49b3-a0d8-848608d70d73@googlegroups.com> <075122af-1a9c-44b6-97bb-521ebcb3e4ae@googlegroups.com> <mailman.55.1456815164.20602.python-list@python.org> |
| User-Agent | G2/1.0 |
| MIME-Version | 1.0 |
| Message-ID | <0815b19e-ded3-4dc2-8d83-54bc6ed2f42d@googlegroups.com> (permalink) |
| Subject | Re: Correct IDLE usage (was Reason for not allowing import twice but allowing reload()) |
| From | Rustom Mody <rustompmody@gmail.com> |
| Injection-Date | Wed, 02 Mar 2016 15:22:12 +0000 |
| Content-Type | text/plain; charset=ISO-8859-1 |
| Xref | csiph.com comp.lang.python:103877 |
Show key headers only | View raw
On Tuesday, March 1, 2016 at 12:23:02 PM UTC+5:30, Terry Reedy wrote: > On 2/29/2016 7:42 AM, Rustom Mody wrote: > > > Is import needed at all when trying out in Idle? > ... > > So it does appear that > > 1. import not necessary with(in) idle > > 2. However import and f5 (ie is run as main) are different > > > > May some idle experts elaborate on this? Whats the idle idiom of import-ing? > > Rustom, since I know that you are not a rank beginner, I have trouble > understanding what you are asking. Heh! I know some things; dont know many things > F5 when editing foo.py is equivalent > to running "python -i foo.py" on a command line while 'in' the directory > containing foo.py. In both cases, foo.py is run as a main module, with > __name__ == '__main__'. The difference is that F5 runs foo.py under > IDLE supervision, with results going into and interactive inputs coming > from IDLE shell instead of the console interpreter. > > Imports are used in a module to access objects within the imported module. Let me try to explain again There is import and import. There is the formal meaning of the import keyword in python -- call it import-f There is the informal expectation and need of programmers to 'pull something into python' -- call it import-i That there is some cognitive dissonance between import-f and import-i is seen in the OP's question itself; also Chris' "I dont believe the language should be changed" So the question is around: What is the best practice for doing import-i in python? As the OP finds import-f works once and fails thereafter In idle one can get the desired result of import-i with F5 Is that right? Also in general is there good usecases for import-f at that interpreter prompt in idle? I think not but not sure of it
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Reason for not allowing import twice but allowing reload() alien2utoo@gmail.com - 2016-02-28 22:40 -0800
Re: Reason for not allowing import twice but allowing reload() Chris Angelico <rosuav@gmail.com> - 2016-02-29 18:01 +1100
Re: Reason for not allowing import twice but allowing reload() Steven D'Aprano <steve@pearwood.info> - 2016-03-01 22:18 +1100
Re: Reason for not allowing import twice but allowing reload() Chris Angelico <rosuav@gmail.com> - 2016-03-01 22:39 +1100
Re: Reason for not allowing import twice but allowing reload() Steven D'Aprano <steve@pearwood.info> - 2016-03-02 04:11 +1100
Re: Reason for not allowing import twice but allowing reload() Chris Angelico <rosuav@gmail.com> - 2016-03-02 05:04 +1100
Re: Reason for not allowing import twice but allowing reload() Ian Kelly <ian.g.kelly@gmail.com> - 2016-03-01 14:53 -0700
Re: Reason for not allowing import twice but allowing reload() Chris Angelico <rosuav@gmail.com> - 2016-03-02 09:02 +1100
Re: Reason for not allowing import twice but allowing reload() Ian Kelly <ian.g.kelly@gmail.com> - 2016-03-01 15:29 -0700
Re: Reason for not allowing import twice but allowing reload() Steven D'Aprano <steve@pearwood.info> - 2016-03-02 12:19 +1100
Re: Reason for not allowing import twice but allowing reload() Ian Kelly <ian.g.kelly@gmail.com> - 2016-03-01 19:22 -0700
Re: Reason for not allowing import twice but allowing reload() Rustom Mody <rustompmody@gmail.com> - 2016-03-02 02:15 -0800
Re: Reason for not allowing import twice but allowing reload() Rustom Mody <rustompmody@gmail.com> - 2016-03-02 02:19 -0800
Re: Reason for not allowing import twice but allowing reload() Grant Edwards <invalid@invalid.invalid> - 2016-03-02 15:15 +0000
Re: Reason for not allowing import twice but allowing reload() Chris Angelico <rosuav@gmail.com> - 2016-03-02 11:13 +1100
Re: Reason for not allowing import twice but allowing reload() Ian Kelly <ian.g.kelly@gmail.com> - 2016-02-29 00:02 -0700
Re: Reason for not allowing import twice but allowing reload() Chris Angelico <rosuav@gmail.com> - 2016-02-29 18:11 +1100
Re: Reason for not allowing import twice but allowing reload() BartC <bc@freeuk.com> - 2016-02-29 15:33 +0000
Re: Reason for not allowing import twice but allowing reload() Chris Angelico <rosuav@gmail.com> - 2016-03-01 03:05 +1100
Correct IDLE usage (was Reason for not allowing import twice but allowing reload()) Rustom Mody <rustompmody@gmail.com> - 2016-02-29 04:42 -0800
Re: Correct IDLE usage (was Reason for not allowing import twice but allowing reload()) Terry Reedy <tjreedy@udel.edu> - 2016-03-01 01:52 -0500
Re: Correct IDLE usage (was Reason for not allowing import twice but allowing reload()) Rustom Mody <rustompmody@gmail.com> - 2016-03-02 07:22 -0800
Re: Correct IDLE usage (was Reason for not allowing import twice but allowing reload()) Terry Reedy <tjreedy@udel.edu> - 2016-03-02 21:40 -0500
Re: Correct IDLE usage (was Reason for not allowing import twice but allowing reload()) Rustom Mody <rustompmody@gmail.com> - 2016-03-02 20:07 -0800
Re: Correct IDLE usage (was Reason for not allowing import twice but allowing reload()) Rustom Mody <rustompmody@gmail.com> - 2016-03-02 20:17 -0800
Re: Reason for not allowing import twice but allowing reload() alien2utoo@gmail.com - 2016-02-29 05:00 -0800
Re: Reason for not allowing import twice but allowing reload() alien2utoo@gmail.com - 2016-02-29 05:22 -0800
Re: Reason for not allowing import twice but allowing reload() alien2utoo@gmail.com - 2016-02-29 05:25 -0800
Re: Reason for not allowing import twice but allowing reload() Steven D'Aprano <steve@pearwood.info> - 2016-03-02 04:00 +1100
Re: Reason for not allowing import twice but allowing reload() alien2utoo@gmail.com - 2016-03-05 04:51 -0800
Re: Reason for not allowing import twice but allowing reload() Steven D'Aprano <steve@pearwood.info> - 2016-03-10 00:53 +1100
Reason for not allowing import twice but allowing reload() Rustom Mody <rustompmody@gmail.com> - 2016-02-29 05:51 -0800
Re: Reason for not allowing import twice but allowing reload() alien2utoo@gmail.com - 2016-02-29 07:13 -0800
Re: Reason for not allowing import twice but allowing reload() Terry Reedy <tjreedy@udel.edu> - 2016-03-01 02:04 -0500
Re: Reason for not allowing import twice but allowing reload() alien2utoo@gmail.com - 2016-03-06 00:20 -0800
Re: Reason for not allowing import twice but allowing reload() Steven D'Aprano <steve@pearwood.info> - 2016-03-07 01:50 +1100
Re: Reason for not allowing import twice but allowing reload() alien2utoo@gmail.com - 2016-03-06 00:31 -0800
csiph-web