On 10/28/2020 8:49 AM, ktkelly_1 wrote:
Currently have a code that takes in a .txt file and submits commands to the serial. Then it reads the reply from the
serial port and writes it to a hardcoded .txt file. The problem is it doesn't save it live and so if I need to stop the
code for any reaso
> On Oct 28, 2020, at 5:49 AM, ktkelly_1 wrote:
>
> Currently have a code that takes in a .txt file and submits commands to the
> serial. Then it reads the reply from the serial port and writes it to a
> hardcoded .txt file. The problem is it doesn't save it live and so if I need
> to stop th
Currently have a code that takes in a .txt file and submits commands to the
serial. Then it reads the reply from the serial port and writes it to a
hardcoded .txt file. The problem is it doesn't save it live and so if I need to
stop the code for any reason, I can't gather current data and the te
On Sunday, 6 May 2018 10:48:12 UTC+5:30, Chris Angelico wrote:
> On Sun, May 6, 2018 at 3:10 PM, Sharan Basappa
> wrote:
> > On Saturday, 5 May 2018 21:47:33 UTC+5:30, Steven D'Aprano wrote:
> >> On Sat, 05 May 2018 08:45:39 -0700, Sharan Basappa wrote:
> >>
> >> > Thanks a lot. I have actually
On Sun, May 6, 2018 at 3:10 PM, Sharan Basappa wrote:
> On Saturday, 5 May 2018 21:47:33 UTC+5:30, Steven D'Aprano wrote:
>> On Sat, 05 May 2018 08:45:39 -0700, Sharan Basappa wrote:
>>
>> > Thanks a lot. I have actually tried print with file handle as a
>> > parameter (the last option). I see th
On Saturday, 5 May 2018 21:47:33 UTC+5:30, Steven D'Aprano wrote:
> On Sat, 05 May 2018 08:45:39 -0700, Sharan Basappa wrote:
>
> > Thanks a lot. I have actually tried print with file handle as a
> > parameter (the last option). I see that the file is created but nothing
> > is logged.
>
> That
On Saturday, 5 May 2018 22:05:53 UTC+5:30, Mark Lawrence wrote:
> On 05/05/18 12:25, Sharan Basappa wrote:
> > In my program, I have print statements for debugging.
> > However, these are cluttering the display. So, I am trying to save
> > these to a file but somehow I cant seem to get it correct.
On 05/05/18 12:25, Sharan Basappa wrote:
In my program, I have print statements for debugging.
However, these are cluttering the display. So, I am trying to save
these to a file but somehow I cant seem to get it correct.
Use the logging module https://docs.python.org/3/library/logging.html
for
On Sat, 05 May 2018 08:45:39 -0700, Sharan Basappa wrote:
> Thanks a lot. I have actually tried print with file handle as a
> parameter (the last option). I see that the file is created but nothing
> is logged.
That could be a file buffer issue. Nothing will actually be written to
the disk until
On Saturday, 5 May 2018 19:00:12 UTC+5:30, Steven D'Aprano wrote:
> On Sat, 05 May 2018 04:25:50 -0700, Sharan Basappa wrote:
>
> > In my program, I have print statements for debugging. However, these are
> > cluttering the display. So, I am trying to save these to a file but
> > somehow I cant s
On Sat, 05 May 2018 04:25:50 -0700, Sharan Basappa wrote:
> In my program, I have print statements for debugging. However, these are
> cluttering the display. So, I am trying to save these to a file but
> somehow I cant seem to get it correct.
There are lots of way to solve this problem.
The bes
In my program, I have print statements for debugging.
However, these are cluttering the display. So, I am trying to save
these to a file but somehow I cant seem to get it correct.
For example, the following are the print statement in my program:
print("target_names\n",target_names)
To print to a
On 19/06/2014 08:54, cutey Love wrote:
Thank you very much, that fixed it.
What do you not understand about top posting and using google groups?
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
---
This email is free f
Thank you very much, that fixed it.
On Thursday, June 19, 2014 12:03:43 AM UTC+1, cutey Love wrote:
> I'm trying to write data to a text file
>
>
>
> But I'm getting the error:
>
>
>
> TypeError: invalid file: <_io.TextIOWrapper
>
>
>
> Code is
>
>
>
> def saveFile():
>
> file_p
On 6/18/14, 4:03 PM, cutey Love wrote:
I'm trying to write data to a text file
But I'm getting the error:
TypeError: invalid file: <_io.TextIOWrapper
Always better to err on posting too much context (the entire traceback)
than too little.
Code is
def saveFile():
file_path = filedia
On Wed, Jun 18, 2014 at 5:03 PM, cutey Love wrote:
> I'm trying to write data to a text file
>
> But I'm getting the error:
>
> TypeError: invalid file: <_io.TextIOWrapper
Post the full traceback. By posting only the error message you're
removing useful information.
--
https://mail.python.org/m
I'm trying to write data to a text file
But I'm getting the error:
TypeError: invalid file: <_io.TextIOWrapper
Code is
def saveFile():
file_path = filedialog.asksaveasfile(mode='w', filetypes=[('text files',
'.txt')], defaultextension=".txt")
fo = open(file_path, 'w')
for e
On Jun 10, 2:01 am, [EMAIL PROTECTED] wrote:
> Hello all,
>
> New user to python. I can write to a file, however, I would like to
> do both...whatever I do on the screen, I'd like to write it to a file.
>
> any pointers on where I can find this info.
>
> thanks,
Something like this, perhaps?
cl
On Mon, Jun 9, 2008 at 6:01 PM, <[EMAIL PROTECTED]> wrote:
> Hello all,
>
> New user to python. I can write to a file, however, I would like to
> do both...whatever I do on the screen, I'd like to write it to a file.
>
> any pointers on where I can find this info.
>
> thanks,
>
This code has on
On Jun 9, 9:01 pm, [EMAIL PROTECTED] wrote:
> Hello all,
>
> New user to python. I can write to a file, however, I would like to
> do both...whatever I do on the screen, I'd like to write it to a file.
>
> any pointers on where I can find this info.
>
> thanks,
There is probably some smart way t
Hello all,
New user to python. I can write to a file, however, I would like to
do both...whatever I do on the screen, I'd like to write it to a file.
any pointers on where I can find this info.
thanks,
--
http://mail.python.org/mailman/listinfo/python-list
ProvoWallis wrote:
...
> for root, dirs, files in os.walk(setpath):
> fname = files
> for fname in files:
> inputFile = file(os.path.join(root,fname), 'r')
> while 1:
>lines = inputFile.readlines(1)
>if not lines:
>
> I'm not sure what I'm
> missing so I'd appreciate some advice.
You question is pretty general and I'm not going to go over this in any
great detail, but I will make a few comments.
* In your if section use if ... else constructs not all the strange if
and then not if blocks. Also get rid
Hi,
I'm trying to create a script that will search an SGML file for the
numbers and titles of the hierarchical elements (section level
headings) and create a dictionary with the section number as the key
and the title as the value.
I've managed to make some progress but I'd like to get some gener
Rainer Hubovsky wrote:
> Thank you Reinhold, that was the solution. But just because I am curious:
> what is this statement without the parentheses? After all it is a valid
> statement...
>
> Rainer
>
>
> In article <[EMAIL PROTECTED]>, Reinhold Birkenfeld wrote:
>> Is the above exactly your c
Rainer Hubovsky wrote:
> Thank you Reinhold, that was the solution. But just because I am curious:
> what is this statement without the parentheses? After all it is a valid
> statement...
it's an expression that fetches the "close" method object, and throws
it away. to see what it evaluates to,
Thank you Reinhold, that was the solution. But just because I am curious:
what is this statement without the parentheses? After all it is a valid
statement...
Rainer
In article <[EMAIL PROTECTED]>, Reinhold Birkenfeld wrote:
> Is the above exactly your code? If yes, it should be
>
> f.close()
Rainer Hubovsky wrote:
> Hello Python-Gurus,
>
> ==
> f = open(LOGFILE,'w')
> f.write(time + '\n')
> f.close
>
> command = 'ping -n 20' + target + '>>' + LOGFILE
> system(command)
> ==
>
> produces an error saying that a file cannot be accessed bec
Hello Python-Gurus,
==
f = open(LOGFILE,'w')
f.write(time + '\n')
f.close
command = 'ping -n 20' + target + '>>' + LOGFILE
system(command)
==
produces an error saying that a file cannot be accessed because it is used
by another process. I asume it
29 matches
Mail list logo