Writing to a .py file and loading back in the values.
Пікірлер: 57
@gamergotdis2348 Жыл бұрын
Tysm this is all I needed for my programming project in school! I was trying to store user information but I failed multiple times, this really helped 10/10 thank you again.
@CLyon-cc9jp Жыл бұрын
I never would have thought of using a python extension over a text extension to save my program data. Perfect! Saves so much time not having to parse every entry. Nice.
@Nezuzo11 ай бұрын
Thank you so much man, so simple and easy to understand.
@faisaltaher8516 жыл бұрын
thx you so much you helped me with a problem the was happening for 2 day FREAKING 2 DAY thx you, you solved my problem :)
@robertovargas5839 Жыл бұрын
This is super tedious if implemented even on a small text based game but its good to see there is a way of getting it done.
@BiggestNaviaFan4 ай бұрын
thanks a lot this helps with my text based boss fighter
@dofnithedope37583 жыл бұрын
THANK YOU!!! I have been trying to figure out how to do this and literally every other tutorial was just too complicated for my small brain.
@ashmeepragnaroy89762 жыл бұрын
Thanks a lot!! This was a way of saving user data permanently! Thanks again!
@blackblocky3866 Жыл бұрын
very good tutorial, thanks!
@richitomiau. Жыл бұрын
tysm u make it so easy to understand and save my time
@zeperoxx4 жыл бұрын
Thx, it helped a lot, especially I didn't have any success before. Every video or post I find only shows how to write a sentence, not full variable
@EJStudios174 жыл бұрын
If you have separate def’s it gives a name error. Is their a fix for this?
@ktz26253 жыл бұрын
How can I save and load a string (name = "KTZ") because I can't put the "" in the f.write function. Please help.
@TaFr-mg5dy7 ай бұрын
Thank you for your useful tutorial
@rafy-ivanmorales30772 жыл бұрын
Rafy-Ivan Morales 0 seconds ago I'm a new student trying to learn, so I can become a programmer with python and I have a project on how to make a port scan. So far I already make a port scan with Python3, and it scans fine, give a date and everything working good so far. I see on your video tutorial you give example on how to send and receiving data. I would like to ask for your advice if you can and guide me on how I will add this 3 in a Python script, I have: 2. System should look for all the ports between the range of 1 to 1025 3. If the Ports is open, it should create a file and add an entry for port number 4. In case of any exception for instance “host is not available”, “host name could not be resolved” or due to any other error, you need to write that exception into the same file. Thank you and Merry Christmas.
@Prosecute_V2 жыл бұрын
guud
@xNezrx Жыл бұрын
Thank you so much!
@tops_10-20 Жыл бұрын
Explanation : 100 / 100
@Devtheking Жыл бұрын
Thank you!
@ohtych10044 жыл бұрын
How could I delete what was on the second file? Like in this example, if I wanted to delete the health from the Savytime.py file?
@psychic_digit3 жыл бұрын
I think you just have to overwrite it to 0 or something.
@quirkychamp91524 жыл бұрын
thank you so much i look a lot for that
@corn32373 жыл бұрын
I can’t thank you enough. Thanks you so much. You have saved me literally hours more of stress. I’ve tried to make multiple save files but it always gave me a error, is there a way?
@DanielMurrayMakes3 жыл бұрын
What's the error say?
@sirng12724 жыл бұрын
Thanks
@yosuo84727 ай бұрын
W mans
@ifaisalne97812 жыл бұрын
Man you are really pro, i have a Q Can you tell me how to save a word like True False value in py file ?
@orangeleaf363 жыл бұрын
What about for saving a string?
@sandpaperunderthetable67083 жыл бұрын
How do you check if a file exists? Do you use a try and catch and open a file for read? Does that work?
@DanielMurrayMakes3 жыл бұрын
Yes a Try would work there, good idea!
@sandpaperunderthetable67083 жыл бұрын
@@DanielMurrayMakes thanks
@sandpaperunderthetable67083 жыл бұрын
@@DanielMurrayMakes will opening a non existant file to read cause an error?
@DanielMurrayMakes3 жыл бұрын
@@sandpaperunderthetable6708 Yeah but of you use Try with an Except then it will just jump over to the except. Bad coding probably but it'll work!
@dorgan87774 жыл бұрын
Thanks I'm currently working on a text based os called red warp
@hayderalanbari67403 жыл бұрын
How is it going?
@matthewwhite37443 жыл бұрын
Yeah how's it going?
@ProFNaFPlayer._1987 Жыл бұрын
It just doesnt work. The file isn't showing up , and when I created the file by myself , It's empty
@Greg22 жыл бұрын
How do I make it so everytime I run the command, it sends how many times I have ran the file?
@ProFNaFPlayer._1987 Жыл бұрын
I know the answer , still wanna know?
@theprogrammer19033 жыл бұрын
i subbed
@unrealnovice73304 жыл бұрын
UnboundLocalError: local variable 'loseCount' referenced before assignment ??? its pretty usless if i cant change bevor im loading
see i was hoping to have it were i can just input the data but it kept saying i cant do varibels for the word that in the string for write
@DanielMurrayMakes4 жыл бұрын
Copy-paste the exact error here, maybe I can help
@quirkychamp91524 жыл бұрын
Ow I fixed it already thx you so much
@quirkychamp91524 жыл бұрын
I'm new to this so ya
@quirkychamp91524 жыл бұрын
Big fan
@KlaroNebulous3 жыл бұрын
for me it only saves the data in the first line idk why
@adamhall70772 жыл бұрын
Did you put the " " in? You might have put a "/n" instead.
@ThatGuyexe3 жыл бұрын
loll so cool
@ringingstrings60783 жыл бұрын
How do I Put my "Saveytime" in another folder and open it
@survivalist26073 жыл бұрын
instead of "from Saveytime import *" put "from yourfoldernamehere import *" or "from yourfoldernamehere import Saveytime" but you'll have to put a "Saveytime." before any variables that are getting pulled from the File, to shorten it put "from yourfoldernamehere import Saveytime as namehere" that way, you'll have to put "namehere." before every variable getting pulled from there. Ofcourse you can put something else other than namehere, it was used as an example.
@rakawiratama Жыл бұрын
can we customize the location of the saved file? In my case it is always saved in C/Users/(My username)/... and I want to save it somewhere else
@mr.broken5539 Жыл бұрын
hey! i have the same problem, have you found the solution? luckily u posted this comment 2 days ago so i hope u can answer haha
@spookyleo2589 Жыл бұрын
if ur file name is kitty you have to do like C:/DeskTop