ffreemt commited on
Commit
6f82744
1 Parent(s): 927848d

Update app.py

Browse files
Files changed (3) hide show
  1. app.py +9 -6
  2. requirements.txt +4 -2
  3. run-python-app_py.bat +2 -1
app.py CHANGED
@@ -39,10 +39,10 @@ def process(command) -> Tuple[str, Optional[str]]:
39
  command = str(command).strip()
40
  except Exception as e:
41
  _ = str(e)
42
- return _, None
43
 
44
  if not command:
45
- return "gimme something to start with...", None
46
 
47
  try:
48
  # out = sp.check_output(split(command), encoding="utf8", stderr=STDOUT)
@@ -51,12 +51,12 @@ def process(command) -> Tuple[str, Optional[str]]:
51
  ) # sp.PIPE: -1
52
  out, err = proc.communicate()
53
  # success = True
54
- return f"[{out}], [{err}]", None
55
  except Exception as e:
56
  out, err = "", str(e)
57
  # success = False
58
  # return f"[{out}]", f"[{err}]"
59
- return f"[{out}], [{err}]", None
60
 
61
 
62
  def process1(command) -> Tuple[str, Optional[str]]:
@@ -160,7 +160,8 @@ iface = gr.Interface(
160
  fn=process,
161
  # inputs="text",
162
  inputs=gr.inputs.Textbox(
163
- lines=5,
 
164
  placeholder="Type or paste input here then click 'Submit'",
165
  default="python -V # show version",
166
  label="command or multiline text",
@@ -171,7 +172,7 @@ iface = gr.Interface(
171
  outputs=[
172
  "text",
173
  # gr.outputs.Image("auto"),
174
- gr.outputs.Image('pil'),
175
  ],
176
  examples=[
177
  "python -m site",
@@ -187,6 +188,8 @@ iface = gr.Interface(
187
  title="probe the system",
188
  description="Talk to the system via subprocess.check_output ",
189
  # layout="vertical",
 
 
190
  )
191
 
192
  # iface.launch(share=True, debug=True)
39
  command = str(command).strip()
40
  except Exception as e:
41
  _ = str(e)
42
+ return _
43
 
44
  if not command:
45
+ return "gimme something to start with..."
46
 
47
  try:
48
  # out = sp.check_output(split(command), encoding="utf8", stderr=STDOUT)
51
  ) # sp.PIPE: -1
52
  out, err = proc.communicate()
53
  # success = True
54
+ return f"[{out}], [{err}]"
55
  except Exception as e:
56
  out, err = "", str(e)
57
  # success = False
58
  # return f"[{out}]", f"[{err}]"
59
+ return f"[{out}], [{err}]"
60
 
61
 
62
  def process1(command) -> Tuple[str, Optional[str]]:
160
  fn=process,
161
  # inputs="text",
162
  inputs=gr.inputs.Textbox(
163
+ # inputs=gr.components.Textbox(
164
+ lines=1,
165
  placeholder="Type or paste input here then click 'Submit'",
166
  default="python -V # show version",
167
  label="command or multiline text",
172
  outputs=[
173
  "text",
174
  # gr.outputs.Image("auto"),
175
+ # gr.outputs.Image('pil'),
176
  ],
177
  examples=[
178
  "python -m site",
188
  title="probe the system",
189
  description="Talk to the system via subprocess.check_output ",
190
  # layout="vertical",
191
+ # allow_flagging="manual",
192
+ allow_flagging="never",
193
  )
194
 
195
  # iface.launch(share=True, debug=True)
requirements.txt CHANGED
@@ -2,5 +2,7 @@ gradio
2
  # anyio, uc-micro-py, multidict, mdurl, httpcore, frozenlist, yarl, websockets, starlette, markdown-it-py, linkify-it-py, httpx, fsspec, async-timeout, aiosignal, uvicorn, semantic-version, python-multipart, pydub, orjson, mdit-py-plugins, gradio-client, ffmpy, fastapi, aiohttp, aiofiles, gradio 3.27.0
3
 
4
  typing_extensions
5
- polyglot
6
- logzero
 
 
2
  # anyio, uc-micro-py, multidict, mdurl, httpcore, frozenlist, yarl, websockets, starlette, markdown-it-py, linkify-it-py, httpx, fsspec, async-timeout, aiosignal, uvicorn, semantic-version, python-multipart, pydub, orjson, mdit-py-plugins, gradio-client, ffmpy, fastapi, aiohttp, aiofiles, gradio 3.27.0
3
 
4
  typing_extensions
5
+ # polyglot
6
+ logzero
7
+ pandas
8
+ seaborn
run-python-app_py.bat CHANGED
@@ -1,3 +1,4 @@
1
  REM nodemon -w app.py -x .venv\Scripts\python app.py
2
  REM nodemon -w app.py -x py -3.7 app.py
3
- nodemon -w app.py -x "pyright app.py && py -3.8 app.py"
 
1
  REM nodemon -w app.py -x .venv\Scripts\python app.py
2
  REM nodemon -w app.py -x py -3.7 app.py
3
+ REM nodemon -w app.py -x "pyright app.py && py -3.8 app.py"
4
+ nodemon -w app.py -x "pyright app.py && python app.py"