Spaces:
Building
Building
Update app.py
Browse files
app.py
CHANGED
@@ -140,7 +140,7 @@ def create_interface():
|
|
140 |
choices=[
|
141 |
"URL",
|
142 |
"Email",
|
143 |
-
"Phone",
|
144 |
"SMS",
|
145 |
"WhatsApp",
|
146 |
"Location",
|
@@ -158,9 +158,11 @@ def create_interface():
|
|
158 |
lines=3
|
159 |
)
|
160 |
|
161 |
-
example_format = gr.
|
162 |
-
format_example_text("URL"),
|
163 |
-
label="Format Examples"
|
|
|
|
|
164 |
)
|
165 |
|
166 |
with gr.Row():
|
@@ -215,18 +217,17 @@ def create_interface():
|
|
215 |
label="Formatted Data",
|
216 |
interactive=False
|
217 |
)
|
218 |
-
|
219 |
-
# QR 타입 변경 시 예제 텍스트 업데이트
|
220 |
def update_example(qr_type):
|
221 |
-
return
|
222 |
|
|
|
223 |
qr_type.change(
|
224 |
fn=update_example,
|
225 |
inputs=[qr_type],
|
226 |
-
outputs=
|
227 |
)
|
228 |
|
229 |
-
# 이벤트 핸들러
|
230 |
generate_btn.click(
|
231 |
fn=create_qr,
|
232 |
inputs=[
|
@@ -258,9 +259,4 @@ def create_interface():
|
|
258 |
"""
|
259 |
)
|
260 |
|
261 |
-
return demo
|
262 |
-
|
263 |
-
# 메인 실행
|
264 |
-
if __name__ == "__main__":
|
265 |
-
demo = create_interface()
|
266 |
-
demo.launch(share=True)
|
|
|
140 |
choices=[
|
141 |
"URL",
|
142 |
"Email",
|
143 |
+
"Phone",
|
144 |
"SMS",
|
145 |
"WhatsApp",
|
146 |
"Location",
|
|
|
158 |
lines=3
|
159 |
)
|
160 |
|
161 |
+
example_format = gr.Textbox(
|
162 |
+
value=format_example_text("URL"),
|
163 |
+
label="Format Examples",
|
164 |
+
interactive=False,
|
165 |
+
lines=6
|
166 |
)
|
167 |
|
168 |
with gr.Row():
|
|
|
217 |
label="Formatted Data",
|
218 |
interactive=False
|
219 |
)
|
220 |
+
|
|
|
221 |
def update_example(qr_type):
|
222 |
+
return format_example_text(qr_type)
|
223 |
|
224 |
+
# 이벤트 핸들러
|
225 |
qr_type.change(
|
226 |
fn=update_example,
|
227 |
inputs=[qr_type],
|
228 |
+
outputs=example_format
|
229 |
)
|
230 |
|
|
|
231 |
generate_btn.click(
|
232 |
fn=create_qr,
|
233 |
inputs=[
|
|
|
259 |
"""
|
260 |
)
|
261 |
|
262 |
+
return demo
|
|
|
|
|
|
|
|
|
|