The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> Python Programming
|
static part of the program
Discuss static part of the program in the Python Programming forum on Dev Shed. static part of the program Python Programming forum discussing coding techniques, tips and tricks, and Zope related information. Python was designed from the ground up to be a completely object-oriented programming language.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

December 6th, 2002, 02:26 PM
|
 |
Will develop for food.
|
|
Join Date: Jul 2002
Location: Croatia
Posts: 14
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
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!
|

December 7th, 2002, 09:29 PM
|
 |
chown python:users\ /world
|
|
Join Date: Jul 2000
Location: Texas Tech
Posts: 95
Time spent in forums: < 1 sec
Reputation Power: 13
|
|
|
Is this a client side application or an internet application? Because I do not understand what you are trying to accomplish.
|

December 8th, 2002, 04:55 AM
|
 |
Will develop for food.
|
|
Join Date: Jul 2002
Location: Croatia
Posts: 14
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
Quote: Originally posted by Hartmann
Is this a client side application or an internet application? Because I do not understand what you are trying to accomplish. |
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.
|

December 8th, 2002, 05:06 AM
|
|
Contributing User
|
|
Join Date: Dec 2001
Location: Houston, TX
Posts: 383
Time spent in forums: 1 h 41 m 27 sec
Reputation Power: 12
|
|
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()"""

|

December 8th, 2002, 05:28 AM
|
 |
Will develop for food.
|
|
Join Date: Jul 2002
Location: Croatia
Posts: 14
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
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?
|

December 8th, 2002, 07:50 PM
|
|
Contributing User
|
|
Join Date: Dec 2001
Location: Houston, TX
Posts: 383
Time spent in forums: 1 h 41 m 27 sec
Reputation Power: 12
|
|
Quote: Originally posted by zweistein
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? |
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.
|

December 13th, 2002, 08:53 AM
|
 |
Will develop for food.
|
|
Join Date: Jul 2002
Location: Croatia
Posts: 14
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
Quote: Originally posted by Strike
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. |
Yeah, but I need something for Windows... As I can see, the ncurses library doesn't work with win...
|

December 13th, 2002, 10:58 AM
|
|
Contributing User
|
|
Join Date: Dec 2001
Location: Houston, TX
Posts: 383
Time spent in forums: 1 h 41 m 27 sec
Reputation Power: 12
|
|
|
Well, supposedly the simpler "curses" (not ncurses) library has a Windows version. But, Windows + console programming = not a great mix, in general.
|

December 13th, 2002, 12:35 PM
|
 |
Will develop for food.
|
|
Join Date: Jul 2002
Location: Croatia
Posts: 14
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
Quote: Originally posted by Strike
Well, supposedly the simpler "curses" (not ncurses) library has a Windows version. But, Windows + console programming = not a great mix, in general. |
Great... any other ideas? (except installing Linux?  ).
|

December 13th, 2002, 12:52 PM
|
|
Contributing User
|
|
Join Date: Dec 2001
Location: Houston, TX
Posts: 383
Time spent in forums: 1 h 41 m 27 sec
Reputation Power: 12
|
|
Quote: Originally posted by zweistein
Great... any other ideas? (except installing Linux? ). |
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.
|

December 13th, 2002, 12:59 PM
|
 |
Will develop for food.
|
|
Join Date: Jul 2002
Location: Croatia
Posts: 14
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
Quote: Originally posted by Strike
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. |
I'll try that one... Thank you for your help!
|

December 14th, 2002, 09:23 AM
|
 |
Will develop for food.
|
|
Join Date: Jul 2002
Location: Croatia
Posts: 14
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
Hello.
I found this which works as a replacement for the curses library in Windows.
Thanks and cya!
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|