Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #25419

Re: Discussion on some Code Issues

Newsgroups comp.lang.python
Date 2012-07-16 07:17 -0700
References (2 earlier) <mailman.1901.1341694286.4697.python-list@python.org> <09adb3cf-f3f2-4acc-b561-a36dcf15ecc7@googlegroups.com> <mailman.1910.1341734607.4697.python-list@python.org> <11832de7-a064-494e-b3e8-32a2f15a6902@googlegroups.com> <mailman.1922.1341767824.4697.python-list@python.org>
Subject Re: Discussion on some Code Issues
From subhabangalore@gmail.com
Message-ID <mailman.2175.1342448249.4697.python-list@python.org> (permalink)

Show all headers | View raw


On Sunday, July 8, 2012 10:47:00 PM UTC+5:30, Chris Angelico wrote:
> On Mon, Jul 9, 2012 at 3:05 AM,  &lt;subhabangalore@gmail.com&gt; wrote:
> &gt; On Sunday, July 8, 2012 1:33:25 PM UTC+5:30, Chris Angelico wrote:
> &gt;&gt; On Sun, Jul 8, 2012 at 3:42 PM,  &lt;subhabangalore@gmail.com&gt; wrote:
> &gt;&gt; &gt; file_open=open(&quot;/python32/doc1.txt&quot;,&quot;r&quot;)
> &gt;&gt; Also, as has already been mentioned: keeping your data files in the
> &gt;&gt; Python binaries directory isn&#39;t usually a good idea. More common to
> &gt;&gt; keep them in the same directory as your script, which would mean that
> &gt;&gt; you don&#39;t need a path on it at all.
> &gt; No file path! Amazing. I do not know I like to know one small example please.
> 
> open(&quot;doc1.txt&quot;,&quot;r&quot;)
> 
> Python will look for a file called doc1.txt in the directory you run
> the script from (which is often going to be the same directory as your
> .py program).
> 
> &gt; Btw, some earlier post said, line.split() to convert line into bag of words can be done with power(), but I did not find it, if any one can help. I do close files do not worry. New style I&#39;d try.
> 
> I don&#39;t know what power() function you&#39;re talking about, and can&#39;t
> find it in the previous posts; the nearest I can find is a post from
> Ranting Rick which says a lot of guff that you can ignore. (Rick is a
> professional troll. Occasionally he says something useful and
> courteous; more often it&#39;s one or the other, or neither.)
> 
> As to the closing of files: There are a few narrow issues that make it
> worth using the &#39;with&#39; statement, such as exceptions; mostly, it&#39;s
> just a good habit to get into. If you ignore it, your file will
> *usually* be closed fairly soon after you stop referencing it, but
> there&#39;s no guarantee. (Someone else will doubtless correct me if I&#39;m
> wrong, but I&#39;m pretty sure Python guarantees to properly flush and
> close on exit, but not necessarily before.)
> 
> ChrisA

Dear Group,

The problem is more or less solved. Thank you for giving varied ways of thinking on the problem. Everytime I visit the group I learn so many things. Thank you all for taking your kind time to try to absolve the issue.

Regards,
Subhabrata Banerjee.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Discussion on some Code Issues subhabangalore@gmail.com - 2012-07-04 16:21 -0700
  Re: Discussion on some Code Issues Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-07-05 00:02 +0000
  Re: Discussion on some Code Issues Rick Johnson <rantingrickjohnson@gmail.com> - 2012-07-04 17:08 -0700
  Re: Discussion on some Code Issues subhabangalore@gmail.com - 2012-07-04 20:25 -0700
    Re: Discussion on some Code Issues Peter Otten <__peter__@web.de> - 2012-07-05 09:30 +0200
      Re: Discussion on some Code Issues subhabangalore@gmail.com - 2012-07-05 07:33 -0700
      Re: Discussion on some Code Issues subhabangalore@gmail.com - 2012-07-05 07:33 -0700
        Re: Discussion on some Code Issues Peter Otten <__peter__@web.de> - 2012-07-06 09:35 +0200
  Re: Discussion on some Code Issues subhabangalore@gmail.com - 2012-07-07 12:54 -0700
    Re: Discussion on some Code Issues Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-07-07 16:51 -0400
      Re: Discussion on some Code Issues subhabangalore@gmail.com - 2012-07-07 22:42 -0700
        Re: Discussion on some Code Issues Chris Angelico <rosuav@gmail.com> - 2012-07-08 18:03 +1000
          Re: Discussion on some Code Issues subhabangalore@gmail.com - 2012-07-08 10:05 -0700
            Re: Discussion on some Code Issues Chris Angelico <rosuav@gmail.com> - 2012-07-09 03:17 +1000
              Re: Discussion on some Code Issues Roy Smith <roy@panix.com> - 2012-07-08 14:17 -0400
                Re: Discussion on some Code Issues Chris Angelico <rosuav@gmail.com> - 2012-07-09 07:54 +1000
                Re: Discussion on some Code Issues Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-07-09 00:57 +0000
                Re: Discussion on some Code Issues Chris Angelico <rosuav@gmail.com> - 2012-07-09 18:41 +1000
                Re: Discussion on some Code Issues Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-07-09 12:24 +0000
                Re: Discussion on some Code Issues Chris Angelico <rosuav@gmail.com> - 2012-07-10 00:47 +1000
                Re: Discussion on some Code Issues Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-07-09 12:49 -0400
              Re: Discussion on some Code Issues subhabangalore@gmail.com - 2012-07-16 07:17 -0700
              Re: Discussion on some Code Issues subhabangalore@gmail.com - 2012-07-16 07:17 -0700
            Re: Discussion on some Code Issues MRAB <python@mrabarnett.plus.com> - 2012-07-08 19:27 +0100
          Re: Discussion on some Code Issues subhabangalore@gmail.com - 2012-07-08 10:05 -0700
        Re: Discussion on some Code Issues Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-07-08 15:07 -0400
      Re: Discussion on some Code Issues subhabangalore@gmail.com - 2012-07-07 22:42 -0700

csiph-web