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

  • Home
  • SEARCH
  • 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 95665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T23:41:38+00:00 2026-05-10T23:41:38+00:00

I am using Python to read in data in a user-unfriendly format and transform

  • 0

I am using Python to read in data in a user-unfriendly format and transform it into an easier-to-read format. The records I am outputting are usually going to be just a last name, first name, and room code. I

I would like to output a series of pages, each containing a contiguous subset of the total records, divided into multiple columns, each of which contains a contiguous subset of the total records on the page. (So in other words, you’d read down the first column, move to the next column, move to the next column, etc., and then start over on the next page…)

The problem I am facing now is that for output formats, I’m almost certainly limited to HTML (and Javascript, CSS, etc.) What is the best way to get the data into this columnar format? If I knew for certain that the printable area of the paper would hold 20 records vertically and five horizontally, for instance, I could easily print tables of 5×20, but I don’t know if there’s a way to indicate a page break — and I don’t know if there’s any way to calculate programmatically how many records will fit on the page.

How would you approach this?

EDIT: The reason I said that I was limited in output: I have to produce the file on one computer, then bring it to a different computer upon which we cannot install new software and on which the selection of existing software is not optimal. The file itself is only going to be used to make a physical printout (which is what the end users will actually work with), but my time on the computer that I can print from is going to be limited, so I need to have the file all ready to go and print right away without a lot of tweaking.

Right now I’ve managed to find a word processor that I can use on the target machine, so I’m going to see if I can target a format that the word processor uses.

EDIT: Once I knew there was a word processor I could use, I made a simple skeleton file with the settings that I wanted (column and tab settings, monospaced font in a small point size, etc.) and then measured how many characters I got per line of a column and how many lines I got per column. I’ve watched the runs pretty carefully to make sure that there weren’t some strange lines that somehow overflowed the characters-per-line guideline (which shouldn’t happen with monospaced font, of course, but how many times do you end up having to figure out why that thing that ‘shouldn’t’ happen is happening anyways?)

If there hadn’t been a word processor on the target machine that I could use, I probably would have looked at PDF as an output format.

  • 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. 2026-05-10T23:41:38+00:00Added an answer on May 10, 2026 at 11:41 pm

    ‘If I knew for certain that the printable area of the paper would hold 20 records vertically and five horizontally’

    You do know that.

    You know the size of your paper. You know the size of your font. You can easily do the math.

    ‘almost certainly limited to HTML…’ doesn’t make much sense. Is this a web application? The page can have a ‘Previous’ and ‘Next’ button to step through the pages? Pick a size that looks good to you and display one page full with ‘Previous’ and ‘Next’ buttons.

    If it’s supposed to be one HTML page that prints correctly, that’s hard. There are CSS things you can do, but you’ll be happier creating a PDF file.

    Get PyX or ReportLab and create a PDF that prints properly.

    I — personally — have no patience with any of this. I try put this kind of thing into a CSV file. My users can then open CSV with a tool spreadsheet (Open Office Org has a good one) and then adjust the columns and print with it.

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

Sidebar

Ask A Question

Stats

  • Questions 78k
  • Answers 78k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Since you are building the string so why not say… May 11, 2026 at 3:47 pm
  • added an answer See this discussion It is essentially impossible in plain managed… May 11, 2026 at 3:47 pm
  • added an answer The parameters to initWithObjects need to end in nil, like… May 11, 2026 at 3:47 pm

Related Questions

I have a python sgi script that attempts to extract an rss items that
I have a web service that uses Python's SimpleJSON to serialize JSON, and a
I am trying to use Python's ctypes library to access some methods in the
I've been a software developer for over twenty years, programming in C, Perl, SQL,

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.