'Adding a space between Python Kivy app title words

I want to add a space between my Kivy app title. For example,

import kivy
from kivy.app import App

class CBT_App(App):
    def build(self):
        return kv_file

I want to replace the underscore(_) between the "CBT" and the "App" with space to get the "CBT App" when I run the code.

I don't want to get this:

CBT_App

I have tried to put a backslash but it doesn't work(I expected it). Please I need help 😓 😓



Solution 1:[1]

This happens as the iteration is not working as intended. There are two issues. Let's take a closer look with added comments in code:

# Iterate all members of $MailboxesLarge1 collection
# On each iteration, $i will contain an object
Foreach ($i in $MailboxesLarge1) {
    # Add new element to $OutputLarge1
    $OutputLarge1 += [PSCustomObject] @{

        # DisplayName property will get a value of the whole collection
        # instead of iterated item $i
        DisplayName          = $MailboxesLarge1.DisplayName

        Alias                = $MailboxesLarge1.Alias
        PrincipalName        = $MailboxesLarge1.UserPrincipalName
        PrimarySmtpAddress   = $MailboxesLarge1.PrimarySmtpAddress
        DeletedItemCount     = $StatisticsLarge1.DeletedItemCount
        ItemCount            = $StatisticsLarge1.ItemCount
    }
}

The first issue.

So what happens is that for every item $i you accidentally assign the whole collection's worth of items to the output object.

Fixing is easy enough, refer to the iterator object within the loop.

The second issue is that statistics are in another a collection, and those are being accessed with the same mistake. But there's more: there is no link between the result sets. I don't have Exchange at hand, but am pretty sure there is no guarantee that the result sets are ordered. To keep the resultset the same, save the mailboxes in a variable and pass that around. Like so,

$boxes = Get-EXOmailbox -ResultSize 5 

$MailboxesLarge1  = $boxes|Select DisplayName,Alias,UserPrincipalName,PrimarySmtpAddress 
$StatisticsLarge1 = $boxes|Get-EXOmailboxstatistics |Select  Displayname,DeletedItemCount,ItemCount

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 vonPryz