SunQuest
           Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old December 6th, 2002, 02:26 PM
zweistein's Avatar
zweistein zweistein is offline
Will develop for food.
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Croatia
Posts: 14 zweistein User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to zweistein
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!

Reply With Quote
  #2  
Old December 7th, 2002, 09:29 PM
Hartmann's Avatar
Hartmann Hartmann is offline
chown python:users\ /world
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Location: Texas Tech
Posts: 95 Hartmann User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Is this a client side application or an internet application? Because I do not understand what you are trying to accomplish.
__________________
Hartmann
badice.com

Reply With Quote
  #3  
Old December 8th, 2002, 04:55 AM
zweistein's Avatar
zweistein zweistein is offline
Will develop for food.
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Croatia
Posts: 14 zweistein User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to zweistein
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.

Reply With Quote
  #4  
Old December 8th, 2002, 05:06 AM
Strike Strike is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Location: Houston, TX
Posts: 383 Strike User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 41 m 27 sec
Reputation Power: 7
Send a message via ICQ to Strike Send a message via AIM to Strike Send a message via Yahoo to Strike
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()"""

__________________
Debian - because life's too short for worrying.
Best. (Python.) IRC bot. ever.

Reply With Quote
  #5  
Old December 8th, 2002, 05:28 AM
zweistein's Avatar
zweistein zweistein is offline
Will develop for food.
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Croatia
Posts: 14 zweistein User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to 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?

Reply With Quote
  #6  
Old December 8th, 2002, 07:50 PM
Strike Strike is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Location: Houston, TX
Posts: 383 Strike User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 41 m 27 sec
Reputation Power: 7
Send a message via ICQ to Strike Send a message via AIM to Strike Send a message via Yahoo to Strike
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.

Reply With Quote
  #7  
Old December 13th, 2002, 08:53 AM
zweistein's Avatar
zweistein zweistein is offline
Will develop for food.
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Croatia
Posts: 14 zweistein User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to zweistein
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...

Reply With Quote
  #8  
Old December 13th, 2002, 10:58 AM
Strike Strike is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Location: Houston, TX
Posts: 383 Strike User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 41 m 27 sec
Reputation Power: 7
Send a message via ICQ to Strike Send a message via AIM to Strike Send a message via Yahoo to Strike
Well, supposedly the simpler "curses" (not ncurses) library has a Windows version. But, Windows + console programming = not a great mix, in general.

Reply With Quote
  #9  
Old December 13th, 2002, 12:35 PM
zweistein's Avatar
zweistein zweistein is offline
Will develop for food.
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Croatia
Posts: 14 zweistein User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to zweistein
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? ).

Reply With Quote
  #10  
Old December 13th, 2002, 12:52 PM
Strike Strike is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Location: Houston, TX
Posts: 383 Strike User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 41 m 27 sec
Reputation Power: 7
Send a message via ICQ to Strike Send a message via AIM to Strike Send a message via Yahoo to Strike
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.

Reply With Quote
  #11  
Old December 13th, 2002, 12:59 PM
zweistein's Avatar
zweistein zweistein is offline
Will develop for food.
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Croatia
Posts: 14 zweistein User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to zweistein
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!

Reply With Quote
  #12  
Old December 14th, 2002, 09:23 AM
zweistein's Avatar
zweistein zweistein is offline
Will develop for food.
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Croatia
Posts: 14 zweistein User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to zweistein
Hello.

I found this which works as a replacement for the curses library in Windows.

Thanks and cya!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > static part of the program


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support |