Python. How to string.split and sort a dictionary.?
-
I'm not sure where to begin here. I have a text-file and I want to split it, add it to a dictionary and then sort it. Do you have any pointers and examples that I can look at? ...show more
-
Answer:
words = open( 'textfile.txt' ).read( ).split( ) words.sort() if the file has words followed by definitions then the code would have 2 or 3 more lines to create a (python) dictionary. But one would need more details on the file format.
I76L4H3JCTHONW3YJHSTIV5YRM at Yahoo! Answers Visit the source
Related Q & A:
- How can I sort a column in a DataGrid?Best solution by Stack Overflow
- How do you store a dictionary on Parse using swift?Best solution by stackoverflow.com
- How do I split a String and keep the delimiters?Best solution by Stack Overflow
- How to delete an entry from a dictionary in Python?Best solution by Stack Overflow
- Can I modify the keys in a dictionary directly for Python?Best solution by stackoverflow.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.