Il 24/06/2022 15:10, simone zambonardi ha scritto:
Good morning, I need to read a text file. How come when I open it (running the
script) it says this? The text file is type RFT
{\rtf1\ansi\ansicpg1252\cocoartf2636
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica
Il 24/06/2022 15:44, jak ha scritto:
Il 24/06/2022 15:10, simone zambonardi ha scritto:
Good morning, I need to read a text file. How come when I open it
(running the script) it says this? The text file is type RFT
{\rtf1\ansi\ansicpg1252\cocoartf2636
\cocoatextscaling0\cocoaplatform0
On 12/06/2022 14:40, Ayesha Tassaduq wrote:
Hi i am trying to store a text file into MongoDB but i got the error .
"failing because no such method exists." % self.__name.split(".")[-1]
TypeError: 'Collection' object is not callable. If you meant to call the
Hi i am trying to store a text file into MongoDB but i got the error .
"failing because no such method exists." % self.__name.split(".")[-1]
TypeError: 'Collection' object is not callable. If you meant to call the
'insert' method on a 'Collection
"Steve" writes:
> I am going though a struggle with this and just don't see where it fails.
It seems to me you're putting your data into strings when you need to
put it into lists. And no, adding brackets and commas to your strings so
that printing out the strings makes them look like lists does
17 bugs in the code.
-Original Message-
From: Python-list On
Behalf Of Stephen Berman
Sent: Wednesday, July 28, 2021 5:36 PM
To: python-list@python.org
Subject: Re: Trying to read from a text file to generate a graph
[Resending to the list only, since I couldn't post it without su
[Resending to the list only, since I couldn't post it without subscribing.]
On Wed, 28 Jul 2021 11:58:21 -0400 "Steve" wrote:
> I forgot about the no-file rule...
>
>> On 28Jul2021 02:55, Steve wrote:
>> I am going though a struggle with this and just don't see where it
>> fails. I am using th
I forgot about the no-file rule...
On 28Jul2021 02:55, Steve wrote:
>I am going though a struggle with this and just don't see where it fails.
>I am using the Dual Bar Graph.py program from
https://matplotlib.org/stable/gallery/index.html website.
>The file from the web site works so that shows t
On 28Jul2021 02:55, Steve wrote:
>I am going though a struggle with this and just don't see where it fails.
>I am using the Dual Bar Graph.py program from
>https://matplotlib.org/stable/gallery/index.html website.
>The file from the web site works so that shows that all my installations are
>com
I am going though a struggle with this and just don't see where it fails.
I am using the Dual Bar Graph.py program from
https://matplotlib.org/stable/gallery/index.html website.
The file from the web site works so that shows that all my installations are
complete.
My program, LibreGraphics 05.py
t;
#or
#
#lynx -force_html -dump "$@"
#
#or
#
#w3m -T text/html -F -dump "$@"
On Tue, Mar 9, 2021 at 1:26 PM S Monzur wrote:
> Dear List,
>
> Newbie here. I am trying to loop over a text file to remove html tags,
> punctuation marks, stopwords. I have already used Beaut
text file.
https://pastebin.com/8BMi9qjW . I am now trying to remove the html tags
from this text file, and running into issues as mentioned in the previous
post.
As I said in my previous post, when you process the list entries
separately you will probably avoid the problem.
Unfortunately with the
I initially scraped the links using beautiful soup, and from those links
downloaded the specific content of the articles I was interested in
(titles, dates, names of contributor, main texts) and stored that
information in a list. I then saved the list to a text file.
https://pastebin.com/8BMi9qjW
On 10/03/2021 04:35, S Monzur wrote:
Thanks! I ended up using beautiful soup to remove the html tags and create
three lists (titles of article, publications dates, main body) but am still
facing a problem where the list is not properly storing the main body.
There is something wrong with my code
On Tue, Mar 9, 2021 at 10:36 PM S Monzur wrote:
>
> Thanks! I ended up using beautiful soup to remove the html tags and create
> three lists (titles of article, publications dates, main body) but am still
> facing a problem where the list is not properly storing the main body.
> There is something
e and bodytext.
> >
> >4. Remove punctuation and stopwords (I've used a user generated
> function
> > for that).
> >
> > I've been able to do all of these steps for the file
> [2]ListFileReduced,
> > as shown in the code (although it
).
I've been able to do all of these steps for the file [2]ListFileReduced,
as shown in the code (although it's clunky).
But, I would like to be able to do it for the other text file: [3]ListFile
which has more articles. I used BeautifulSoup to scrape the data from the
website,
drive.google.com/file/d/1ojwN4u8cmh_nUoMJpdZ5ObaGW5URYYj3/view?usp=sharing>,
as shown in the code (although it's clunky).
But, I would like to be able to do it for the other text file: ListFile
<https://drive.google.com/file/d/1V3s8w8a3NQvex91EdOhdC9rQtCAOElpm/view?usp=sharing>
which has more article
If you could utilized pastebin or similar site to show your code, it would help
tremendously since it's an unindented mess now and can not be read easily.
On Wed, Mar 10, 2021 at 03:07:14AM +0600, S Monzur wrote:
Dear List,
Newbie here. I am trying to loop over a text file to remove html
Dear List,
Newbie here. I am trying to loop over a text file to remove html tags,
punctuation marks, stopwords. I have already used Beautiful Soup (Python v
3.8.3) to scrape the text (newspaper articles) from the site. It returns a
list that I saved as a file. However, I am not sure how to use a
On 2019-01-15, Juris __ wrote:
> Hi!
>
> On 15/01/2019 17:04, Neil Cerutti wrote:
>> On 2019-01-11, shibashib...@gmail.com wrote:
>>> Hello
I'm very new in python. I have a file in the format:
2018-05-31 16:00:0028.90 81.77 4.3
2018-05-31 20:32:002
Hi!
On 15/01/2019 17:04, Neil Cerutti wrote:
> On 2019-01-11, shibashib...@gmail.com wrote:
>> Hello
>>>
>>> I'm very new in python. I have a file in the format:
>>>
>>> 2018-05-31 16:00:0028.90 81.77 4.3
>>> 2018-05-31 20:32:0028.17 84.89 4.1
>>> 2018-06-20 04:09:00
On 2019-01-11, shibashib...@gmail.com wrote:
> Hello
>>
>> I'm very new in python. I have a file in the format:
>>
>> 2018-05-31 16:00:0028.90 81.77 4.3
>> 2018-05-31 20:32:0028.17 84.89 4.1
>> 2018-06-20 04:09:0027.36 88.01 4.8
>> 2018-06-20 04:15:00
d returns the next value. Kind of useful when the
alternative is making and passing around huge lists.
--- Joseph S.
-Original Message-
From: DL Neil
Sent: Saturday, January 12, 2019 4:48 PM
To: python-list@python.org
Subject: Re: Python read text file columnwise
On 12/01/19 1:03 PM
-Original Message-
From: Avi Gross
Sent: Saturday, January 12, 2019 8:26 PM
To: 'DL Neil'
Subject: RE: Python read text file columnwise
I am not sure what the big deal is here. If the data is consistently
formatted you can read in a string per line and use offsets as i
On 12/01/19 1:03 PM, Piet van Oostrum wrote:
shibashib...@gmail.com writes:
Hello
I'm very new in python. I have a file in the format:
2018-05-31 16:00:0028.90 81.77 4.3
2018-05-31 20:32:0028.17 84.89 4.1
2018-06-20 04:09:0027.36 88.01 4.8
2
Peter Otten wrote:
> shibashib...@gmail.com wrote:
>
>> Hello
>>>
>>> I'm very new in python. I have a file in the format:
>>>
>>> 2018-05-31 16:00:0028.90 81.77 4.3
>>> 2018-05-31 20:32:0028.17 84.89 4.1
>>> 2018-06-20 04:09:0027.36 88.01 4.8
>>> 2018-06-
shibashib...@gmail.com wrote:
> Hello
>>
>> I'm very new in python. I have a file in the format:
>>
>> 2018-05-31 16:00:0028.90 81.77 4.3
>> 2018-05-31 20:32:0028.17 84.89 4.1
>> 2018-06-20 04:09:0027.36 88.01 4.8
>> 2018-06-20 04:15:0027.31
On 11Jan2019 12:43, shibashib...@gmail.com wrote:
I'm very new in python. I have a file in the format:
2018-05-31 16:00:0028.90 81.77 4.3
2018-05-31 20:32:0028.17 84.89 4.1
2018-06-20 04:09:0027.36 88.01 4.8
2018-06-20 04:15:0027.3
shibashib...@gmail.com writes:
> Hello
>>
>> I'm very new in python. I have a file in the format:
>>
>> 2018-05-31 16:00:0028.90 81.77 4.3
>> 2018-05-31 20:32:0028.17 84.89 4.1
>> 2018-06-20 04:09:0027.36 88.01 4.8
>> 2018-06-20 04:15:0027.31
On Fri, 11 Jan 2019, shibashib...@gmail.com wrote:
I'm very new in python. I have a file in the format:
2018-05-31 16:00:0028.90 81.77 4.3
2018-05-31 20:32:0028.17 84.89 4.1
2018-06-20 04:09:0027.36 88.01 4.8
2018-06-20 04:15:0027.
Hello
>
> I'm very new in python. I have a file in the format:
>
> 2018-05-3116:00:0028.90 81.77 4.3
> 2018-05-3120:32:0028.17 84.89 4.1
> 2018-06-2004:09:0027.36 88.01 4.8
> 2018-06-2004:15:0027.31 87.09 4.7
> 2018-06-2804.07:00
Hello,
I'm very new in python. I have a file in the format:
2018-05-31 16:00:0028.90 81.77 4.3
2018-05-31 20:32:0028.17 84.89 4.1
2018-06-20 04:09:0027.36 88.01 4.8
2018-06-20 04:15:0027.31 87.09 4.7
2018-06-28 04.07:00
alon.naj...@gmail.com wrote:
> hi,
>
> I try to edit a text file with python 2.7:
>
> * AAPL *
> Date: September 07 2018
> Time: 14:10:52
> Price: ,068,407
> Ask: None
> High: None
> Low: None
> Previous Close: ,068,407
> Volume: $ 227.35 / $ 22
hi,
I try to edit a text file with python 2.7:
* AAPL *
Date: September 07 2018
Time: 14:10:52
Price: ,068,407
Ask: None
High: None
Low: None
Previous Close: ,068,407
Volume: $ 227.35 / $ 221.30
Market Cap: 20.23
but when I write it to a file I get:
{'previous_close':
Grant Edwards wrote:
> Peter Otten <__pete...@web.de> wrote:
>
> > What we won't do is write a program for you ready to
> > present to your teacher.
>
> Or if we do, it will be subtly sabotaged in a manner that
> will make it obvious to an experienced Python programmer
> that you didn't write it.
On 2017-08-04, Peter Otten <__pete...@web.de> wrote:
> What we won't do is write a program for you ready to present to your
> teacher.
Or if we do, it will be subtly sabotaged in a manner that will make it
obvious to an experienced Python programmer that you didn't write it.
My favorite is to u
a écrit dans le message de
news:f705c092-de18-4c37-bde1-42316e8de...@googlegroups.com...
On Friday, August 4, 2017 at 12:27:02 PM UTC+3, ast wrote:
a écrit dans le message de
news:b6cc4ee5-71be-4550-be3e-59ebeee7a...@googlegroups.com...
thanks man! that works
I hope it is not a school h
ow to write a program that do:
> > - search for a string in certain text file and if it founds the string it
> > delete the file? and
> > print something?
> >
> > thanks.
>
> import os
> pattern = "azerty"
> found = False
>
> with open("
Peter Otten wrote:
> What we won't do is write a program for you ready to present to your
> teacher.
I should have known better :(
--
https://mail.python.org/mailman/listinfo/python-list
alon.naj...@gmail.com wrote:
> Hi, I'm new to thing forum and to this programming in python!
>
> can someone help me and write me how to write a program that do:
> - search for a string in certain text file and if it founds the string it
> delete the file? and print someth
a écrit dans le message de
news:b6cc4ee5-71be-4550-be3e-59ebeee7a...@googlegroups.com...
Hi, I'm new to thing forum and to this programming in python!
can someone help me and write me how to write a program that do:
- search for a string in certain text file and if it founds the stri
Hi, I'm new to thing forum and to this programming in python!
can someone help me and write me how to write a program that do:
- search for a string in certain text file and if it founds the string it
delete the file? and print something?
thanks.
--
https://mail.python.org/mailman/lis
On 2017-05-01, Peter Pearson wrote:
> On Sat, 29 Apr 2017 10:06:12 -0700 (PDT), marsh
> wrote:
>> Hi,
>>
>> I would like to ask how can I convert text file data into RDF fromat.
> [snip]
>
> What is RDF format?
https://en.wikipedia.org/wiki/Resource_Descript
On Sat, 29 Apr 2017 10:06:12 -0700 (PDT), marsh wrote:
> Hi,
>
> I would like to ask how can I convert text file data into RDF fromat.
[snip]
What is RDF format?
--
To email me, substitute nowhere->runbox, invalid->com.
--
https://mail.python.org/mailman/listinfo/python-list
Hi,
I would like to ask how can I convert text file data into RDF fromat. data look
like this:
# sent_id = weblog-juancole.com_juancole_20051126063000_ENG_20051126_063000-0001
# text = Al-Zaman : American forces killed Shaikh Abdullah al-Ani, the preacher
at the mosque in the town of Qaim
On Thursday, April 13, 2017 at 11:09:23 AM UTC+1, David Shi wrote:
> http://www.ebi.ac.uk/ena/data/warehouse/search?query=%22geo_circ(-0.587,-90.5713,170)%22&result=sequence_release&display=text
> The above is a web link to a structured text file. It is not a CSV.
> How can this
http://www.ebi.ac.uk/ena/data/warehouse/search?query=%22geo_circ(-0.587,-90.5713,170)%22&result=sequence_release&display=text
The above is a web link to a structured text file. It is not a CSV.
How can this text file be read into a Pandas Dataframe, so that further
processing can
On Thursday, April 13, 2017 at 9:15:18 AM UTC+1, David Shi wrote:
> Dear All,
> Can anyone help to read a text file into a Pandas DataFrame Table?
> Please see the link below.
> http://www.ebi.ac.uk/ena/data/warehouse/search?query=%22geo_circ(-0.587,-90.5713,170)%22&result=sequence
Dear All,
Can anyone help to read a text file into a Pandas DataFrame Table?
Please see the link below.
http://www.ebi.ac.uk/ena/data/warehouse/search?query=%22geo_circ(-0.587,-90.5713,170)%22&result=sequence_release&display=text
Regards.
David
--
https://mail.python.org/mailman/listinf
On Thursday, July 28, 2016 at 1:00:17 PM UTC+5:30, c...@zip.com.au wrote:
> On 27Jul2016 22:12, Arshpreet Singh wrote:
> >I am writing Imdb scrapper, and getting available list of titles from IMDB
> >website which provide txt file in very raw format, Here is the one part of
> >file(http://pasteb
On 29Jul2016 18:42, Gordon Levi wrote:
c...@zip.com.au wrote:
On 28Jul2016 19:28, Gordon Levi wrote:
Arshpreet Singh wrote:
I am writing Imdb scrapper, and getting available list of titles from IMDB
website which provide txt file in very raw format, Here is the one part of
file(http://past
c...@zip.com.au wrote:
>On 28Jul2016 19:28, Gordon Levi wrote:
>>Arshpreet Singh wrote:
>>>I am writing Imdb scrapper, and getting available list of titles from IMDB
>>>website which provide txt file in very raw format, Here is the one part of
>>>file(http://pastebin.com/fpMgBAjc) as the file
On 28Jul2016 19:28, Gordon Levi wrote:
Arshpreet Singh wrote:
I am writing Imdb scrapper, and getting available list of titles from IMDB
website which provide txt file in very raw format, Here is the one part of
file(http://pastebin.com/fpMgBAjc) as the file provides tags like
Distribution
Arshpreet Singh wrote:
>I am writing Imdb scrapper, and getting available list of titles from IMDB
>website which provide txt file in very raw format, Here is the one part of
>file(http://pastebin.com/fpMgBAjc) as the file provides tags like Distribution
> Votes,Rank,Title I want to parse titl
On 27Jul2016 22:12, Arshpreet Singh wrote:
I am writing Imdb scrapper, and getting available list of titles from IMDB
website which provide txt file in very raw format, Here is the one part of
file(http://pastebin.com/fpMgBAjc) as the file provides tags like Distribution
Votes,Rank,Title I wa
I am writing Imdb scrapper, and getting available list of titles from IMDB
website which provide txt file in very raw format, Here is the one part of
file(http://pastebin.com/fpMgBAjc) as the file provides tags like Distribution
Votes,Rank,Title I want to parse title names, I tried with readlin
Am 30.06.16 um 17:49 schrieb Heli:
Dear all,
After a few tests, I think I will need to correct a bit my question. I will
give an example here.
I have file 1 with 250 lines:
X1,Y1,Z1
X2,Y2,Z2
Then I have file 2 with 3M lines:
X1,Y1,Z1,value11,value12, value13,
X2,Y2,Z2,value21,value22
Dear all,
After a few tests, I think I will need to correct a bit my question. I will
give an example here.
I have file 1 with 250 lines:
X1,Y1,Z1
X2,Y2,Z2
Then I have file 2 with 3M lines:
X1,Y1,Z1,value11,value12, value13,
X2,Y2,Z2,value21,value22, value23,...
I will need to
On Tue, Jun 28, 2016 at 8:45 AM, Heli wrote:
> Hi,
>
> I need to read a file in to a 2d numpy array containing many number of lines.
> I was wondering what is the fastest way to do this?
>
> Is even reading the file in to numpy array the best method or there are
> better approaches?
>
numpy.genf
On Tue, Jun 28, 2016 at 10:08 AM Hedieh Ebrahimi wrote:
> File 1 has :
> x1,y1,z1
> x2,y2,z2
>
>
> and file2 has :
> x1,y1,z1,value1
> x2,y2,z2,value2
> x3,y3,z3,value3
> ...
>
> I need to read the coordinates from file 1 and then interpolate a value
> for these coordinates on file 2 to the
On Tue, Jun 28, 2016 at 9:51 AM Heli wrote:
> Is even reading the file in to numpy array the best method or there are
> better approaches?
>
What are you trying to accomplish?
Summary statistics, data transformation, analysis...?
--
https://mail.python.org/mailman/listinfo/python-list
Hi,
I need to read a file in to a 2d numpy array containing many number of lines.
I was wondering what is the fastest way to do this?
Is even reading the file in to numpy array the best method or there are better
approaches?
Thanks for your suggestions,
--
https://mail.python.org/mailman/li
On 11/19/2015 12:17 PM, Patrick Hess wrote:
> ryguy7272 wrote:
>> text_file = open("C:/Users/rshuell001/Desktop/excel/Text1.txt", "wb")
>> [...]
>> It doesn't seem like the '\n' is doing anything useful. All the text is
>> jumbled together.
>> [...]
>> I finally got it working. It's like this:
>
ryguy7272 wrote:
> text_file = open("C:/Users/rshuell001/Desktop/excel/Text1.txt", "wb")
> [...]
> It doesn't seem like the '\n' is doing anything useful. All the text is
> jumbled together.
> [...]
> I finally got it working. It's like this:
> "\r\n"
The better solution would be to open text f
ryguy7272 writes:
> text_file = open("C:/Users/rshuell001/Desktop/excel/Text1.txt", "wb")
Remove the "b" from this line. This is causing it to omit the
platform-specific translation of "\n", which means some Windows
applications will not recognize the line endings.
--
https://mail.python.org/ma
On Wed, 18 Nov 2015 09:40:58 -0800, ryguy7272 wrote:
>
> It doesn't seem like the '\n' is doing anything useful. All the text is
> jumbled together. When I open the file in Excel, or Notepad++, it is
> easy to read. However, when I open it in as a regular text fi
, and you do so in file mode "wb"
> > which restarts writing at the first byte of the file every time.
> >
> > You only need to open and close the text file once, instead of for every
> > link you output. Try moving the lines to open and close the file out
to you), the problem is that you're overwriting the whole
> file every time you write a link to it. This is because you open and
> close the file for every link you write, and you do so in file mode "wb"
> which restarts writing at the first byte of the file every time.
>
his is because you open and
close the file for every link you write, and you do so in file mode "wb"
which restarts writing at the first byte of the file every time.
You only need to open and close the text file once, instead of for every
link you output. Try moving the lines to ope
On Wednesday, November 18, 2015 at 12:04:16 PM UTC-5, ryguy7272 wrote:
> On Wednesday, November 18, 2015 at 11:58:17 AM UTC-5, Chris Angelico wrote:
> > On Thu, Nov 19, 2015 at 3:37 AM, ryguy7272 <> wrote:
> > > text_file = open("C:/Users/rshuell001/Desktop/excel/Text1.txt",
> > > "wb")
> >
On Wednesday, November 18, 2015 at 11:58:17 AM UTC-5, Chris Angelico wrote:
> On Thu, Nov 19, 2015 at 3:37 AM, ryguy7272 wrote:
> > text_file = open("C:/Users/rshuell001/Desktop/excel/Text1.txt", "wb")
> > z = str(link)
> > text_file.write(z + "\n")
> > text_file.writ
On Thu, Nov 19, 2015 at 3:37 AM, ryguy7272 wrote:
> text_file = open("C:/Users/rshuell001/Desktop/excel/Text1.txt", "wb")
> z = str(link)
> text_file.write(z + "\n")
> text_file.write("\n")
> text_file.close()
You're opening the file every time you go through
I'm trying the script below, and it simple writes the last line to a text file.
I want to add a '\n' after each line is written, so I don't overwrite all the
lines.
from bs4 import BeautifulSoup
import urllib2
var_file = urllib2.urlopen("http://www.imdb.c
On 2015-11-04 14:39, Steven D'Aprano wrote:
> On Wednesday 04 November 2015 03:56, Tim Chase wrote:
>> Or even more valuable to me:
>>
>> with open(..., newline="strip") as f:
>> assert all(not line.endswith(("\n", "\r")) for line in f)
>
> # Works only on Windows text files.
> def chomp(li
On 4 November 2015 at 03:39, Steven D'Aprano
wrote:
>
> Better would be this:
>
> def chomp(lines):
> for line in lines:
> yield line.rstrip() # remove all trailing whitespace
>
>
> with open(...) as f:
> for line in chomp(f): ...
with open(...) as f:
for line in map(str.rstr
On Wednesday 04 November 2015 03:56, Tim Chase wrote:
> Or even more valuable to me:
>
> with open(..., newline="strip") as f:
> assert all(not line.endswith(("\n", "\r")) for line in f)
# Works only on Windows text files.
def chomp(lines):
for line in lines:
yield line.rstrip(
On 2015-11-03, Tim Chase wrote:
[re. iterating over lines in a file]
> I can't think of more than 1-2 times in my last 10+ years of
> Pythoning that I've actually had potential use for the newlines,
If you can think of 1-2 times when you've been interating over the
lines in a file and wanted to
On 2015-11-03 11:39, Ian Kelly wrote:
> >> because I have countless loops that look something like
> >>
> >> with open(...) as f:
> >> for line in f:
> >> line = line.rstrip('\r\n')
> >> process(line)
> >
> > What would happen if you read a file opened like this without
> > iter
On Tue, Nov 3, 2015 at 11:33 AM, Ian Kelly wrote:
> On Tue, Nov 3, 2015 at 9:56 AM, Tim Chase
> wrote:
>> Or even more valuable to me:
>>
>> with open(..., newline="strip") as f:
>> assert all(not line.endswith(("\n", "\r")) for line in f)
>>
>> because I have countless loops that look som
On Tue, Nov 3, 2015 at 9:56 AM, Tim Chase wrote:
> On 2015-11-03 16:35, Peter Otten wrote:
>> I wish there were a way to prohibit such files. Maybe a special
>> value
>>
>> with open(..., newline="normalize") f:
>> assert all(line.endswith("\n") for line in f)
>>
>> to ensure that all lines en
Tim Chase wrote:
> On 2015-11-03 16:35, Peter Otten wrote:
>> I wish there were a way to prohibit such files. Maybe a special
>> value
>>
>> with open(..., newline="normalize") f:
>> assert all(line.endswith("\n") for line in f)
>>
>> to ensure that all lines end with "\n"?
>
> Or even more
On 2015-11-03 16:35, Peter Otten wrote:
> I wish there were a way to prohibit such files. Maybe a special
> value
>
> with open(..., newline="normalize") f:
> assert all(line.endswith("\n") for line in f)
>
> to ensure that all lines end with "\n"?
Or even more valuable to me:
with open(
Peter Otten writes:
> Jussi Piitulainen wrote:
>> Peter Otten writes:
>>
>>> If a "line" is defined as a string that ends with a newline
>>>
>>> def ends_in_asterisk(line):
>>> return False
>>>
>>> would also satisfy the requirement. Lies, damned lies, and specs ;)
>>
>> Even if a "line" is d
Jussi Piitulainen wrote:
> Peter Otten writes:
>
>> If a "line" is defined as a string that ends with a newline
>>
>> def ends_in_asterisk(line):
>> return False
>>
>> would also satisfy the requirement. Lies, damned lies, and specs ;)
>
> Even if a "line" is defined as a string that comes f
In a message of Mon, 10 Aug 2015 08:55:10 +0530, OmPs writes:
>I have built a contact form which sends me email for every user
>registration My question is more related to parsing some text data into csv
>format.
Your contact form should be able to produce csv files for you, rather
than producing p
l for every user
registration My question is more related to parsing some text data into csv
format. and I have received multiple users information in my mail box which
I had copied into a text file. The data looks like below.
Name: testuser2
Email: testus...@gmail.com
Cluster Name:
On 29Jul2015 07:52, dieter wrote:
"=?GBK?B?wO68zsX0?=" writes:
Hi, I tried using seek to reverse a text file after reading about the
subject in the documentation:
https://docs.python.org/3/tutorial/inputoutput.html#methods-of-file-objects
https://docs.python.org/3/libra
"=?GBK?B?wO68zsX0?=" writes:
> Hi, I tried using seek to reverse a text file after reading about the
> subject in the documentation:
>
> https://docs.python.org/3/tutorial/inputoutput.html#methods-of-file-objects
>
> https://docs.python.org/3/library/io.html#io.Tex
Hi, I tried using seek to reverse a text file after reading about the
subject in the documentation:
https://docs.python.org/3/tutorial/inputoutput.html#methods-of-file-objects
https://docs.python.org/3/library/io.html#io.TextIOBase.seek
The script "reverse_text_by_seek3.py" produce
Chris Angelico wrote:
> On Sat, Apr 18, 2015 at 12:26 AM, wrote:
>> I tried to do as follows,
> import codecs
> sourceEncoding = "iso-8859-1"
> targetEncoding = "utf-8"
> source = open("source1","w")
> string1="String type"
> str1=str(string1)
> source.write(str1)
>>>
On 04/17/2015 10:48 AM, Dave Angel wrote:
On 04/17/2015 09:19 AM, subhabrata.bane...@gmail.com wrote:
>>> target = open("target", "w")
It's not usually a good idea to use the same variable for both the file
name and the opened file object. What if you need later to print the
name, as in
Chris Angelico :
> Here's how I'd do it.
>
> $ python3
with open("source1", encoding="iso-8859-1") as source,
>> open("target", "w", encoding="utf-8") as target:
> ... target.write(source.read())
You might run out of memory. How about:
===
(at least twice) at one time. This
will also help enormously if you encounter any errors, and want to
report the location and problem to the user. It might even turn out to
be faster.
You should write non-trivial code in a text file, and run it from
there.
--
DaveA
--
https://mail.python.org/mailman/listinfo/python-list
On Sat, Apr 18, 2015 at 12:26 AM, wrote:
> I tried to do as follows,
import codecs
sourceEncoding = "iso-8859-1"
targetEncoding = "utf-8"
source = open("source1","w")
string1="String type"
str1=str(string1)
source.write(str1)
source.close()
target = op
On Friday, April 17, 2015 at 7:36:46 PM UTC+5:30, Oscar Benjamin wrote:
> wrote:
> > On Friday, April 17, 2015 at 6:50:08 PM UTC+5:30, wrote:
> >> I am having few files in default encoding. I wanted to change their
> >> encodings,
> >> preferably in "UTF-8", or may be from one encoding to any ot
On 17 April 2015 at 14:51, wrote:
> On Friday, April 17, 2015 at 6:50:08 PM UTC+5:30, subhabrat...@gmail.com
> wrote:
>> I am having few files in default encoding. I wanted to change their
>> encodings,
>> preferably in "UTF-8", or may be from one encoding to any other encoding.
>>
>> I was try
On Friday, April 17, 2015 at 6:50:08 PM UTC+5:30, subhabrat...@gmail.com wrote:
> I am having few files in default encoding. I wanted to change their
> encodings,
> preferably in "UTF-8", or may be from one encoding to any other encoding.
>
> I was trying it as follows,
>
>>>> import codec
On Friday, April 17, 2015 at 6:50:08 PM UTC+5:30, subhabrat...@gmail.com wrote:
> I am having few files in default encoding. I wanted to change their
> encodings,
> preferably in "UTF-8", or may be from one encoding to any other encoding.
>
> I was trying it as follows,
>
>>>> import codec
I am having few files in default encoding. I wanted to change their encodings,
preferably in "UTF-8", or may be from one encoding to any other encoding.
I was trying it as follows,
>>> import codecs
>>> sourceEncoding = "iso-8859-1"
>>> targetEncoding = "utf-8"
>>> source = open("so
1 - 100 of 1034 matches
Mail list logo