Open Xelany57 opened 4 years ago
@Xelany57 Hey, I'll be happy to help you on this. What python version are you using? The code seems to work perfectly well for me. Could you elaborate a bit more about the issue you are facing.
The s= isn't mandatory, it just holds the number of characters we wrote in the file.
I think I have the latest version of Python (3.7.4)
Well I assumed that when running the file using the python interpreter it should create a text file named "test.txt" with written inside "I am beven"
For me when I take it just does nothing when I run it using python, I place it in another folder to make sure im not missing the output file, but really it doesn't do anything, I see the window appearing very quickly and closing just as quickly, no file is created
Do you have any clue? How does it work for you?
Thanks!
@Xelany57 Hey, I'll be happy to help you on this. What python version are you using? The code seems to work perfectly well for me. Could you elaborate a bit more about the issue you are facing.
The s= isn't mandatory, it just holds the number of characters we wrote in the file.
@tanishqvyas See my previous answer please : )
@Xelany57 Isn't Pythone interpreter used to interpret code rather than executing files ? I suggest you run the file using some IDE or on terminal using the command For Windows
python filename.py
For Linux
python3 filename.py
@Xelany57 I ran the file by placing it in a folder named Downloads. Then I changed my present working directory to Downloads. After that I opened my terminal and typed
python3 filename.py
The code ran just the way you expected
@tanishqvyas Thanks for the help as I suspected it was very simple
I ran it using "python file" command and it output the file as expected, I played with the program a bit and it works as intended
I assume you are on linux because when I run "python3 file" command it doesn't work, but when I remove the 3 it works
I thought the interpreter was able to run the code, I was wrong on that
A bit off topic, but do you know some good ressources/ways to improve in Python? I already did the crash course python from no starch press, even if i didnt complete all the projects yet
I think Ill need to improve the most in django or other web frameworks, it is for my job...
If you do have ideas Ill happily take them if not I already thank you for your help! Thanks!
@Xelany57 I am glad to help you. Yes, I am on linux. I mostly learn from online resources. Since you specifically mentioned Django. For basics you can refer to these
I could suggest you a bit more depending upon how much have you learnt from starch press. Sorry but I haven't taken a look at their course, so won't be able to suggest according to that.
Recently I made a very basic django project
. You can have a look at it.
Welcome again.
@tanishqvyas I checked your django projects it would be better if you would add dependancies in readme.
Don't worry I'll do it for you
Hello,
this is probabaly the simplest of all codes in the zip file but I cant make it work
It should create a test.txt file in the same directory but it doesnt do anything for me Plus i dont understand why there is a "s = " before the write statement Sorry Im new to python and github, I just finished the crash course python from no starch press
BR,