ownStartup
- 16 Devlogs
- 18 Total hours
I spent quite a bit of time on this part…
To give you a quick overview: I improved the app’s interface experimenting with various elements, especially the charts and related features.
I utilized the exercises I had already been working on—specifically the functions—and adapted them for the app. This includes the sections on statistics, data simulation, and so on.
I’m not very experienced with CSS yet since I don’t use it often, I asked Antigravity to add some styling to give the page a more premium look, given that Streamlit supports the standard web trio (HTML/CSS/JS). I also came across FastHTML, which encapsulates these technologies; the API and the way it handles standard web operations using Python are pretty cool. It’s less abstracted and feels closer to “standard” web development.
There’s a sidebar to access the sections I set up—four of them: General, Anomaly Detector, Statistics, Simulator, and Journal.
Since I’m not fully comfortable with modularization yet and tend to get lost when the file or project size grows, that Agent helped me organize the code and use the correct functions and parameters. It’s easy to forget things like passing file paths as strings, missing commas, or similar details errors that can take a long time to track down if you aren’t testing thoroughly throughout the development process.
I just started the app now. Before, I was looking, not exactly at the docs, but at the library’s syntax, some projects on Streamlit Cloud, the ones people like the most, and a bit of the repo to understand and see what it has to offer.
I was just testing the colors here, formatting I saw there is the .streamlit/config.toml to configure its applications. In the images, I only made a sidebar and some kind of mocked options and put an icon that shows up in the browser tab :>
Today I started playing around with Streamlit.
I took a quick look at the formatting and did some research to get a basic understanding of how it works.
For now, I ran some local tests and eventually built this "little page" with it.
Here’s what I used:
st.text_input # For text input...
st.write # To write text
st.markdown # Renders Markdown formatting
st.image # To render an image; I even added a caption
Yeah, that was it.
I was working on improving the readability and logic of my files. Often, I’d finish an exercise and depending on the time just go to sleep or shut down my laptop without really testing whether the logic was sound. There were about two or three files like that, so I had to go back and tidy them up a bit.
Now that I’ve started using Antigravity, I feed the file to the Agent, and it analyzes my logic, my solution, and so on. This gives me a good idea of whether I’m improving and whether "it gives me the green light" to move on to another topic or part of the language.
What I mean is, if my logic and command of the tools are at a satisfactory level for the work I’ll be doing, I can move forward without worrying about making mistakes, forgetting things, or lacking a tool or technique I should have already mastered.
I finished the last two functions. Actually, they ended up being three because in the second file I did two.
The first exercise was to return the price of a product with tax already included. The function received parameters for the value and the tax, and then I applied the tax to the value and printed it.
The second one was a converter from 24-hour format to 12-hour format. For these two (I’d say both could use quite a bit of work) I didn’t put any input validation or code defense. Basically, that’s it.
It ended up that I didn’t work much yesterday… I was studying Chemistry :/ Now I finished the palindrome function, I just had to pass the data, set the parameters, call the function, and that’s it. I’ll continue with the other two and then I’ll probably start the Streamlit part.
Now I’m working more with functions here. I made two simple ones that take three numbers as parameters and return the sum, and another that checks if the number passed as a parameter (int) is even.
I had almost everything right, but I looked at it and thought "man, there's a way to improve/make this shorter", so I sent it to *AI Mode on Chrome (I use it because it's much more integrated with search engines, can see websites, docs, stuff like that, forums, etc) and it gave me this which I thought was pretty cool:
return num % 2 == 0
The result of this is a boolean value, and when printing you just need to check the value of the variable which is already True or False, and that’s it. Pretty cool…I had already done an exercise in C to check if something is a palindrome in my course. There, the code gets longer (verbose, from what they say) because you have to use strings which are arrays, validate all those things. I don’t know, but quickly thinking about the logic and the use of variables for comparing letters, it seemed more intuitive there… Here I haven’t done it with a function yet. I’ll do it soon. Afterwards, to check what I had done up to that point, I sent it in Chrome and it just gave me a crazy trick! There are methods/arguments used in string slicing that reverse the string and check if it’s a palindrome in just 5 lines of code… I really didn’t know that.
This one was trickier. I need to improve how I use functions and keep variable scope in mind.
This new file adds modularity to Exercise 7. It contains functions for all the program’s processing tasks statistics, anomaly detection, results, status, displaying the report, and generating the report file. The part involving the file output was throwing an error because it didn’t recognize the total variable. I tinkered with it for a while, and since I’m using the Antigravity IDE, I decided to hand the problem over to the Agent, it basically changed the code to use len(dados) as a parameter (I really should have thought of that :| it was pretty simple, but I just got stuck).
In the end, it was generating two files: one in the script’s directory and another in the directory where I was running it. (I use a "Run" extension (exactly Code Runner, so I just click it and it executes the file—whether it’s compiled or just the source code, since it’s an interpreted language.)
So, for Exercise 7, I basically took what I had done in the previous ones and combined everything. I would input the numbers, and the program would recalculate the z-score to determine the standard deviation component. It then displayed the input, the total, and any anomalies. That’s essentially what I did. I still need to improve an understand better the input validation and how I use the .split() function/method.
I hadn’t included this image in the post, so:
C7complted
M365 Copilot had assigned that exercise, but as I mentioned earlier, I skipped it. I didn’t quite grasp what it was asking for—I just did what I thought made sense and moved on to number 6…
After finishing number 6, I asked it exactly what it wanted me to do, since I hadn’t understood the previous task. It explained something like this: you need to generate normal data and insert an anomaly. The dataset would consist mostly of normal values, with very few abnormal ones. It provided this pseudocode to illustrate the logic:
if random < error_chance:
generate unusual value
else:
generate normal value
I did exercise 6. I skipped 5, actually I think I started it pretty much, but I decided to come to this one.
Here I had to enter the logs and see the occurrences of the events, only 'ok' and 'fail'. If there were failures, it would show how many there were.
I even had the general logic, the code was well structured, but I was trying a defense loop right at the beginning of reading the user input. It had to be only ok and fail, so it was becoming an infinite loop. Actually, I wanted to do this input validation part: it can't be empty and only allows the strings I mentioned
Then I researched and looked at some things until I put a piece of the code into Chrome and that overview created by AI appeared and simply gave me the input block ready… I was using:
if len(status) < 1 or any(resultado != permitidos):
# logic was using while True
This one was a bit different… what the M365 exercise wanted was for me to find values that fell outside the norm. I had studied variance and standard deviation back in school, but I honestly didn't remember anything about them.
I managed to handle the initial part—up to the summation fairly well (more or less what’s shown in the image, though it was far from right). I tried various approaches and attempted to recall the formulas or rather, not the exact formulas, but the underlying logic and the mathematical steps I needed to implement.
I’ve included the simpleC4.py file here so you can see roughly what I was attempting earlier.
I ran quite a few tests, executing the code after every new mathematical operation to verify everything was correct; I also had to comment out certain lines to debug and figure out how far the code got or what needed fixing.
Man, this one took quite a while… I didn’t think it would take so long, and I thought I’d be able to do most of it on my own, but the for loop logic kept throwing errors because it was iterating over an index that didn’t exist
I think its funny/strange how I forget certain things (I wouldn’t say easily), even though it wasn’t that long ago that I learned or understood them.
I don’t printed the final code… so get the source code on the repo:
C3
This new exercise was basically meant to read only the numbers from the file (specifically, integers).
The template only included the letters/string "abc" but the code handles anything that isn’t a number because I used the isdigit function
He mentioned that this exercise would involve try-except blocks, but I didn’t quite understand why at first. After completing my version, wondering about his comment, and imagining how it might work, I searched for the code block on Google; using the AI-generated overview, I learned about the different types of exceptions (basically, the errors that could occur).
I didn’t explain this earlier, but the exercises I’m doing are *mostly about file manipulation *sort of an introduction to Pandas and working with Data And that image there is of M365 Copilot. I managed indirectly to get access to it through the institution where I’m taking the course. I’m using it for studying and things like that. I asked it to generate exercises for me to do
This first one asks to read numbers from a file and print the
average
Hi, I’ve started this new project…
It had been a while since I last worked with Python, and when I did, I didn’t have my laptop with me. I was using Acode on my A05s, which wasn’t exactly great for development. Actually, I think it’s one of the best—if not the best—mobile options out there, but having the ergonomics and capabilities of a machine “built for the this” is so much better!
I was sitting here wondering, “What kind of project should I do?” I wanted something useful. I know "useful" is subjective, but I look for things I connect with and find interesting (which inherently adds a bit of utility). I have a basic grasp of Python, but I haven’t done much hands-on practice—mostly just watching videos and doing class exercises last year. Because of that, I went a long time without building anything serious, and I decided there was no point in forcing myself to tackle something “advanced” right away.
I started by writing a few things (what you see in the image) and testing some language features, but it didn’t really flow well, and I didn’t feel like I was actually learning anything new (truth be told, I already knew those little bits). In the course I’m taking now, the instructor uses C; I’ve been really digging into the fundamentals and practicing with hands-on exercises based on how C works that’s the approach I enjoy. Starting strong, mastering the basics, and building up from there. Since I never really did that with Python, I’m going to do it now!
My plan is to work through some exercises, cover the language fundamentals, and eventually build a portfolio site—kind of like a project diary—using something like Streamlit or Dash. That’s about it. :)