| Reply | « Previous Thread | Next Thread » |
|
I'm new to Symbian programming, and actually new to Python, too. My company uses Intellisync Mobile Suite and a variety of wireless devices including some E61i's. I'm trying to find a way to do some housekeeping on the E61i's by means of a Python script. I've spent several hours reading about device security, Ensymble, code signing, etc., and becoming annoyed. All of this doesn't seem to "simplify application development" one bit. But onward...
Would someone familiar with the S60 3rd Edition Python source code tell me if the Python interpreter (I assume either C:\sys\bin\python_launcher.exe or C:\sys\bin\Python.exe ?) will accept a Python script as a command line argument? Intellisync lets me run any executable in C:\sys, assuming I know the filename, and it would be really helpful if there was a switch I could use to then add the path to the .py file. (I'm guessing it's unfortunately not that simple.) All I need to do is a) read and parse a few text files, b) potentially rename a few files in C:\Data, c) potentially write a new text file and delete a text file...and do it without displaying a GUI or requiring user intervention. As far as I know, none of these files are protected by the OS. Assuming there is no simple switch to supply a Python file, what is the easiest means to an end, given that I want to run one script on many devices? Could there be an older version of Python that does accept a script on the command line? Would a self-signed script be able to perform the tasks above on multiple devices? I'd appreciate any help. Thanks! |
|
Hi,
Do you want to run a script from the shell or from a script? The latter is possible. Use the code below Code:
import appuifw, e32 def quit(): app_lock.signal() appuifw.app.exit_key_handler=quit file='C:\\Python\\second.py' execfile(file) app_lock=e32.Ao_lock() app_lock.wait() You can trim the code and use the approprite line on the interpreter (considering them commands) to run the scrpit. Here is the trimmed code Quote:
Kandyfloss V 7.0642.0 18-10-06 RH-51 Nokia 7610 |
| kandyfloss |
| View Public Profile |
| Find all posts by kandyfloss |
|
To avoid making this overcomplicated, I want to simulate the existence of a "recognizer" for .py files...either a way to launch the .py file by the same means Intellisync uses to launch .exe files, or by supplying it as the target of another executable. I suppose that means I want to run it from the shell. Not possible?
If I launch the script by means of another script, then how would I launch the FIRST script? Sounds a bit like a "chicken and egg" problem. ![]() I need this to work, but also want to make sure I'm not doing unnecessary work. Thanks for the reply and thanks in advance for helping me sort through this out. |
|
hi kandyfloss,
Using Code:
file='C:\\Python\\second.py' execfile(file) Best regards, Magnus |
|
Quote:
|
|
I did try and it doesn't work. I decided to ask because I'm new at this and wanted to make sure there wasn't some trick I was missing.
Does it work for you? |
|
Quote:
Well if it doesn't, there's one option You could try. Ensymble puts python scripts into their own installers, within them an exe is contained (and installed in sys/bin). I guess it's the launchpad for the script and You can try running that. |
|
Okay, so I definitely should be using python_launcher.exe and not python.exe. I recall the latter launches the interactive console, which is not what I want. What I'm doing is supplying "C:\sys\bin\python_launcher.exe" as the command and "C:\Python\ball.py" (etc.) as the argument, and nothing happens. I wish there was a debug mode in either Python or the Intellisync client so I could better see what is going on. Might it be possible this is a bad test, and the console brings extra resources to bear, which are not available if I launch the script this way? I could try running a really short, basic script to be absolutely certain it's not doing anything...
I've been eyeing Ensymble, but wasn't sure I could write a script that runs on multiple devices. For what I want to do (see below), a commercial certificate would not be necessary? Thanks again for the help. I could eventually figure this out myself, but didn't want to spent 2 weeks struggling. |
|
Quote:
Code:
myfile = "c:\\Data\\myfile.txt"
f=open(myfile,'w')
f.write("hello")
f.close()
Quote:
|
|
Okay, so now I know it really doesn't work. Wish I knew why. I'll have a closer look at Ensymble and try to get something working next week. Thanks again for the help.
|
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Problem reading command line arguments | blackcat95! | General Symbian C++ | 4 | 2009-05-02 15:57 |
| 再问关于symbian编译汇编 | cloufei2007 | Symbian | 0 | 2008-02-03 11:05 |
| PKG File: executing an exe with command line arguments | vaibhavjain | Symbian Tools & SDKs | 8 | 2007-09-25 11:12 |
| Can't find Executable class | arachidyl | Mobile Java General | 1 | 2007-07-06 20:27 |
| Could not browser the source code of imported executable | robinhuang | Carbide.c++ IDE and plug-ins | 0 | 2007-06-19 20:12 |