Open python file with Task scheduler - python-2.7

I have a .py file that reads integers from a separate csv , i just cant launch it from windows task scheduler, after 2 days and much frustration im posting here. A lot of similar questions have been posted but none are answered adequately for my case.
I have no problems launching other python files or exe's, the problem arises when the python file needs to read a csv. I have turned the file into a batch file, and i have also went through every possible permutation of administration and permission options, but still no cigar. The problem stems solely from the fact that the python needs to call from an external csv. Has anyone got an opinion, or a work-around?
Thanks.

Assuming that you try this under the windows 7 Task-scheduler...
You may try the following:
In the security options of your Task (1st page) ensure that you have selected the SYSTEM account. Tick the high privileges check box near the bottom of the dialog (i guess you already did that)
check if the file can be accessed (write into it with notepad)
try to call the executable from the python processor directly with your script-file as an argument (maybe something went wrong with the inheritance of access rights when windows calls the python processor; assuming that you linked the .py file in the Task Scheduler)
check the execution profile of the python command processor and compare it to the ownership of the CSV file (does the csv file reside in a user-account folder and has therefor other access requirements the python process can provide ? example: csv owned by user X, Task is run as user Y)
you may also try to create a new, empty textfile somewhere else (C:) and fill the content in from the CSV
greetings :)

Related

Logging into a specific file in Tizen?

Before asking this question I searched a lot about Logging (the terminal Debug Log) into a file for Tizen Application. I figured out some other ways to implement using several alternatives a bit complex pathway for this problem. But I want something straightforward, simple and builtin for Tizen Applications.
So here is what I want -
I will run a Tizen application written in C/C++. It will generate response logs on the terminal based on the several queries I ask to the app.
I want to save those logs into a specific file like file_name.log .
That file_name.log will be saved somewhere within my PC. Developer can change the location as my own.
Is there any command or an existing system for Tizen apps ?
Thank you in advance.
Read https://developer.tizen.org/development/guides/native-application/error-handling/system-logs about Tizen's built-in logging system.
As stated in the page, the logs can be also retrieved from the command line using sdb shell dlogutil [options...] [TAG], or simply sdb dlog [options...] [TAG]. So if you want to save the output as a file, simply do sdb dlog [-d] MY_APP > file_name.log. If this is not what you are searching for, please be more specific in your question.

how to give a version to mdb files

I am using a .mdb file as a database for a dialog based application. For the each Release I want to give a version to the mdb file if there are more entries added. using C++ i want to read the version and display it in the application.
Can you please tell me if it is possible to give a version to mdb file ?
You can add a table to MDB and track releases there. If MDB should change release number automatically after some data changes, you can use Data Macro (this is for Access 2010+)
You can create a custom property:
db.CreateProperty("VersionId", dbText, "1.0.0")
then add this to the database, but there is no way to read this without opening the database file.
There is no easy way to do that and its probably best to do it as a db.property like #Gustav proposed.
If for some reason it is important to have a version information that you can read without opening the file as access file there are still some options:
There is the Windows Shell Property System that I think allows you to add Properties to every File/Folder.
You could change the Creation Date for the file to fit your need.
You could perhaps even read/change the file content itself in a binary stream if you research it thouroughly enough.
and you can of course have an external .txt (or .ver or whatever) file that you update automatically from the db.property whenever you open the db.

Copy files from local PC to SAS server in Enterprise Guide

I need to extract a particular sheet from a .xls file on my local machine and get it as a .sas7bdat files on the SAS server on which I work (or the other way round, that is, import it and then convert).
The problem is that although this can be done using the Import Wizard, I need to do this using the 'Copy Files Add-in' because it needs to be built as a part of an automated process.
When I tried doing this using the copy files add-in, it DID copy the .xls file onto the server according to the log, but the .xls file didn't actually show in the library and could not be referenced either (or maybe I'm just referencing it wrongly).
This has led me to believe that I need to convert it to a .sas7bdat and then import it.
Is there a way to get past this? Please bear in mind that I am talking about an automated process, so the wizard is useless for me (or is it? I'm not sure)
NOTE : I am extremely sorry that I cannot post the log and screenshots here, because I work as an offshore resource for a very large bank and cannot post anything here. I have, however, tried to make my problem as clear as possible. If any further clarifications are needed, please let me know!
I assume you've read There and Back Again which covers this in some detail.
Ultimately, all you're doing is copying the excel file as a file onto the SAS server. You're not importing it into a SAS dataset. You would import it by placing the file (either the remote file after copy files add-in, or the local file) in the workflow as an import step.
For example, if you chose /usr/lib/sasdata/myexcel.xls as the remote copy destination, you then need to include that file in your workflow as an import step (you can drag/drop the file and it will automatically create that step for you, with some wizardry).

Xml file are saved in two different path

I created application that store some data to XML file. The issues is with the path of the XML saving. Am using TinyXML to save the data in vc++.
When I deploy this application, it installs in "C:\Program files(x86)\applicationname " and when I run the application the XML file is saving in
"C:\Users\UserName\AppData\Local\VirtualStore\Program Files (x86)\ApplicationName ".
I have made this application to work on system startup. So when I restart this application,
the xml file is stored in different path "C:\Users\UserName\AppData\Local\VirtualStore\windows\sysWOW64"
I want my XML to be stored in the path where I installed or should be stored in appdata, application name
What should I do to store XML file in one places where application is installed?
doc.SaveFile( "test.xml" ); // xml saving code in tinyxml library
Firstly, this has nothing to do with C++, as the C++ code is probably working. Same with XML and tinyxml and even visual-c++.
It seems that windows redirects those write accesses to a user-specific "VirtualStore\Program Files", but I'll leave it to you to research the actual semantics of that. On startup, when there is no user, this path obviously differs, since the former user is not logged in.
Now, in order to get a fixed path, you can use the function GetModuleFileName() to find out the location of your executable and use that path to locate Smartmeter.xml. However, the problem you are facing now is that programs installed under "Program Files" don't magically gain write access rights to their install directory. This is to protect one user from messing with data of another user.
I think that what you are doing is writing a program that runs in the background, which would be called a "service" under MS Windows. What is still unclear is what you want to achieve with this file and also what you are planning to do overall, and these are things that decide the future steps. In any case, take a look at the possibilities that services provide, maybe there is something that fits your needs.

Symbian C++ - Persistent storage of a single variable

I wish to store a single variable in my application that will be saved between runs. This will be a version number that will be used to trigger an update option and so will change only rarely.
Does anyone have suggestions on the best way of implementing this? Considering it's such a simple requirement I am interested in the simplest solution.
Thanks!
Normally, that sort of information will be held in a constant (not a variable) in the binary, and the binary will contact an external site to find out whether there is a more recent version of the software. When it downloads the new, the newly downloaded file will have a new constant embedded in it.
Alternatively, you could keep the information in some sort of file in the file system. I'm not familiar with the Symbian environment, but something similar most likely exists.
It has already been mentioned, so I am going to elaborate on it. Create a file in your project directory that will contain the version number. Make that file a part of final SIS file by adding a line about it in the PKG file---for example, put a line in the PKG file to tell the installer to copy the file to a place like c:\System\Apps\${AppName}\${filename} on the device. Within code, read the version number from that file. The advantage you will have from doing it this way is that when you update your code and edit the file in your project directory and recreate an updated SIS file, on updating the SIS on the device, the version file will automatically get replaced with the current one.