where should I save a file before open it - python-2.7

Where should I save a text file before I open it on python?
I tried to open a text file on the desktop, but that generated an error.

Related

Opening shapefile in RMD

I'm running into a persistent error in RMD. I'm trying to open a shapefile that is in my RMD directory ("website/"). When I run the code to open the shapefile, it looks like this.
data <- st_read("website/website_data.shp")
Error: Cannot open "website/website_data.shp"; The file doesn't seem to exist.
I've used file.exists and list.files and both say website_data is in the folder. What am I missing?

How can I compile the .xe file to .bin file by xTIMEcomposer studio?

enter image description here:I want to get a bin file by compiling the .xe file. And I had try export but no effect.

C++ How to open .docx files in MFC

How can I open .docx files in MFC?
Because when I open a .docx file it puts "PK" to the editor. (This is at every .docx file I have opened)
.docx files are .zip files with a different extension. The content of the zip is essentially a directory structure containing various XML files.
To open a .docx in a text editor would basically require unzipping the file to a directory then opening each XML file in your editor.
The actual format of .docx files can be found online.

WEKA: Converting csv file to arff file

I am trying to convert csv file to arff file using ArffViewer (Tools -> ArffViewer -> File -> Save as...) With this the arff file is created but without any contents (empty file). My question is:
Why is it creating an empty file and how to fix it.
sample of csv file:
(All attribute types are nominal)

SQL server 2008 Task Scheduler will not create a file from the program

I am running sql server 2008 and I have a .exe file on it that creates a .txt file which is saved in the same directory. (so, before running just the .exe file exists, after running the .exe, the .exe file and a .txt file exist.) From there, the .exe file sends an email using that .txt file as an attachment.
Here is what works perfectly: If I double click on the .exe file, the .txt file is created and the email is sent. or if a .txt file is already there, it is overwritten with a new one. If I double click on the batch file which runs the .exe, it works too.
Here is what doesn't work: If I try to start either the .exe or the .bat file in the Task Scheduler that is on the server, it will do something very peculiar: The .txt file will not be overwritten or created. If the .txt file doesn't exist, a new one isn't created and no email is sent. If I put an old .txt file there, the email will get sent but with the old file (i.e. the file was not overwritten). So, condensing it all down: The task scheduler will not allow the .exe file to create the .txt file. Just for fun, I modified the program (it was created with C++) so it only creates a .txt file with no email and it still won't create the .txt file.
I'm assuming you are using code like:
if (!File.Exists("logfile.txt"))
{
log = new StreamWriter("logfile.txt");
}
else
{
log = File.AppendText("logfile.txt");
}
I find when running taskscheduler it is better to use the full path like this:
if (!File.Exists("c:\\Program Files (x86)\\Company\\Sales Report\\logfile.txt"))
{
log = new StreamWriter("c:\\Program Files (x86)\\Company\\Sales Report\\logfile.txt");
}
else
{
log = File.AppendText("c:\\Program Files (x86)\\Company\\Sales Report\\logfile.txt");
}
This also applies when reading a file.