# static 'banner' for zork like game

This topic is 1430 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

hello,

i'm currently making a text based game like zork using python 3 with pycharm IDE.

I am wondering how I can make a static banner at the top of the console that always remains while the user enters commands etc at the bottom.

if you don't know what I mean, here is the zork game:

I want to make what they have at the very top, with location, score and moves. Also, how can I highlight the text in grey like that?

Jonathan

##### Share on other sites

You should be able to do all that with Curses for Python.

##### Share on other sites

thanks LennyLen

However i've come up against an unusual error already, the tutorial states that

curses.initscr() must be called first.

So I do this with

stdscr = curses.initscr()

but my pyCharm compile output gives this error "Redirection is not supported."

i've googled this problem but there seems to be only 1 result, for which that person also didn't get an answer... I don't suppose you know at all?

##### Share on other sites

hmm after checking google further it seems curses in general doesn't support windows and errors can occur often and that I should download a windows designed curses module instead.

i'll guess i'll look into that!

EDIT: although it seems they are all outdated and not workable for python 3.

Looks like curses is a luxury for Linux users and the like. Is there no other way such a thing as at the top of the Zork game can be done without it?

Edited by JonathanCCC

##### Share on other sites

Looks like curses is a luxury for Linux users and the like. Is there no other way such a thing as at the top of the Zork game can be done without it?

You can do manually all the stuff curses would do for you - but it's not for the faint of heart.

You can get most of the way there by learning the escape codes for your terminal (for Windows, you'll need something like ansicon).

##### Share on other sites

thanks swiftcoder

actually so far I don't need a module for the simple thing I wanted to do, which was create something "static" at the top of the console.

i've so far achieved it by simply clearing the screen in python, writing the "banner" then printing several blank new lines before any input or output :) example:

os.system('cls')

print("Whatever banner you want")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
print("")
input("enter a command: ")

of course this is a very crude way of doing it and who knows how many blank lines need to be used for all users (probably impossible to know) - as an ultra beginner I know of no other way though

but at least you get a simple static line above any commands or output. I thought my request was too simplistic to warrant any modules!