Python Forum
looking 4 py code: output file in a text box
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
looking 4 py code: output file in a text box
#1
i am wanting a command to output one (small) file in a text box, much like those relational db tools often do.

edit 1:
it would be a plus to put the file name somewhere reasonable in the output.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#2
See Linux 'fmt' and 'fold' commands
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#3
i mean something like:
Output:
+--------------+ | this is text | | in a little  | | box          | +--------------+
and i am wanting to do it in python.

this one should be a module function and command in one file.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#4
curses?
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#5
i still want it in py.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#6
There is curses for python. It will be in .py file
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#7
if you're using linux, you might also try Urwid or npyscreen
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply
#8
i went ahead an wrote my own version of it.

it is not thoroughly tested but seems to work ok.

Output:
lt1/forums /home/forums 48> python box.py box.txt wide.txt | python box.py +---<STDIN>-----------------+ | +--------------+          | | | this is text |          | | | in a little  |          | | | box          |          | | +--------------+          | | +---<wide.txt>----------+ | | | this is text          | | | | in a definitely wider | | | | box                   | | | +-----------------------+ | +---------------------------+ lt1/forums /home/forums 49>
the code is over here.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020