0
I am building a code to retain any command made by the keyboard, they will be published in a topic of the ROS structure to control a mobile robot. I’m not very familiar with Python, the most I could about data storage was the code below... For example, let’s assume that the directional to the left is typed, I need to store that it was pressed to, just then, inform the robot that it must move in such a way.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
arq = open('/home/lucas/Área de Trabalho/robosmoveis2018/dados.txt', 'w')
text = """
Lista
---
1
2
3
"""
arq.write(text)
arq.close()
Your question will probably be closed, but in the meantime I’ll leave this link, goes from the basic concepts to what you want to do, good luck ;) And I recommend that you do the tour
– Tuxpilgrim
But what is the content of this
dados.txt
? If it is text commands I don’t see how your question is different from a "how to read content from a python file ?" , which already has several. And your question is to build the archive or read ? Still very confused and unclear the question. Be as objective as possible in what you’ve already done, in what you need to do, and how you need what you’ve done.– Isac