<commit_before>

==== Rapicorn Hello World ====

The simple Python program [[pyhello.py]] displays the famous
greeting by popping up a Rapicorn Window.
Tutorial contents are provided "as is" but WITHOUT ANY WARRANTY;
for details see: http://rapicorn.org/LICENSE-AS-IS

We recommend literally pasting the source code into a Pyhton editor
for better readability.

What's needed for every window to be displayed is a widget tree that
defines the window contents. Rapicorn allows XML notation to define
its widget trees. The widgets and assorted properties are designed to
be easily used from within XML notation.
For a start, we'll store the widget tree as a Python string:

	"""
	Rapicorn Hello World Example
	"""
	# Define hello-window Widget Tree
	hello_window_widgets = """
	<def:hello-window inherit="Root">
	  <Label markup-text="Hello World!" />
	</def:hello-window>
	"""

Rapicorn is provided as a versioned Python module that's best imported
into the Rapicorn namespace. This way, Python scripts can be deliberately
updated to new Rapicorn versions by changing just the import lines.
The Rapicorn toolkit first needs to be initialized, connect to the X11
server, read reasource files, etc.
The simplest form just takes a unique application name that is used for
theming and to store associated configuration data.
Once initialized, we need to load the widget tree definition for later use:

	# Import versioned Rapicorn module
	import Rapicorn1002 as Rapicorn
	# Initialize Rapicorn applicaiton with unique name
	app = Rapicorn.init ("Hello-World")
	# Load widget tree into Rapicorn
	app.load_string (hello_window_widgets)

We've got Rapicorn up and running at this point. To display our window,
we need to create it and show it on screen. To draw the window contents
and generally handle window events like resizing, we'll enter the main
loop, that'll by default last as long as the window exists.

	# Create and show hello-window
	window = app.create_window ("hello-window")
	window.show()
	# Run main loop to process window events<commit_msg>DOCS: fixed pyhello initialization code<commit_after>

==== Rapicorn Hello World ====

The simple Python program [[pyhello.py]] displays the famous
greeting by popping up a Rapicorn Window.
Tutorial contents are provided "as is" but WITHOUT ANY WARRANTY;
for details see: http://rapicorn.org/LICENSE-AS-IS

We recommend literally pasting the source code into a Pyhton editor
for better readability.

What's needed for every window to be displayed is a widget tree that
defines the window contents. Rapicorn allows XML notation to define
its widget trees. The widgets and assorted properties are designed to
be easily used from within XML notation.
For a start, we'll store the widget tree as a Python string:

	"""
	Rapicorn Hello World Example
	"""
	# Define hello-window Widget Tree
	hello_window_widgets = """
	<def:hello-window inherit="Root">
	  <Label markup-text="Hello World!" />
	</def:hello-window>
	"""

Rapicorn is provided as a versioned Python module that's best imported
into the Rapicorn namespace. This way, Python scripts can be deliberately
updated to new Rapicorn versions by changing just the import lines.
The Rapicorn toolkit first needs to be initialized, connect to the X11
server, read reasource files, etc.
The simplest form just takes a unique application name that is used for
theming and to store associated configuration data.
Once initialized, we need to load the widget tree definition for later use:

	# Import versioned Rapicorn module
	import Rapicorn1002 as Rapicorn
	# Initialize Rapicorn application with unique name
	app = Rapicorn.app_init ("Hello-World")
	# Load widget tree into Rapicorn
	app.load_string (hello_window_widgets)

We've got Rapicorn up and running at this point. To display our window,
we need to create it and show it on screen. To draw the window contents
and generally handle window events like resizing, we'll enter the main
loop, that'll by default last as long as the window exists.

	# Create and show hello-window
	window = app.create_window ("hello-window")
	window.show()
	# Run main loop to process window events
{'fraction_non_alphanumeric': 0.05687318489835431, 'fraction_numerical': 0.002904162633107454, 'mean_word_length': 4.638472032742156, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4593421', 'n_tokens_mistral': 1124, 'n_tokens_neox': 1049, 'n_words': 577}