public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
* Python not reading result from bash command
@ 2015-11-23  9:02 Aaron Schneider
  2015-11-23  9:04 ` Aaron Schneider
  0 siblings, 1 reply; 5+ messages in thread
From: Aaron Schneider @ 2015-11-23  9:02 UTC (permalink / raw)
  To: cygwin-apps

Trying to read an argument as string, however doesn't work on python for cygwin. Tested on Python 3.5.0 (32-bit) from Python Software Foundation and works perfectly.

test.py:
import datetime
import sys
my_date = str(sys.argv[1])
temp_date = datetime.datetime.strptime(some_date, "%Y%m%d%H%M%S")

$ python test.py $(adb shell 'su 0 date +"%Y%m%d%H%M%S"')
Traceback (most recent call last):
  File "test.py", line 32, in <module>
    temp_date = datetime.datetime.strptime(some_date, "%Y%m%d%H%M%S")
  File "/usr/lib/python2.7/_strptime.py", line 328, in _strptime
    data_string[found.end():])
ValueError: unconverted data remains: 		 	   		  

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-11-23 15:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-23  9:02 Python not reading result from bash command Aaron Schneider
2015-11-23  9:04 ` Aaron Schneider
2015-11-23  9:13   ` Marco Atzeri
2015-11-23  9:26     ` Aaron Schneider
2015-11-23 15:03       ` cyg Simple

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).