aliicemill commited on
Commit
4b2eabe
·
verified ·
1 Parent(s): c7f7838

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +42 -27
app.py CHANGED
@@ -4,6 +4,20 @@ import numpy as np
4
  import matplotlib.pyplot as plt
5
  from io import BytesIO
6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  # Başlık
8
  st.title("Note Analyzer Streamlit Uygulaması")
9
 
@@ -14,41 +28,42 @@ if "analysis_started" not in st.session_state:
14
  # "Uygulamanın Çalışma Prensibi" sadece analiz başlamadan önce gösterilir
15
  if not st.session_state.analysis_started:
16
  st.subheader("Uygulamanın Çalışma Prensibi")
17
-
18
  # Resimlerin dosya isimlerini sırayla listele
19
  image_files = ["a.png", "b.png", "c.png", "d.png", "e.png", "f.png", "g.png"]
20
-
21
  # Resimleri alt alta ekle
22
  for image_file in image_files:
23
  st.image(image_file, use_container_width=True)
24
 
25
- # Kullanıcıdan veri alma (Expander içinde sabit giriş alanları)
26
- with st.expander("Girdi Alanları", expanded=True):
27
- # Dosya yükleme veya metin girişi seçimi
28
- input_method = st.radio(
29
- "Notları nasıl gireceksiniz?",
30
- options=["Dosya Yükle", "Kopyala-Yapıştır"]
31
- )
32
-
33
- uploaded_file = None
34
- text_input = None
35
-
36
- if input_method == "Dosya Yükle":
37
- uploaded_file = st.file_uploader("Notlar Dosyasını Yükleyin (TXT)", type=["txt"])
38
- elif input_method == "Kopyala-Yapıştır":
39
- text_input = st.text_area("Notları Yapıştırın", height=200)
40
-
41
- # Diğer parametreler
42
- lecture_name = st.text_input("Ders Adı", value="Ders Adı")
43
- perfect_score = st.number_input("Sınav Puanı Üst Limiti", value=100, step=1)
44
- my_note = st.number_input("Benim Notum", value=0.0, step=0.1)
45
- note_s_axis_diff = st.number_input("Notlar X Ekseni Ortak Farkı", value=5, step=1)
46
- amount_s_axis_diff = st.number_input("Miktar Y Ekseni Ortak Farkı", value=1, step=1)
47
- first_step = st.number_input("İlk Adım", value=0, step=1)
48
- increase_amount = st.number_input("Artış Miktarı", value=1, step=1)
 
49
 
50
  # Analiz butonuna basıldığında durum değişkenini True yapar ve çıktıları gösterir
51
- if st.button("Analizi Çalıştır"):
52
  st.session_state.analysis_started = True
53
 
54
  if input_method == "Dosya Yükle" and uploaded_file is None:
 
4
  import matplotlib.pyplot as plt
5
  from io import BytesIO
6
 
7
+ # CSS ile sidebar'ı sabitle
8
+ st.markdown(
9
+ """
10
+ <style>
11
+ [data-testid="stSidebar"] {
12
+ position: fixed;
13
+ top: 0;
14
+ height: 100%;
15
+ }
16
+ </style>
17
+ """,
18
+ unsafe_allow_html=True,
19
+ )
20
+
21
  # Başlık
22
  st.title("Note Analyzer Streamlit Uygulaması")
23
 
 
28
  # "Uygulamanın Çalışma Prensibi" sadece analiz başlamadan önce gösterilir
29
  if not st.session_state.analysis_started:
30
  st.subheader("Uygulamanın Çalışma Prensibi")
31
+
32
  # Resimlerin dosya isimlerini sırayla listele
33
  image_files = ["a.png", "b.png", "c.png", "d.png", "e.png", "f.png", "g.png"]
34
+
35
  # Resimleri alt alta ekle
36
  for image_file in image_files:
37
  st.image(image_file, use_container_width=True)
38
 
39
+ # Sidebar: Kullanıcıdan veri alma
40
+ st.sidebar.header("Girdi Alanları")
41
+
42
+ # Dosya yükleme veya metin girişi seçimi
43
+ input_method = st.sidebar.radio(
44
+ "Notları nasıl gireceksiniz?",
45
+ options=["Dosya Yükle", "Kopyala-Yapıştır"]
46
+ )
47
+
48
+ uploaded_file = None
49
+ text_input = None
50
+
51
+ if input_method == "Dosya Yükle":
52
+ uploaded_file = st.sidebar.file_uploader("Notlar Dosyasını Yükleyin (TXT)", type=["txt"])
53
+ elif input_method == "Kopyala-Yapıştır":
54
+ text_input = st.sidebar.text_area("Notları Yapıştırın", height=200)
55
+
56
+ # Diğer parametreler
57
+ lecture_name = st.sidebar.text_input("Ders Adı", value="Ders Adı")
58
+ perfect_score = st.sidebar.number_input("Sınav Puanı Üst Limiti", value=100, step=1)
59
+ my_note = st.sidebar.number_input("Benim Notum", value=0.0, step=0.1)
60
+ note_s_axis_diff = st.sidebar.number_input("Notlar X Ekseni Ortak Farkı", value=5, step=1)
61
+ amount_s_axis_diff = st.sidebar.number_input("Miktar Y Ekseni Ortak Farkı", value=1, step=1)
62
+ first_step = st.sidebar.number_input("İlk Adım", value=0, step=1)
63
+ increase_amount = st.sidebar.number_input("Artış Miktarı", value=1, step=1)
64
 
65
  # Analiz butonuna basıldığında durum değişkenini True yapar ve çıktıları gösterir
66
+ if st.sidebar.button("Analizi Çalıştır"):
67
  st.session_state.analysis_started = True
68
 
69
  if input_method == "Dosya Yükle" and uploaded_file is None: