Sponsored Content
Full Discussion: Hello World!
The Lounge What is on Your Mind? Hello World! Post 302948158 by wisecracker on Friday 26th of June 2015 08:14:42 AM
Old 06-26-2015
OSX 10.7.5, deafult bash terminal running python...

Call as
Code:
Prompt:-> python hello_world.py

...
Code:
# HW.py
# Almost any version of standard text mode Python inside a terminal on Linux OS...
# IMPORTANT! The print() function MUST be a single line only so beware of wordwrapping, etc... etc...
# You may need to edit it if wordwrapping occurs...
# (C)2012, B.Walker, G0LCU...
#
# Edited on 02-04-2012 as per comment by S.D'Aprano.
#
# NOTE:- There is NO malicious intent in this code!!!
# I DO expect, however, that professionals _know_ how to manipulate Linux terminal colours through Python!

reset_term_colours="\033[0m"

f="\033[0;36;41m"
b="\033[0;31;46m"
lines=0

print(reset_term_colours)

for lines in range (0,50,1): print(b)

print(b+" "+f+" "+b+"   "+f+" "+b+"        "+f+" "+b+"     "+f+" "+b+"                "+f+" "+b+"   "+f+" "+b+"              "+f+" "+b+"        "+f+" "+b+"   "+f+" "+b+"\n "+f+" "+b+"   "+f+" "+b+"        "+f+" "+b+"     "+f+" "+b+"                "+f+" "+b+"   "+f+" "+b+"              "+f+" "+b+"        "+f+" "+b+"   "+f+" "+b+"\n "+f+" "+b+"   "+f+" "+b+"  "+f+"   "+b+"   "+f+" "+b+"     "+f+" "+b+"     "+f+"   "+b+"        "+f+" "+b+"   "+f+" "+b+"  "+f+"   "+b+"  "+f+" "+b+" "+f+"   "+b+"  "+f+" "+b+"     "+f+"    "+b+"   "+f+" "+b+"\n "+f+"     "+b+" "+f+" "+b+"   "+f+" "+b+"  "+f+" "+b+"     "+f+" "+b+"    "+f+" "+b+"   "+f+" "+b+"       "+f+" "+b+"   "+f+" "+b+" "+f+" "+b+"   "+f+" "+b+" "+f+"  "+b+"     "+f+" "+b+"    "+f+" "+b+"   "+f+" "+b+"   "+f+" "+b+"\n "+f+" "+b+"   "+f+" "+b+" "+f+"     "+b+"  "+f+" "+b+"     "+f+" "+b+"    "+f+" "+b+"   "+f+" "+b+"       "+f+" "+b+" "+f+" "+b+" "+f+" "+b+" "+f+" "+b+"   "+f+" "+b+" "+f+" "+b+"      "+f+" "+b+"    "+f+" "+b+"   "+f+" "+b+"   "+f+" "+b+"\n "+f+" "+b+"   "+f+" "+b+" "+f+" "+b+"      "+f+" "+b+"     "+f+" "+b+"    "+f+" "+b+"   "+f+" "+b+"       "+f+"  "+b+" "+f+"  "+b+" "+f+" "+b+"   "+f+" "+b+" "+f+" "+b+"      "+f+" "+b+"    "+f+" "+b+"   "+f+" "+b+"\n "+f+" "+b+"   "+f+" "+b+"  "+f+"    "+b+"   "+f+"   "+b+"   "+f+"   "+b+"  "+f+"   "+b+"        "+f+" "+b+"   "+f+" "+b+"  "+f+"   "+b+"  "+f+" "+b+"       "+f+"   "+b+"  "+f+"    "+b+"   "+f+" "+b+"\n\n\n\n\n Hello World!\n\n\n\n\033[0;30;46mPress Ctrl_C to Quit/Stop/Exit...")

print(reset_term_colours)

while 1: pass

Bazza...
Hello World!-hwjpg
 

7 More Discussions You Might Find Interesting

1. Solaris

hello world

just wanted to give salutations to all in here. i hope to contribute as much as i take. happy "unix-ing" :b: (0 Replies)
Discussion started by: JeepResQ
0 Replies

2. What is on Your Mind?

What The World Needs Now...

What does the world need now.... ??? Feel free to suggest new items to the poll .... we might add them :) (25 Replies)
Discussion started by: Neo
25 Replies

3. UNIX for Dummies Questions & Answers

What in the world does $$ mean?

If I type "echo $$" in to the command line it outputs some random number but it outputs the same one every time. What is this? (7 Replies)
Discussion started by: weexpectedthis
7 Replies

4. Programming

Almost -> Hello World!

Hello! I know I must take the efforts of learning C..! I need to recompile a binary with the following at the beginning: test if a file exists, remove it and exit. All in "C". As simple as this in sh: file=/tmp/filename if ; then rm -f $file exit 0 fi Thanks! (8 Replies)
Discussion started by: teresaejunior
8 Replies

5. What is on Your Mind?

How Will the World End?

How will the world end (someday long into the future, we hope)? (68 Replies)
Discussion started by: Neo
68 Replies

6. Programming

Exact meaning of the "world" in "hello world"

Hello! I have a question to native English-speaking people. In the popular program's "hello world" greeting, what meaning the "world" has: "all", "everybody", "people", "friends" or "whole world", "planet", "Earth", "Universe"? In other words, to whom this greeting is addressed: to the... (14 Replies)
Discussion started by: Eugene Muzychen
14 Replies

7. What is on Your Mind?

Mad World Remix of Moby Video (Are You Lost In The World Like Me)

This is an excellent video comment on modern society and the remix is good too: https://www.youtube.com/watch?v=5DU1B_XkyIk 5DU1B_XkyIk Watch the video above and post your comments. (3 Replies)
Discussion started by: Neo
3 Replies
All times are GMT -4. The time now is 05:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy