|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
||||
|
||||
|
static part of the program
Is it possible for me to make something "static" in a Python script? I.e. I would like to include a menu for my script always on the top of the screen:
Code:
[ M E N U ] ------------------------ | the place where | the script execu- | tes Is this possible? Thank you very much, and sorry if this has been answered before! |
|
#2
|
||||
|
||||
|
Is this a client side application or an internet application? Because I do not understand what you are trying to accomplish.
|
|
#3
|
||||
|
||||
|
Quote:
It's a command line program, a telephone book. I'm trying to accomplish to have something like a header and a footer which wouldn't move as the script executes. |
|
#4
|
|||
|
|||
|
Code:
def print_header():
print """
[ M E N U ]
------------------------
| the place where
| the script execu-
| tes"""
def print_footer():
print """
Blah blah, footer string.
Thanks for running print_footer()"""
![]() |
|
#5
|
||||
|
||||
|
Strike, I don't think that would be the solution... I want the MENU part (in which I'd have the options: Add, Delete, Search, List, etc.) to ALWAYS be visible, no matter what.
How can I accomplish that? |
|
#6
|
|||
|
|||
|
Quote:
Well, you either loop and print it every time, or you use a library like ncurses for console drawing. The former is easier for small things, but the latter is probably the technically "more correct" solution. |
|
#7
|
||||
|
||||
|
Quote:
Yeah, but I need something for Windows... As I can see, the ncurses library doesn't work with win... |
|
#8
|
|||
|
|||
|
Well, supposedly the simpler "curses" (not ncurses) library has a Windows version. But, Windows + console programming = not a great mix, in general.
|
|
#9
|
||||
|
||||
|
Quote:
Great... any other ideas? (except installing Linux? ). |
|
#10
|
|||
|
|||
|
Quote:
What's wrong with that one? ![]() Well, I said a few posts up that if you just had one main cycle, that you could just print the menu any time you made any modifications to the screen. It'd be sorta like graphics programming, you could have a "display" pseudo-callback that would always print the menu first and then whatever stuff is supposed to go after it .. after the menu. |
|
#11
|
||||
|
||||
|
Quote:
I'll try that one... Thank you for your help! |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > static part of the program |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|