New submission from Rohan Amin :
When using file.read() with a large text file,
there is a UnicodeDecodeError. I expected file.read(1) to read one character
from the file. It works with a smaller text file. I experienced this bug on
Windows 10 version 20H2. My teacher couldn't reproduce
Rohan Prasad added the comment:
I see this makes a ton of sense, thanks! I'll close this issue.
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
New submission from Rohan Prasad :
Hi,
I'm having a weird issue with floats in dictionaries and equality comparison
(see attached screenshot for an example). When I create two dictionaries with a
nan value they pass an equivalence test. However, if I pickle and unpickle one
Rohan Padhye added the comment:
Another point I'd like to make is that there is no error in either file or
interactive if the annotated assignment appears before the `global` declaration
like so:
```
x:int = 0
def set_x():
global x
x = 1
# Works fine!
```
The syntax error
New submission from Rohan Padhye :
The following code when run as a script file gives syntax error:
```
def set_x():
global x
x = 1
x:int = 0 # SyntaxError: annotated name 'x' can't be global
```
PEP 526 does not seem to forbid this. The error message "annotated name [...]
Rohan D'Sa <roh4n@gmail.com> added the comment:
Yes. Thanks.
On 30 Jan 2018 8:31 PM, "Cheryl Sabella" <rep...@bugs.python.org> wrote:
>
> Cheryl Sabella <chek...@gmail.com> added the comment:
>
> Can this be closed as 'Not
Rohan D'Sa <roh4n@gmail.com> added the comment:
you are right. i realized later i actually had a leak in a com instantiated
object, assumed it was a leak in the python and tried to find it using the gc
module.
The gc documentation led me down the garden path.
QUOTE
gc.garbage
New submission from Rohan D'Sa <roh4n@gmail.com>:
import gc, json
class leak(object):
def __init__(self):
pass
gc.set_debug(gc.DEBUG_LEAK)
while True:
leak_ = leak()
json.dumps(leak_.__dict__, indent=True)
gc.collect()
print(f"garbage count: {len
Michael Rohan added the comment:
I recently implemented a custom logger derived from Logger and to get the
reporting of modules, etc, correct, I implemented the findCaller using
the same code as library code with the minor change of
if filename == _srcfile:
to
if filename in [logging._srcfile
I want to write a function in Python for a tab delimited file I am dealing
with,to filter out values from a column, and put that parameter as a command
line option while running the script.
So,if the limit is 10,the filter out all the rows with values less than 10.
Also,I want to check if the
before I start parsing it.
BeautifulSoup library only fetches source of page. I need the access
to DOM after js execution with url as input parameter.
Any pointers?
--
Regards
Rohan
--
http://mail.python.org/mailman/listinfo/python-list
Try using dividend % divisor, this will return the remainder
Rohan Pai
--
http://mail.python.org/mailman/listinfo/python-list
is , if i run .pyc file on another computer containing only python
installed , will it run ? or do i need to install 3rd party lib again on
that computer ? Anyone know how to make program lib independent , something
called embedded into one file only ?
thank you in anticipation .
Rohan.
--
http
When I write program (.py) with IDLE , I am able to use run package .
- - - - start - - - -
if __name__ == '__main__':
import sys,os
import run
run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])
- - - - end - - - - -
above code works simply with the IDLE.
But
I have the following piece of code
a = len(ab_file)
b= 0
while(ba):
c= 0
d = len(cd_files)
while(cd):
if cd_files[c] == ab_file[b]:
files.append(ab_file[b].upper())
else:
files.append(ab_file[b])
c = c + 1
b = b
On Aug 12, 10:01 pm, ianaré [EMAIL PROTECTED] wrote:
On Aug 12, 10:05 pm, Rohan [EMAIL PROTECTED] wrote:
Hello,
Can some one tell me how do I get colored text. Say when I want to
write something in a text file , how do I get it colored.
Plain text files don't have color. You could output
Hello,
Can some one tell me how do I get colored text. Say when I want to
write something in a text file , how do I get it colored.
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
I would like to write a script which does the following job.
Take column1 and 7 from 10 different excel sheets and pasthe them into
a new excel worksheet.
Any ideas on how to do it
Thanks,
--
http://mail.python.org/mailman/listinfo/python-list
On Aug 3, 7:22 pm, SMERSH009 [EMAIL PROTECTED] wrote:
On Aug 3, 9:47 am,Rohan[EMAIL PROTECTED] wrote:
On Aug 2, 1:06 pm, Laurent Pointal [EMAIL PROTECTED] wrote:
Rohanwrote:
I was wondering if there could be an arrangement where a file could be
attached and send as an email
Hello,
I would like my script to run once a week with out any external
interference.
More like a timer. Can it be done in python or should some other shell
scripting be used.
If anyone knows anything please let me know.
--
http://mail.python.org/mailman/listinfo/python-list
On Aug 2, 1:06 pm, Laurent Pointal [EMAIL PROTECTED] wrote:
Rohan wrote:
I was wondering if there could be an arrangement where a file could be
attached and send as an email.
For ex
f = open(add.txt,w)
f.write('python')
f.close()
Now I would like to send an email with add.txt
I was wondering if there could be an arrangement where a file could be
attached and send as an email.
For ex
f = open(add.txt,w)
f.write('python')
f.close()
Now I would like to send an email with add.txt as an attachment, is it
possible ?
some one give me a pointer towards this.
--
I would like to get a list of sub directories in a directory.
If I use os.listdir i get a list of directories and files in that .
i only want the list of directories in a directory and not the files
in it.
anyone has an idea regarding this.
--
http://mail.python.org/mailman/listinfo/python-list
I'm having a trouble consider this
import csv
f = open(/home/t/tp/va/some7.csv, rb)
reader =csv.reader(f)
rows =[]
for row in reader:
rows.append(row)
rows[1].append('1')
print rows
f = open(/home/t/tp/va/e7.csv, ab)
writer =csv.writer(f)
writer.writerows(rows)
f.close()
In the file
On Jul 26, 2:32 pm, John Machin [EMAIL PROTECTED] wrote:
On Jul 27, 7:19 am, Rohan [EMAIL PROTECTED] wrote:
f = open(/home/t/tp/va/e7.csv, ab)
a means Append -- you are appending the data that you expect to the
EXISTING contents of the file.
Hello John,
Yea silly mistake, write mode
Hello,
I'm working on a script which collects some data and puts into a csv
file which could be exported to excel.
so far so good, I'm able to do what I described.
When I run the script for the second time after a certain period of
time the results should appear next to the results of the last
Hello,
I'm working on a script which collects some data and puts into a csv
file which could be exported to excel.
so far so good, I'm able to do what I described.
When I run the script for the second time after a certain period of
time the results should appear next to the results of the last
27 matches
Mail list logo