find() a larger string within a smaller string

2008-11-14 Thread korean_dave
stringa = hi stringb = hiy I'd like it to return -1 when I do: returnVal = stringa.find(stringb); Instead, it treats stringa as hi and stringb as hi. How do I solve this? -- http://mail.python.org/mailman/listinfo/python-list

Dummy explanation to win32com needed

2008-10-22 Thread korean_dave
Hi. I need a dummy's explanation to utilizing the win32com component to access Microsoft Excel. So far, I have this code. import win32com.client xl = win32com.client.Dispatch(Excel.Application) xl.Visible = 1 workbook = xl.Workbooks.Open(C:\test.xls) Now, my question is, where

Kicking off a python script using Windows Scheduled Task

2008-10-15 Thread korean_dave
Does anyone know how to properly kick off a script using Windows Scheduled Task? The script calls other python modules within itself. HERE'S THE CATCH: I am used to running the script directly from the command window and the print() is very handy for us to debug and monitor. When running the task

Re: Kicking off a python script using Windows Scheduled Task

2008-10-15 Thread korean_dave
Hey all. i solved this problem by logging on with my network domain login (log in using...) instead of NT AUTHORITY\SYSTEM which only gave out local privleges to the process started off by Task scheduler. On Oct 15, 10:36 am, korean_dave [EMAIL PROTECTED] wrote: Does anyone know how to properly

datetime.datetime.now() in military time

2008-08-19 Thread korean_dave
import datetime def main(): timenow = datetime.datetime.now() print(str(timenow.hour)) if __name__ == __main__: main() If the time was, say, 2pm, how can I make output of timenow.hour 14 instead of 2? Thanks. -Dave -- http://mail.python.org/mailman/listinfo/python-list

for y in range (0,iNumItems)-- not in order?

2008-08-14 Thread korean_dave
for y in range(0,iNumItems): print(str(y)) How do i make the output go IN ORDER 0 1 2 3 4 5 6 etc. instead of 0 1 10 11 12 13 14 2 3 4 5 6 7 8 9 -- http://mail.python.org/mailman/listinfo/python-list

Re: for y in range (0,iNumItems)-- not in order?

2008-08-14 Thread korean_dave
Still the same output... Here's the actual code... for x in range(0,2): for y in range(0,27): for z in range(0,15): print(str(x) + + str(y) + + str(z)) -- http://mail.python.org/mailman/listinfo/python-list

Re: for y in range (0,iNumItems)-- not in order?

2008-08-14 Thread korean_dave
] wrote: korean_dave wrote: Still the same output... Here's the actual code...     for x in range(0,2):         for y in range(0,27):             for z in range(0,15):                 print(str(x) + + str(y) + + str(z)) umm.  that's even less related to your original output than

Re: for y in range (0,iNumItems)-- not in order?

2008-08-14 Thread korean_dave
fast. So we have basically 20 iterations in a second. When i sort by time, it sorts by string (output) b/c there are 20 outputs in a second. Thanks all. On Aug 14, 12:07 pm, Bruno Desthuilliers bruno. [EMAIL PROTECTED] wrote: korean_dave a écrit : Still the same output... same as what

readln() until EOF

2008-07-24 Thread korean_dave
a = open(Thefile.txt,r) while ?: result = a.readln() what do i put in if i want to keep reading line by line until i reach the end of the file? I don't want to break the loop if there is a blank line, because there will be. Ex. of a file: map1 result1 map2 result 2 map3 result3

Neat way to get rid of [ ] in sys.argv[n:] returns

2008-07-24 Thread korean_dave
so, i code this: - #!/usr/bin/python import sys import os for param in os.environ.keys(): print %20s %s % (param,os.environ[param]) print(os.environ['PATH']) print(sys.argv[1:]) -- and then when i type in -- python test.py testparameter

% sign in python?

2008-07-17 Thread korean_dave
What does this operator do? Specifically in this context test.log( [[Log level %d: %s]] % ( level, msg ), description ) (Tried googling and searching, but the % gets interpreted as an operation and distorts the search results) -- http://mail.python.org/mailman/listinfo/python-list

win32com extension documentation/API

2008-07-07 Thread korean_dave
Hi. Where can i find the API for this extension? Sourceforge only has downloads. Python has stopped supporting the upkeep of the versions. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

how to recognize IE window already opened using win32com extension

2008-07-07 Thread korean_dave
How do I use the win32com API to manipulate IE windows ALREADY open? ie = Dispatch(InternetExplorer.Application) opens a new window. But I'd like to be able to find, of windows already open, a specific window (with a specified property, matching url, etc.) --

How to make python scripts .py executable, not bring up editor

2008-07-07 Thread korean_dave
From command Prompt, i type in a script, tryme.py. This, instead, brings up PythonWin editor and Interactive Window. Path variable is C:\Python24. (I need Python 2.4 installed, not 2.5) How do I make it so that the script runs? -- http://mail.python.org/mailman/listinfo/python-list

using the string functions (ex. find()) on a multi-symbol string

2008-06-17 Thread korean_dave
How can i use the find() function on a string that is composed of tons of symbols that cause errors... THis is my string: find(htmlheadmeta name=qrichtext content=1 /style type=text/cssp, li { white-space: pre-wrap; }/style/headbody style= font-family:'MS Shell Dlg 2'; font-size:8.25pt;

sre_parse.py - over-view or explanation needed

2008-05-19 Thread korean_dave
What does sre_parse.py (Secret Labs' Regular Expression Engine) do? I see this referred to in some errors when i call the source() function (e.g. source(findFile(scripts,thisonehere.py)) ) The error then refers to name ImportWarning not defined?? (--that might be a proprietary warning, as I am

printing inside and outside of main() module

2008-04-30 Thread korean_dave
This allows me to see output: ---begin of try.py print Hello World --end of try.py This DOESN'T though... --begin of try2.py def main(): return Hello --end of try2.py Can someone explain why??? -- http://mail.python.org/mailman/listinfo/python-list

python-doc

2008-04-23 Thread korean_dave
Hi all. I am using this to try to document my python-coded apps. http://effbot [DOT] org/zone/pythondoc [DOT] htm i am using windows XP professional. I have put the install directory of pythondoc.py in my path file. So i cd to the directory containing the python scripts I wish to python-doc,