File size: 1,104 Bytes
41316b3
 
34127be
41316b3
 
34127be
41316b3
34127be
 
 
 
 
 
41316b3
 
 
 
 
 
 
34127be
 
41316b3
34127be
41316b3
34127be
41316b3
96a1b50
 
34127be
 
 
41316b3
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import gradio as gr

def repeat_emoji(emoji, count, new_line):
    try:
        count = int(count)
        if count < 1:
            return "Please enter a number greater than 0."
        if new_line:
            # Repeat emoji separated by newline
            return (emoji + "\n") * count
        else:
            # Repeat emoji continuously
            return emoji * count
    except:
        return "Please enter a valid number."

app = gr.Interface(
    fn=repeat_emoji,
    inputs=[
        gr.Textbox(label="Emoji", placeholder="e.g., πŸ’€"),
        gr.Number(label="How many times?", value=10, precision=0),
        gr.Checkbox(label="New Line?", info="Put each emoji on a new line")
    ],
    outputs=gr.Textbox(label="Copy Duplicated Emoji", lines=10),
    title="πŸŒ€ Emoji Duplicator",
    description="Enter any emoji and choose how many times to duplicate it! Choose if you want each emoji on a new line.",
    examples=[
        ["πŸ’€", 5, True],
        ["πŸ˜‚", 12, False],
        ["🌈", 20, False],
        ["🐢", 8, True],
        ["πŸ’–", 15, False],
    ],
)

app.launch()