Dec-20-2016, 08:12 AM
First off, hello! I've been trying to find a good forum to post questions to and, when I'm better with python, hopefully I can help people out with their questions as well!
I'll try my best to explain my situation.
Question
1.) I have been wanting to get into python for quite sometime, but it seems that there is always an issue with pathing. Currently, my python install path is:
Inside that folder, there is a folder named "Projects." System path:
Is the path in the code correct in order to execute this code correctly? How would I write that code in order to execute what I want?
Just in case my environment variables are off, I can send you an image displaying them. Due to being a new member, I cannot post images.
I'll try my best to explain my situation.
The Problem:
my_variable = "<html><head><title>Look At This</title>"
my_html_file = open("/Projects/my_html_file.html", "w")
my_html_file.write(my_variable)
Not able to write (create new) "my_html_file.html" by using "w".
to my understanding, "w" is supposed to create the file, in the event that that file is not present.
Question
1.) I have been wanting to get into python for quite sometime, but it seems that there is always an issue with pathing. Currently, my python install path is:
C:\Python35-32
.Inside that folder, there is a folder named "Projects." System path:
C:\Python35-32\Projects
(I am aware there is not a subfolder for the specific project I am working with. To keep it simple, I'm just trying to create an html file output into "Projects."Is the path in the code correct in order to execute this code correctly? How would I write that code in order to execute what I want?
Just in case my environment variables are off, I can send you an image displaying them. Due to being a new member, I cannot post images.
I hope that this is enough information to help a tiny bit. I guess a few meta details would be:
OS: Windows 10
Python: version 3.5
Obviously if any other information is required to help out, please let me know. Thank you for taking the time to read this.
-mwmaw