473,396 Members | 1,898 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Simple Videogame Console Class Conversion from Java

Hey, i was just wondering does anyone have any idea how to put this code (its in java) into python? i changed parts of it but i dont really know how...thank youuu!!! :D

Expand|Select|Wrap|Line Numbers
  1. class Console:
  2.     def _init_ (self):
  3.         self.inputLine = ""
  4.     def getInput (self):
  5.         print "> "
  6.         self.reader = BufferedReader(new InputStreamReader(System.in))
  7.         try:
  8.             inputLine = reader.readLine()
  9.         except IOError:
  10.             System.out.println ("There was an error during reading: " + exc.getMessage())
  11.         return inputLine.toLowerCase()
  12.     def clear (self):
  13.         print "\f"
  14.     def showOutput (self, s):
  15.         print s
  16.  
May 16 '10 #1
0 888

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Alvaro G. Vicario | last post by:
Before writing it myself (str_replace, preg_replace and a keyword list updated as I find them?) I'd like to know whether there's already a simple syntax highlighting class or script I can use to...
0
by: nick | last post by:
i have downloaded the "web server size" class from the phpclasses.com to know the size of web page. i want to use this class in my java application. how do i call the PHP method from the...
19
by: Dave | last post by:
Hi, I have done some research, trying to Clear The Screen in java code. The first option was the obv: system.out.print("\n\n\n\n\n\n\n\n\n\n\n\n"); then i heard about this method:...
5
by: Ayesha Ahsan | last post by:
Hi, I use Runtime.getRuntime().exec(command) to make my system call. For Windows based Dos, i add "cmd /c" before I type in my system call. So for example make the system call "dir": String...
19
by: gaudetteje | last post by:
I've been searching high and low for a way to simply convert a small XML configuration file to Python data structures. I came across gnosis XML tools, but need a built-in option for doing...
1
by: mef526 | last post by:
How can I set the Cursor (that is, the caret) attributes and location in the Console class?
4
by: John Cho | last post by:
Class Cartesian { double x; double y; public: Cartesian( ) { x = 0.0 ; y = 0.0;} Cartesian(double x1, double y1) { x = x1; y = y1;} }; class Polar { double radius;
2
by: _R | last post by:
I've got a few apps that were designed to be used via MSDOS window. They make use of the old-style VC++6 Console class for doing writes, cursor repositioning, scrolling, etc. (Unfortunate name...
1
by: skchonghk | last post by:
Dear all smart experts, I write a simple Java UDF, which should run on DB2 v8 on AIX. But it can't load the Java class. Help ugently needed!! Thanks! I develop and deploy the Java UDF with...
1
by: DaveP | last post by:
is there a method of console class where i can be in a loop and just read keys pressed example while true { somekey=somemethod() // does not wait for enter key just continues if...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.