Skip to content

Commit

Permalink
fix: linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
adriangalilea committed Sep 2, 2024
1 parent 01845aa commit acf772d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions example.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import streamlit as st
from src.streamlit_shortcuts.streamlit_shortcuts import button, add_keyboard_shortcuts


def main():
st.title("Streamlit Shortcuts Example")

# Example 1: Simple button with shortcut
if button("Click me!", "ctrl+shift+c", lambda: st.success("Button clicked!"), hint=True):
if button(
"Click me!", "ctrl+shift+c", lambda: st.success("Button clicked!"), hint=True
):
st.write("Button was clicked")

# Example 2: Multiple shortcuts
add_keyboard_shortcuts({
"ctrl+shift+s": "Save",
"ctrl+shift+o": "Open"
})
add_keyboard_shortcuts({"ctrl+shift+s": "Save", "ctrl+shift+o": "Open"})

if st.button("Save"):
st.success("Saved! (You can also press Ctrl+Shift+S)")
Expand All @@ -28,5 +28,6 @@ def greet(name):

st.write("Try using the keyboard shortcuts!")


if __name__ == "__main__":
main()

0 comments on commit acf772d

Please sign in to comment.