How to save an input value to a file?
Forumsregeln
Bitte beachte die Forumsregeln!
Bitte beachte die Forumsregeln!
How to save an input value to a file?
Hi,
i just bought a txt4.0, in testing how to read/write csv file through python code in robo pro coding
may i ask how?
it is showing in console, just not writing anything to file, anything i did wrong?
thanks
Jonathan
i just bought a txt4.0, in testing how to read/write csv file through python code in robo pro coding
may i ask how?
it is showing in console, just not writing anything to file, anything i did wrong?
thanks
Jonathan
- Dateianhänge
-
- switch.png (125.7 KiB) 2497 mal betrachtet
- fishfriend
- Beiträge: 1643
- Registriert: 26 Nov 2010, 11:45
Re: How to save an input value to a file?
Hallo...
I am not shure.
If the Button ist presed, you want to write -one- time s.t. like utf8 ?
It do not added something to a file. ('a')
Mit freundlichen Grüßen
Holger
I am not shure.
If the Button ist presed, you want to write -one- time s.t. like utf8 ?
It do not added something to a file. ('a')
Mit freundlichen Grüßen
Holger
ft Riesenräder PDF: ftcommunity.de/knowhow/bauanleitungen
TX-Light: Arduino und ftduino mit RoboPro
TX-Light: Arduino und ftduino mit RoboPro
Re: How to save an input value to a file?
HiHi!!!
[Question 1]
i want to write the word "close" into file everytime i pressed a button
i want to know how to write value into a local file
check user guide, its showing empty~~LOL? so that i can add timestamp later on and "mimic" IoT locally
as now i seriosuly struggling with ft MQTT
[Question 2]
if doesn't change the file path, where exactly will the file been saved?
until now no luck, need some light here
thanks
Jonathan
[Question 1]
i want to write the word "close" into file everytime i pressed a button
i want to know how to write value into a local file
check user guide, its showing empty~~LOL? so that i can add timestamp later on and "mimic" IoT locally
as now i seriosuly struggling with ft MQTT
[Question 2]
if doesn't change the file path, where exactly will the file been saved?
until now no luck, need some light here

thanks
Jonathan
- fishfriend
- Beiträge: 1643
- Registriert: 26 Nov 2010, 11:45
Re: How to save an input value to a file?
Hallo...
Maybe in Python not in RoboPro Coding.
...
datei = open('test_data.cvs','a')
datei.write("\r\nClose")
so you get:
Close
Close
...
in test_data.cvs
Mit freundlichen Grüßen
Holger
Maybe in Python not in RoboPro Coding.
...
datei = open('test_data.cvs','a')
datei.write("\r\nClose")
so you get:
Close
Close
...
in test_data.cvs
Mit freundlichen Grüßen
Holger
ft Riesenräder PDF: ftcommunity.de/knowhow/bauanleitungen
TX-Light: Arduino und ftduino mit RoboPro
TX-Light: Arduino und ftduino mit RoboPro
Re: How to save an input value to a file?
Hallo,
did you know where is "/home/ftgui" filepath?
code seem correct, but cant locate the file
tyty
Jonathan
did you know where is "/home/ftgui" filepath?
code seem correct, but cant locate the file
tyty
Jonathan
- fishfriend
- Beiträge: 1643
- Registriert: 26 Nov 2010, 11:45
Re: How to save an input value to a file?
Hallo...
My point of view
os.chdir
only change the path
but in r" "
That ist not the correct name of the path.
The print only show the path where the file test_data.cvs is / is written.
So you find the file test_data.cvs in: home/ftgui/
Mit freundlichen Grüßen
Holger
My point of view
os.chdir
only change the path
but in r" "
That ist not the correct name of the path.
The print only show the path where the file test_data.cvs is / is written.
So you find the file test_data.cvs in: home/ftgui/
Mit freundlichen Grüßen
Holger
ft Riesenräder PDF: ftcommunity.de/knowhow/bauanleitungen
TX-Light: Arduino und ftduino mit RoboPro
TX-Light: Arduino und ftduino mit RoboPro
Re: How to save an input value to a file?
Hihi
i have no idea where [home/ftgui/] come from, its not from my pc directory
allow me to post some screenshot, as noticed the file path seem cant be changed
thanks
Jonathan
i have no idea where [home/ftgui/] come from, its not from my pc directory
allow me to post some screenshot, as noticed the file path seem cant be changed
thanks
Jonathan
- fishfriend
- Beiträge: 1643
- Registriert: 26 Nov 2010, 11:45
Re: How to save an input value to a file?
Hallo...
Hmmm...
Is there under User... a direktory ...99_trestData ?
And it is in the OneDireve -Cloud?
Maybe ist ist easyer to get only the User/Document dir on your own computer.
Mit freundlichen Grüßen
Holger
Hmmm...
Is there under User... a direktory ...99_trestData ?
And it is in the OneDireve -Cloud?
Maybe ist ist easyer to get only the User/Document dir on your own computer.
Mit freundlichen Grüßen
Holger
ft Riesenräder PDF: ftcommunity.de/knowhow/bauanleitungen
TX-Light: Arduino und ftduino mit RoboPro
TX-Light: Arduino und ftduino mit RoboPro
Re: How to save an input value to a file?
Hi,
the directory had successfully changed
the main issue is, the [home/ftgui], the front part of directory seem unable to change so the file is written to [home/ftgui] where i dont know where is it
thanks
Jonathan
the directory had successfully changed
the main issue is, the [home/ftgui], the front part of directory seem unable to change so the file is written to [home/ftgui] where i dont know where is it

