Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8288735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:20:13+00:00 2026-06-08T12:20:13+00:00

Using the code below, I’m getting the correct information to the file – kind

  • 0

Using the code below, I’m getting the correct information to the file – kind of. Here’s the code:

filename = raw_input('What would you like to name the file? ')

import csv

data = [frames]
out = csv.writer(open(filename,"w"), delimiter=' ',quoting=csv.QUOTE_MINIMAL)
out.writerows(data)

This generates something that looks like this in a text file:

"[255   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
   0   0]" "[  0 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171
 171 171]" 

I would like the information to look like this:

255 255 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 []0 255 255 255 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

The 2 brackets represents a character that indicates a new row of information. It’s a little rectangle on my text editor and I’m unsure of what the character is.

So, how do I get rid of the quotes and brackets and use this other character?

EDIT:

I tried using the code below and got the following error:

Traceback (most recent call last):   
  File "(stdin)", line 1, in (module)   
  File "backandforth3.py", line 154, in (module)
    out.write(' '.join(frame)) 
Type Error: sequence item 0: expect string, numpy.int32 found
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T12:20:14+00:00Added an answer on June 8, 2026 at 12:20 pm

    I’m assuming you’re using Notepad as your text editor? Unix-style newlines (\n) show up as boxes in Notepad because it only supports Windows newlines (\r\n). That said, this should provide the output you’re expecting:

    filename = raw_input('What would you like to name the file? ')
    
    with open(filename, 'wb') as out:
        for frame in frames:
            out.write(' '.join(str(num) for num in frame))
            out.write('\r\n')
    

    There’s no reason to wrap frames in another list; assuming that variable is a list of lists of numbers, as the expected output would indicate, this should work fine.

    Also, if you absolutely have to have the “boxes” that you described in the output, replace '\r\n' with '\n'.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I 'm opening a video file (3gp) file using code below String url =
I have swf file, im using code below to display it on my website:
I'm using code below for converting an RGB tif file to CMYK format. It
I am reading a plist file using code below. My problem is that the
My ASP.NET application return PDF file to user using code below Context.Response.Clear(); Context.Response.ContentType =
I can insert a row by using code below. USE pmdb; INSERT INTO md5_tbl
Using the code below I can insert a new row to my table (
Using the code below, I am attempting to fill a Canvas with UIElements and
Using the code below (from a console app I've cobbled together), I add seven
Using the code below, I want to keep the same menu div opened in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.