Welche Programmiersprache nach javascript?

ich hab eine lange zeit nichts anderes als javascript gemacht darunter ist auch Typescript und react und vieles mehr und klar man kann noch mehr lernen. Php kann ich ausreichend fürs backend.

aber immer auf den Browser beschränkt zu sein und websites macht auf Dauer keinen spass. Ich will auch in der lage sein desktop programme zu schreiben.
electron js kann das aber ist auch nicht das beste was man nutzen kann und sobalds aufwendiger wird hat man Probleme und riesige Dateien. Man lernt auch nichts neues dadurch das ist nichts für mich.

c# c++ c java oder rust hatte ich im kopf.

(python syntax gefällt mir auch nicht , mir geht es auch ums lernen. Nicht nur mit pip install irgendwas nutzen von jemand anderes. Am ende hast du keine ahnung von der programmierung)

aber wie weiss ich welches der oben genannten Sprachen eher was für mich ist.

Java ist Typescript sehr ähnlich, läuft überall und ich könnte da schnell zurechtkommen aber dafür ist es deutlich langsamer als C++ und nicht so mächtig.

Mit c++ lernst du auch viel und wird oft in Unis oder Schulen gelehrt, hätte damit einen vorteil wenn ich es schon gut kann.
Rust hat einen kleinen hype und viele meinen es wird in zukunft wichtiger werden = mehr jobs.

c# ist soweit ich weiss
nur für windows Anwendungen gut, mit den anderen sprachen könnte man auch in zukunft was für linux machen wenn man lust drauf hat.

ich seh da keinen grossartigen vorteil zu java oder c++ in der schnelligkeit.

Computer, Microsoft, App, IT, Webseite, Java, JavaScript, compiler, Cplusplus, C Sharp, CPP, Informatik, Oracle, Programmiersprache, Python, sdk, C (Programmiersprache), React, Angular
Ki auf Raspberry Pi?

Hallo Leute ich habe ein Video bei YouTube gesehen wo einer einen gpt voice assistent in Python Code auf einen Raspberry Pi installiert und benutzt. Ich habe dass mal ausprobiert aus Spaß und hätte gerne gewusst wie man 1. Eine weibliche Stimme statt einer Männlichen Stimme benutzen kann und 2. Die Sprachausgabe in Deutsch einstellen kann habe den Python Code mal hier rein kopiert hoffe ihr könnt mir helfen. Ein paar Sachen habe ich wie zum Beispiel language en auf de umgestellt leider klappt dass nicht so ganz.

Danke im vorraus

import os

import openai

from dotenv import load_dotenv

import time

import speech_recognition as sr

import pyttsx3

import numpy as np

from gtts import gTTS

import subprocess

mytext = 'Welcome to me'

language = 'en'

# from os.path import join, dirname

# import matplotlib.pyplot as plt

# ^ matplotlib is great for visualising data and for testing purposes but usually not needed for production

openai.api_key=' '

load_dotenv()

model = 'gpt-3.5-turbo'

# Set up the speech recognition and text-to-speech engines

r = sr.Recognizer()

engine = pyttsx3.init("dummy")

voice = engine.getProperty('voices')[1]

engine.setProperty('voice', voice.id)

name = "YOUR NAME HERE"

greetings = [f"whats up master {name}",

       "yeah?",

       "Well, hello there, Master of Puns and Jokes - how's it going today?",

       f"Ahoy there, Captain {name}! How's the ship sailing?",

       f"Bonjour, Monsieur {name}! Comment ça va? Wait, why the hell am I speaking French?" ]

# Listen for the wake word "hey pos"

def listen_for_wake_word(source):

  print("Listening for 'Hey'...")

  while True:

    audio = r.listen(source)

    try:

      text = r.recognize_google(audio)

      if "hey" in text.lower():

        print("Wake word detected.")

        engine.say(np.random.choice(greetings))

        engine.runAndWait()

        listen_and_respond(source)

        break

    except sr.UnknownValueError:

      pass

# Listen for input and respond with OpenAI API

def listen_and_respond(source):

  print("Listening...")

  while True:

    audio = r.listen(source)

    try:

      text = r.recognize_google(audio)

      print(f"You said: {text}")

      if not text:

        continue

      # Send input to OpenAI API

      response = openai.ChatCompletion.create(model="gpt-3.5-turbo", messages=[{"role": "user", "content": f"{text}"}])

      response_text = response.choices[0].message.content

      print(response_text)

      #myobj = gTTS(text = response_text, lang = language, slow = False)

      #myobj.save("test.wav")

      #os.system("aplay test.wav")

      # Speak the response

      print("speaking")

      os.system("espeak ' "+response_text + "'")

      engine.say(response_text)

      engine.runAndWait()

      if not audio:

        listen_for_wake_word(source)

    except sr.UnknownValueError:

      time.sleep(2)

      print("Silence found, shutting up, listening...")

      listen_for_wake_word(source)

      break

    except sr.RequestError as e:

      print(f"Could not request results; {e}")

      engine.say(f"Could not request results; {e}")

      engine.runAndWait()

      listen_for_wake_word(source)

      break

# Use the default microphone as the audio source

with sr.Microphone() as source:

  listen_for_wake_word(source)

Code, künstliche Intelligenz, Python, ChatGPT
discord.py AttributeError: 'ClientUser' object has no attribute 'avatar_url'?
Hi, 

ich bau momentan einen discord Bot mit python der ein Formular strten soll.

Code:

@bot.command()
async def testform(ctx):
    form = Form(ctx,'Title')
    form.add_question('Question 1','first')
    form.add_question('Question 2','second')
    form.add_question('Question 3','third')
    await form.start()

Error:

2023-09-09 08:58:09 ERROR    discord.ext.commands.bot Ignoring exception in command testform
Traceback (most recent call last):
  File "/usr/local/python/3.10.4/lib/python3.10/site-packages/discord/ext/commands/core.py", line 235, in wrapped
    ret = await coro(*args, **kwargs)
  File "/workspaces/moon/dir/.py/homeworkBOT/main.py", line 43, in testform
    await form.start()
  File "/usr/local/python/3.10.4/lib/python3.10/site-packages/discord/ext/forms/form.py", line 221, in start
    embed.set_author(name=f"{self.title}: {n+1}/{len(self._questions)}", icon_url=self._bot.user.avatar_url)
AttributeError: 'ClientUser' object has no attribute 'avatar_url'


The above exception was the direct cause of the following exception:


Traceback (most recent call last):
  File "/usr/local/python/3.10.4/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 1350, in invoke
    await ctx.command.invoke(ctx)
  File "/usr/local/python/3.10.4/lib/python3.10/site-packages/discord/ext/commands/core.py", line 1029, in invoke
    await injected(*ctx.args, **ctx.kwargs)  # type: ignore
  File "/usr/local/python/3.10.4/lib/python3.10/site-packages/discord/ext/commands/core.py", line 244, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'ClientUser' object has no attribute 'avatar_url'

Ich verstehe nicht was mit 'avatar_url' gemeint ist da ich diese nicht in meinem Code benutze.

Ich hoffe jemand kann mir helfen.

Code, Python, Forms, Python 3, Discord, Discord Bot

Meistgelesene Fragen zum Thema Python