Search found 10 matches

by zmaier
Thu Jul 04, 2019 11:42 am
Forum: General Discussion and Questions
Topic: read and delete only one line of a file?
Replies: 2
Views: 128

Re: read and delete only one line of a file?

Ok, thats a good workaround. I have enough room left, so this shouldn't be a problem.
I thought maybe there is a command which reads and deletes one line together.

THX
by zmaier
Thu Jul 04, 2019 7:36 am
Forum: General Discussion and Questions
Topic: read and delete only one line of a file?
Replies: 2
Views: 128

read and delete only one line of a file?

Hello,

Code: Select all

with open(infile,'r') as ifile:
   for line in ifile:
      <do something with line>
      if everthing is iO
         delete line in file
      else   
	 leave line in file         	
How can i do that without using readlines and writelines (since the file is too big for the mem).
by zmaier
Wed Jun 19, 2019 11:39 am
Forum: General Discussion and Questions
Topic: main.mpy is not executed?
Replies: 7
Views: 248

Re: main.mpy is not executed?

ok, this is a good point. An other thing, for example : I init the wifi in boot.py so the object is not visible inside app.run(). When i want to check whether wifi is connected or not with wifi.isconnected(), this is not possible, because wifi is not available? So i have to init the wifi inside the ...
by zmaier
Wed Jun 19, 2019 10:42 am
Forum: General Discussion and Questions
Topic: main.mpy is not executed?
Replies: 7
Views: 248

Re: main.mpy is not executed?

Ok is see, i tried it and the code will be executed.
But still a problem.
Because variables assigned in boot.py aren't available inside the imported code.

eg:
boot.py

Code: Select all

var='test'
main.py

Code: Select all

import abc
abc.py

Code: Select all

print(var)
NameError: name 'var' isn't defined
by zmaier
Wed Jun 19, 2019 10:02 am
Forum: General Discussion and Questions
Topic: main.mpy is not executed?
Replies: 7
Views: 248

Re: main.mpy is not executed?

Hi,

is the workaround really working?
the line "import app" dosn't execute the code inside app.mpy? It just imports functions inside the file, or?

I have to check that.
by zmaier
Wed Jun 19, 2019 6:55 am
Forum: General Discussion and Questions
Topic: main.mpy is not executed?
Replies: 7
Views: 248

main.mpy is not executed?

Hi, sorry for my english, i hope you understand what I am trying to explain :) i am using an Wemos D1 Mini Pro and my main.py file is to big to compile. I got a memory error (problem is well described here in the forum). So i am trying to get rid of that by pre-compiling it. I have the compiled main...
by zmaier
Tue Jun 18, 2019 12:57 pm
Forum: Programs, Libraries and Tools
Topic: [SOLVED] question on mpy-cross
Replies: 21
Views: 918

Re: [SOLVED] question on mpy-cross

Hi, any change to get a running mpy-cross.exe compatilble with windows 64Bit?
by zmaier
Fri May 31, 2019 7:00 am
Forum: General Discussion and Questions
Topic: OSError: no available NIC after Soft-Reset
Replies: 5
Views: 294

Re: OSError: no available NIC after Soft-Reset

I am using a WiPy 3.0.

wlan.mode(WLAN.STA) at any boot type,
I read somewhere, that the connection (telnet repl) will get lost wenn setting the wlan-mode?
by zmaier
Fri May 31, 2019 6:44 am
Forum: General Discussion and Questions
Topic: urequests and timeout?
Replies: 2
Views: 135

urequests and timeout?

Hi everyone. when loosing the wlan-connection (e.g. i turn of the router) my programm hangs at : response = urequests.post(db, data=payload,timeout=timeout_sec) it is not raising a exception, the program hangs for ever at this line. Any idea why? How do you implement a simple post-command? THX Marti...
by zmaier
Thu May 16, 2019 12:47 pm
Forum: General Discussion and Questions
Topic: OSError: no available NIC after Soft-Reset
Replies: 5
Views: 294

OSError: no available NIC after Soft-Reset

Hello, i have a problem, hopefully you can help me. After a soft-reset (CTRL-D in REPL), i get the error that there is no available NIC when using the urequest.post command. After a hard-reset everything is working fine. Propably the re-initialization of the wifi interface is not done right, but the...