python - Splitting a string @ once using different seps -


  datetime = '0000-00-00 00: 00: 00'.split (' - ')   

अभी यह सिर्फ हाफ़ेन पर विभाजन करता है, लेकिन क्या इस स्ट्रिंग को दोनों -'एस और '' में विभाजित करना संभव है?

  वर्ष, महीनों, दिन = the_string.split ('-') = "पाठ" ) दिन, समय = दिन.split ('') समय = समय.split (':')  

या यह, जो आपके डेटा को बेहतर फिट बैठता है।

 < कोड> दिनांक, समय = the_string.split ('') साल, महीनों, दिनों = तिथि। स्रोत ('-') घंटे, मिनट, सेकंड = समय.split (":")  
< / div>

Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -