Re: Windows subprocess.call problem

2013-01-21 Thread Tom Borkin
nob...@nowhere.com had an excellent suggestion that worked right off the bat and achieved exactly what I was after. Thanks all! Tom On Mon, Jan 21, 2013 at 9:04 AM, Dave Angel wrote: > On 01/21/2013 06:25 AM, Tom Borkin wrote: > >> Hi; >> I have this code: >> &g

Windows subprocess.call problem

2013-01-21 Thread Tom Borkin
Hi; I have this code: #!/Python27/python import os, subprocess, sys lyrics_path = "/Users/Tom/Documents/lyrics" os.chdir(lyrics_path) songs = ['livin-la-vida-loca', 'whos-that-lady'] for song in songs: subprocess.call(['notepad.exe', '%s.txt' % song]) my_songs_path = "aa english lyrics" os.chdi

Re: Why Doesn't This MySQL Statement Execute?

2012-12-18 Thread Tom Borkin
Actually, what I originally had was: cursor.execute("""insert into interactions values(Null, %s, "Call Back", %s)""", (i_id, date_plus_2)) and that didn't work, either. I tried your variation like: cursor.execute("""insert into interactions values(Null, %s, "Call Back", %s)""" % (i_id, date_plus_2)

Re: Why Doesn't This MySQL Statement Execute?

2012-12-18 Thread Tom Borkin
No (lol). It returns a date as a string: "2012-12-12" for example. Tom On Tue, Dec 18, 2012 at 6:02 PM, Wayne Werner wrote: > On Tue, 18 Dec 2012, Tom Borkin wrote: > > Hi; >> I have this test code: >> >> if i_id == "1186": >> s

Why Doesn't This MySQL Statement Execute?

2012-12-18 Thread Tom Borkin
Hi; I have this test code: if i_id == "1186": sql = 'insert into interactions values(Null, %s, "Call Back", "%s")' % (i_id, date_plus_2) cursor.execute(sql) db.commit() print sql It prints the sql statement, but it doesn't execute. If I copy and paste the sql into the m

Re: Problem with subprocess.call and windows schtasks

2012-11-21 Thread Tom Borkin
On Wed, Nov 21, 2012 at 6:01 AM, Tim Golden wrote: > subprocess.call([ > 'SchTasks', '/Create', > '/SC', 'ONCE', > '/TN', 'test', > '/TR', path, > '/ST', '23:50' > ]) > Thank you. Yes, it was the quoting of "test". Oops :-} Thanks again, Tom -- http://mail.python.org/mailman/listinfo/p

Re: Problem with subprocess.call and windows schtasks

2012-11-20 Thread Tom Borkin
TR', 'run_alert.py', '/ST', '23:50']) Both of the above commands throw the same error: ERROR: The filename, directory name or volume label syntax is incorrect. Pls advise. TIA, Tom On Sun, Nov 18, 2012 at 12:39 PM, Chris Rebert wrote: > On Sun, Nov 18,

Problem with subprocess.call and windows schtasks

2012-11-18 Thread Tom Borkin
Hi, I have this code: #!\Python27\python import subprocess #subprocess.call(['SchTasks /Create /SC ONCE /TN "My Tasks" /TR "C:/Program Files/Apache Group/Apache2/htdocs/ccc/run_alert.py" /ST 07:50'], shell=True) subprocess.call(['SchTasks /Create /SC ONCE /TN "test" /TR "run_alert.py" /ST 07:50']