thanks
Jonathan
- fishfriend
- Beiträge: 1643
- Registriert: 26 Nov 2010, 11:45
Re: How to save an input value to a file?
Hallo...
RoboPro Coding is not installed like the normal Programs. It is installed as a Aplikation App.
There are hidden direktorys some thing leike Windows/App/RoboProCoding/...
May be there is your lost direktory.
An other ting is, wehen you logt in Windows, not as an Admin or a User who has not read acsess to that.
Mit freundlichen Grüßen
Holger
RoboPro Coding is not installed like the normal Programs. It is installed as a Aplikation App.
There are hidden direktorys some thing leike Windows/App/RoboProCoding/...
May be there is your lost direktory.
An other ting is, wehen you logt in Windows, not as an Admin or a User who has not read acsess to that.
Mit freundlichen Grüßen
Holger
ft Riesenräder PDF: ftcommunity.de/knowhow/bauanleitungen
TX-Light: Arduino und ftduino mit RoboPro
TX-Light: Arduino und ftduino mit RoboPro
- fishfriend
- Beiträge: 1643
- Registriert: 26 Nov 2010, 11:45
Re: How to save an input value to a file?
Hallo...
OK, it is possible that the file is on the TXT 4.0 ?
So, i know it from the AI-Sortingline that the LOG-File is there.
Mit freundlichen Grüßen
Holger
OK, it is possible that the file is on the TXT 4.0 ?
So, i know it from the AI-Sortingline that the LOG-File is there.
Mit freundlichen Grüßen
Holger
ft Riesenräder PDF: ftcommunity.de/knowhow/bauanleitungen
TX-Light: Arduino und ftduino mit RoboPro
TX-Light: Arduino und ftduino mit RoboPro
Re: How to save an input value to a file?
Hihi,
just checked in windows app, folder and subfolder all, not there search on txt4.0, not there either
from your experience, is this how ft work?
let us user self study to dig out product info?
tyty
just checked in windows app, folder and subfolder all, not there search on txt4.0, not there either
from your experience, is this how ft work?
let us user self study to dig out product info?
tyty
- fishfriend
- Beiträge: 1643
- Registriert: 26 Nov 2010, 11:45
Re: How to save an input value to a file?
Hallo...
IF you use wlan or USB (or BT).
Check the IP Adress on the TXT 4.0. Linke: 192.168.2.101
Info/WLan
Take a browser, insert the IP Ardess.
Then you must insert: ft
and in the second Line: fischertechnik
And now go to TXT 4.0 folder.
Ther are a direktory(s) where the file (may be) is.
The upper dir (I think that ist the /ft/GUI)
Cause the Python Program runs on the TXT 4.0.
The TXT 4.0 has no permission to write a file on the PC.
Mit freundlichen Grüßen
Holger
IF you use wlan or USB (or BT).
Check the IP Adress on the TXT 4.0. Linke: 192.168.2.101
Info/WLan
Take a browser, insert the IP Ardess.
Then you must insert: ft
and in the second Line: fischertechnik
And now go to TXT 4.0 folder.
Ther are a direktory(s) where the file (may be) is.
The upper dir (I think that ist the /ft/GUI)
Cause the Python Program runs on the TXT 4.0.
The TXT 4.0 has no permission to write a file on the PC.
Mit freundlichen Grüßen
Holger
ft Riesenräder PDF: ftcommunity.de/knowhow/bauanleitungen
TX-Light: Arduino und ftduino mit RoboPro
TX-Light: Arduino und ftduino mit RoboPro
Re: How to save an input value to a file?
Hi
thanks, i learn something from you today
dont know ft txt4.0 can be access in such as way i search through all folder, no file to be seen i try manual key in ft/gui, not here
**studying the new AI sorting line, found out "ui" path, share with you below is usual txt4.0 controller, will show node-red dashboard @_@
thanks
Jonathan
thanks, i learn something from you today

dont know ft txt4.0 can be access in such as way i search through all folder, no file to be seen i try manual key in ft/gui, not here
**studying the new AI sorting line, found out "ui" path, share with you below is usual txt4.0 controller, will show node-red dashboard @_@
thanks
Jonathan
- fishfriend
- Beiträge: 1643
- Registriert: 26 Nov 2010, 11:45
Re: How to save an input value to a file?
Hallo...
The AI Program stored two Files.
1. A log.txt File and
2. last-image.png picture.
If you look in the AI Program.
The "logging" is with
import logging
logging.basicConfig(level=logging.ERROR, format="%(asctime)s %(levelname)-10s %(funcName)3s %(message)s #%(filename)3s:%(lineno)d")
May be you can wirte other things in the file.
But there must be a way without the logging.
I will search about it, but it take some time in the moment.
There a saveral ways, to connect the PC with the TXT 4.0 . SSH, Node Red, MQTT ...
Mit freundlichen Grüßen
Holger
The AI Program stored two Files.
1. A log.txt File and
2. last-image.png picture.
If you look in the AI Program.
The "logging" is with
import logging
logging.basicConfig(level=logging.ERROR, format="%(asctime)s %(levelname)-10s %(funcName)3s %(message)s #%(filename)3s:%(lineno)d")
May be you can wirte other things in the file.
But there must be a way without the logging.
I will search about it, but it take some time in the moment.
There a saveral ways, to connect the PC with the TXT 4.0 . SSH, Node Red, MQTT ...
Mit freundlichen Grüßen
Holger
ft Riesenräder PDF: ftcommunity.de/knowhow/bauanleitungen
TX-Light: Arduino und ftduino mit RoboPro
TX-Light: Arduino und ftduino mit RoboPro