Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

You have to change from wb to w:

def __init__(self): self.myCsv = csv.writer(open('Item.csv', 'wb')) self.myCsv.writerow(['title', 'link']) 

to

def __init__(self): self.myCsv = csv.writer(open('Item.csv', 'w')) self.myCsv.writerow(['title', 'link']) 

After changing this, the error disappears, but you can't write to the file (in my case). So after all, I don't have an answer?

Source: How to remove ^MHow to remove ^M

Changing to 'rb' brings me the other error: io.UnsupportedOperation: write

You have to change from wb to w:

def __init__(self): self.myCsv = csv.writer(open('Item.csv', 'wb')) self.myCsv.writerow(['title', 'link']) 

to

def __init__(self): self.myCsv = csv.writer(open('Item.csv', 'w')) self.myCsv.writerow(['title', 'link']) 

After changing this, the error disappears, but you can't write to the file (in my case). So after all, I don't have an answer?

Source: How to remove ^M

Changing to 'rb' brings me the other error: io.UnsupportedOperation: write

You have to change from wb to w:

def __init__(self): self.myCsv = csv.writer(open('Item.csv', 'wb')) self.myCsv.writerow(['title', 'link']) 

to

def __init__(self): self.myCsv = csv.writer(open('Item.csv', 'w')) self.myCsv.writerow(['title', 'link']) 

After changing this, the error disappears, but you can't write to the file (in my case). So after all, I don't have an answer?

Source: How to remove ^M

Changing to 'rb' brings me the other error: io.UnsupportedOperation: write

added 218 characters in body
Source Link
meck373
  • 1.1k
  • 1
  • 19
  • 32

You have to change from wb to w:

def __init__(self): self.myCsv = csv.writer(open('Item.csv', 'wb')) self.myCsv.writerow(['title', 'link']) 

to

def __init__(self): self.myCsv = csv.writer(open('Item.csv', 'w')) self.myCsv.writerow(['title', 'link']) 

After changing this, the error disappears, but you can't write to the file (in my case). So after all, I don't have an answer?

Source: How to remove ^M

Changing to 'rb' brings me the other error: io.UnsupportedOperation: write

You have to change from wb to w:

def __init__(self): self.myCsv = csv.writer(open('Item.csv', 'wb')) self.myCsv.writerow(['title', 'link']) 

to

def __init__(self): self.myCsv = csv.writer(open('Item.csv', 'w')) self.myCsv.writerow(['title', 'link']) 

You have to change from wb to w:

def __init__(self): self.myCsv = csv.writer(open('Item.csv', 'wb')) self.myCsv.writerow(['title', 'link']) 

to

def __init__(self): self.myCsv = csv.writer(open('Item.csv', 'w')) self.myCsv.writerow(['title', 'link']) 

After changing this, the error disappears, but you can't write to the file (in my case). So after all, I don't have an answer?

Source: How to remove ^M

Changing to 'rb' brings me the other error: io.UnsupportedOperation: write

Source Link
meck373
  • 1.1k
  • 1
  • 19
  • 32

You have to change from wb to w:

def __init__(self): self.myCsv = csv.writer(open('Item.csv', 'wb')) self.myCsv.writerow(['title', 'link']) 

to

def __init__(self): self.myCsv = csv.writer(open('Item.csv', 'w')) self.myCsv.writerow(['title', 'link'])