Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #109369 > unrolled thread
| Started by | Michael Selik <michael.selik@gmail.com> |
|---|---|
| First post | 2016-06-02 14:15 +0000 |
| Last post | 2016-06-02 14:15 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [Q] ImportError by __import__() on Python >= 3.4 Michael Selik <michael.selik@gmail.com> - 2016-06-02 14:15 +0000
| From | Michael Selik <michael.selik@gmail.com> |
|---|---|
| Date | 2016-06-02 14:15 +0000 |
| Subject | Re: [Q] ImportError by __import__() on Python >= 3.4 |
| Message-ID | <mailman.96.1464876957.1839.python-list@python.org> |
On Thu, Jun 2, 2016 at 10:06 AM Makoto Kuwata <kwa@kuwata-lab.com> wrote:
> os.mkdir(name)
> with open(name + "/__init__.py", 'w') as f:
> f.write("X=1")
> f.flush()
>
> Please give me any advices or hints.
>
This wasn't your question, but you don't need to flush the file. The
``with`` statement will automatically flush and close your file for you
after you exit the block.
Back to top | Article view | comp.lang.python
csiph-web