# Code displays during startup

**URL:** <https://forum.anaconda.com/t/code-displays-during-startup/49723>\
**Category:** PyScript\
**Created:** [January 27, 2023, 1:18pm UTC](https://forum.anaconda.com/t/code-displays-during-startup/49723 "2023-01-27T13:18:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mark.d.lattimore](https://dub1.discourse-cdn.com/anaconda/user_avatar/forum.anaconda.com/mark.d.lattimore/32/1854_2.png) [@mark.d.lattimore](https://forum.anaconda.com/u/mark.d.lattimore)\
**Post date:** [January 27, 2023, 1:18pm UTC](https://forum.anaconda.com/t/code-displays-during-startup/49723/1 "2023-01-27T13:18:15Z")

</div>

Forgive me if this has been covered already, but I couldn’t find this exact issue, either because it’s not there or my search abilities are lacking. In any event, whenever I load a page, the code in the `<py-script>` tag displays on screen while pyodide is downloading (which, by the way, seems to download on every refresh). Here’s an example:

 ![Screenshot 2023-01-27 at 8.10.25 AM](https://europe1.discourse-cdn.com/anaconda/original/2X/a/a2544c23b0e041b504f6ae25107406b9e837a874.jpeg)

Here’s the HTML. What am I missing?

```auto
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Shakespearean Insults!</title>
        <!-- PyScript import -->
        <script defer src="https://pyscript.net/latest/pyscript.js"></script>
        <style>
            h1 {
                text-align: center;
            }
        </style>
    </head>

    <body>
      
        <br><br><br><br><br>
        <h1 id="main"></h1>
        
<py-script>

import random

adjectives = """bankrupt base caterwauling corrupt cullionly detestable dishonest false filthsome filthy foolish foul gross heedless indistinguishable infected insatiate irksome lascivious lecherous loathsome lubbery old peevish rascaly rotten ruinous scurilous scurvy slanderous sodden-witted thin-faced toad-spotted unmannered vile wall-eyed""".split()

nouns = """Judas Satan ape ass barbermonger beggar block boy braggart butt carbuncle coward coxcomb cur dandy degenerate fiend fishmonger fool gull harpy jack jolthead knave liar lunatic maw milksop minion ratcatcher recreant rogue scold slave swine traitor varlet villain worm""".split()

adj = ", ".join(random.choices(adjectives, k=2))
noun = random.choice(nouns)

display = f"You {adj} {noun}!"
Element("main").write(display)

</py-script>

    </body>
    
</html>

```

---

<div class="post-metadata">

**Author:** ![JeffGlass](https://dub1.discourse-cdn.com/anaconda/user_avatar/forum.anaconda.com/jeffglass/32/1301_2.png) [@JeffGlass](https://forum.anaconda.com/u/JeffGlass)\
**Post date:** [January 27, 2023, 4:20pm UTC](https://forum.anaconda.com/t/code-displays-during-startup/49723/2 "2023-01-27T16:20:42Z")

</div>

You may wish to use some CSS to hide the contents of the \<py-script\> tag until PyScript is loaded. The PyScript distribution actually includes some CSS for this purpose, which also includes some styling the \<py-repl\>.

For the `latest` release, for example that CSS can be included via:

```auto
<link rel="stylesheet" href="https://pyscript.net/latest/pyscript.css" />

```

Or for versioned releases:

```auto
<link rel="stylesheet" href="https://pyscript.net/releases/2022.12.1/pyscript.css" />

```

---

<div class="post-metadata">

**Author:** ![FabioRosado](https://dub1.discourse-cdn.com/anaconda/user_avatar/forum.anaconda.com/fabiorosado/32/2243_2.png) [@FabioRosado](https://forum.anaconda.com/u/FabioRosado)\
**Post date:** [February 13, 2023, 1:15pm UTC](https://forum.anaconda.com/t/code-displays-during-startup/49723/3 "2023-02-13T13:15:55Z")

</div>

As Jeff mentioned, you can include Pyscript’s CSS in your page to hide them, if you prefer not to include it, you can add the following to your own CSS file (this was taken from Pyscript’s CSS)

```css
/* py-config - not a component */
py-config {
  display: none
}

/* py-{el} - components not defined */
py-script:not(:defined) {
  display: none
}

py-repl:not(:defined) {
  display: none
}

```

This will always hide your `py-config` tags and will hide the code under the py-script or py-repl until these elements are created (which will be once PyScript is loaded).

Hope this helps 😄

---

<div class="post-metadata">

**Author:** ![mark.d.lattimore](https://dub1.discourse-cdn.com/anaconda/user_avatar/forum.anaconda.com/mark.d.lattimore/32/1854_2.png) [@mark.d.lattimore](https://forum.anaconda.com/u/mark.d.lattimore)\
**Post date:** [February 13, 2023, 3:34pm UTC](https://forum.anaconda.com/t/code-displays-during-startup/49723/4 "2023-02-13T15:34:16Z")

</div>

Many thanks to both of you!
