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 6240033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:29:41+00:00 2026-05-24T11:29:41+00:00

I am trying to make a simple layout like this: ——— – – –

  • 0

I am trying to make a simple layout like this:

---------
-       -
-  ABC  -
-       -
---------

And I have tried two ways but failed:
1st method: Put the cursor at the right position, but I cannot seem to place the second vertical line where I want it:

    # making first horizontal linefrom position 00
    string_line = "-"*width              
    position00 = 0
    self.summarylines.append(string_line.ljust(position00))

    # making first vertical line from position 00
    for i in range(height):
            self.summarylines.append('-')

    # making second horizontal line from position V0
    poistion0V=position00+height        
    self.summarylines.append(string_line.ljust(poistion0V))

    # making second vertical line from position H0
    positionH0 = position00+width
    for i in range(height):
            self.summarylines.append('-'.ljust(positionH0))

2nd method: is to add the two vertical lines at the same time by adding the space in between them:

    # making first horizontal linefrom position 00
    string_line = "-"*width              
    position00 = 0
    self.summarylines.append(string_line.ljust(position00))

    # making first and second vertical line from position 00 + H0
    for i in range(height):
            self.summarylines.append('-    -')

    # making second horizontal line from position V0
    poistion0V=position00+height        
    self.summarylines.append(string_line.ljust(poistion0V))

However, for this case I don’t know how is it possible to add just the right spaces that are as big as the widht of the horizontal line.
Either way, I have not suceeded in making either of them work.
Thanks in advance.

  • 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-05-24T11:29:42+00:00Added an answer on May 24, 2026 at 11:29 am
    >>> foo = 'ABC'
    >>> head = ['-' * (len(foo)+6), '-%s-' % (' '*(len(foo)+4))]
    >>> print '\n'.join(head + ['-  %s  -' % foo] + head[::-1])
    ---------
    -       -
    -  ABC  -
    -       -
    ---------
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make a simple tabular data layout using a QTableView with a
I'm trying to make a simple C# web server that, at this stage, you
I'm trying to make some simple XML with Java and org.w3c.dom, but I got
I'm trying to make a simple drawing app in c++, but i'm having trouble
I am trying to make a simple redirector controller in CakePHP. I'd like the
I would like to make a layout like the one displayed on the this
I'm trying to make a simple blackjack program. Sadly, I'm having problems right off
I'm trying to make a simple php script to find all src attributes from
I am trying to make a simple script to automate and log synchronization via
I'm trying to make a simple HTTP post a endpoint with ONLY url arguments.

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.