Jump to content
View in the app

A better way to browse. Learn more.

Tinkerunity

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Python] +Flask: Problem mit Web-Interface (Py 3.5 -- 2.7)

Featured Replies

Geschrieben

Ich hab da eine kleine Python-Flask-Webapp, die einige Messwerte aus TF-Sensoren auf eine Webseite bringt. Was auf dem Windows- und dem Linux-Computer einwandfrei funktioniert. Nur auf dem Redbrick nicht. Der Server verweigert die Ausgabe -- "Internal Server Error" und zwar laut Apache Error Log wegen der misslingenden Initialisierung einer Basisklasse:

super( ).__init__(), referer: http://[iP Adresse...]
... TypeError: super() takes at least 1 argument (0 given),

Die App ist Python 3.52, aber an dem Error Log kann man sehen, dass das Web Interface des Bricks mit 2.7-Modulen arbeitet ('/usr/local/lib/python2.7/dist-packages/flask/app.py). Ich habe versucht, die Initialisierung in "alter", Python-2-Schreibweise, unter anderem:

super(TemperatureBricklet, self).__init__()

zu bewerkstelligen, bislang ohne Erfolg.

Mal abgesehen davon, wäre es natürlich besser, wenn auch das Web-Interface wenigstens mit 3.42 arbeitete. Die Wahl hat man da -- anders als bei Skriptausführung -- offenbar nicht. Nur wegen ein paar abgeleiteten Klassen auf 2.7 zurückzugehen, finde ich eine schlechte Lösung.

- md

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Gast
Reply to this topic...

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.