Visualizza post

Questa sezione ti permette di visualizzare tutti i post inviati da questo utente. N.B: puoi vedere solo i post relativi alle aree dove hai l'accesso.


Topics - Gianpatrizio

Pagine: [1]
1
Altre tematiche / La idle di python non si avvia
« il: Maggio 22, 2020, 23:14 »
Buongiorno, oggi quando ho aperto la idle di python, insolitamente mi ha dato il seguente errore non rendendomi possibile l'esecuzione del programma.

Avete idee?
Grazie

2
Altre tematiche / Come generare numeri random
« il: Maggio 21, 2020, 15:58 »
Buongiorno, piccola premessa: apro questo topic per pura curiosità infatti non troverete nessun codice. Vorrei sapere se possibile generare dei numeri random senza sfruttare la libreria random, è possibile?
Grazie

3
Buongiorno a tutti, è da un po' di tempo che desidero installare la libreria ChatterBot ma tutte le volte che provo a scaricarla con il comando
pip install ChatterBot

ricevo sempre il solito errore:


C:\Users\Nuovo\AppData\Local\Programs\Python\Python38-32\Scripts>pip install ChatterBot
Collecting ChatterBot
  Using cached https://files.pythonhosted.org/packages/6c/0e/dac0d82f34f86bf509cf5ef3e2dfc5aa7d444bd843a2330ceb7d854f84f2/ChatterBot-1.0.5-py2.py3-none-any.whl
Collecting python-dateutil<2.8,>=2.7 (from ChatterBot)
  Using cached https://files.pythonhosted.org/packages/74/68/d87d9b36af36f44254a8d512cbfc48369103a3b9e474be9bdfe536abfc45/python_dateutil-2.7.5-py2.py3-none-any.whl
Collecting sqlalchemy<1.3,>=1.2 (from ChatterBot)
  Using cached https://files.pythonhosted.org/packages/f9/67/d07cf7ac7e6dd0bc55ba62816753f86d7c558107104ca915e730c9ec2512/SQLAlchemy-1.2.19.tar.gz
Collecting mathparse<0.2,>=0.1 (from ChatterBot)
  Using cached https://files.pythonhosted.org/packages/c3/e5/4910fb85950cb960fcf3f5aabe1c8e55f5c9201788a1c1302b570a7e1f84/mathparse-0.1.2-py3-none-any.whl
Collecting nltk<4.0,>=3.2 (from ChatterBot)
  Using cached https://files.pythonhosted.org/packages/92/75/ce35194d8e3022203cca0d2f896dbb88689f9b3fce8e9f9cff942913519d/nltk-3.5.zip
Collecting spacy<2.2,>=2.1 (from ChatterBot)
  Using cached https://files.pythonhosted.org/packages/1f/e2/46650d03c7ff2b57ed7af211d41c3f606540f7adea92b5af65fcf9f605c0/spacy-2.1.9.tar.gz
  Installing build dependencies ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:\users\nuovo\appdata\local\programs\python\python38-32\python.exe' 'c:\users\nuovo\appdata\local\programs\python\python38-32\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\Nuovo\AppData\Local\Temp\pip-build-env-5rpkkbzn\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools 'wheel>0.32.0,<0.33.0' Cython 'cymem>=2.0.2,<2.1.0' 'preshed>=2.0.1,<2.1.0' 'murmurhash>=0.28.0,<1.1.0' 'thinc>=7.0.8,<7.1.0'
       cwd: None
  Complete output (61 lines):
  Collecting setuptools
    Using cached https://files.pythonhosted.org/packages/a0/df/635cdb901ee4a8a42ec68e480c49f85f4c59e8816effbf57d9e6ee8b3588/setuptools-46.1.3-py3-none-any.whl
  Collecting wheel<0.33.0,>0.32.0
    Using cached https://files.pythonhosted.org/packages/ff/47/1dfa4795e24fd6f93d5d58602dd716c3f101cfd5a77cd9acbe519b44a0a9/wheel-0.32.3-py2.py3-none-any.whl
  Collecting Cython
    Using cached https://files.pythonhosted.org/packages/72/50/870153e12491132899ac364d4d22e951698b12247ef619eac9cb5c3ac38c/Cython-0.29.16-cp38-cp38-win32.whl
  Collecting cymem<2.1.0,>=2.0.2
    Using cached https://files.pythonhosted.org/packages/ce/8d/d095bbb109a004351c85c83bc853782fc27692693b305dd7b170c36a1262/cymem-2.0.3.tar.gz
  Collecting preshed<2.1.0,>=2.0.1
    Using cached https://files.pythonhosted.org/packages/0b/14/c9aa735cb9c131545fc9e23031baccb87041ac9215b3d75f99e3cf18f6a3/preshed-2.0.1.tar.gz
  Collecting murmurhash<1.1.0,>=0.28.0
    Using cached https://files.pythonhosted.org/packages/22/e9/411be1845f1ac07ae3bc40a4b19ba401819baed4fa63b4f5ef28b2300eb4/murmurhash-1.0.2.tar.gz
  Collecting thinc<7.1.0,>=7.0.8
    Using cached https://files.pythonhosted.org/packages/92/39/ea2a3d5b87fd52fc865fd1ceb7b91dca1f85e227d53e7a086d260f6bcb93/thinc-7.0.8.tar.gz
  Collecting blis<0.3.0,>=0.2.1 (from thinc<7.1.0,>=7.0.8)
    Using cached https://files.pythonhosted.org/packages/59/9e/84a83616cbe5daa94909da38b780e93bf566dc2113c3dc35d7b4cad52f63/blis-0.2.4.tar.gz
  Collecting wasabi<1.1.0,>=0.0.9 (from thinc<7.1.0,>=7.0.8)
    Using cached https://files.pythonhosted.org/packages/21/e1/e4e7b754e6be3a79c400eb766fb34924a6d278c43bb828f94233e0124a21/wasabi-0.6.0-py3-none-any.whl
  Collecting srsly<1.1.0,>=0.0.6 (from thinc<7.1.0,>=7.0.8)
    Using cached https://files.pythonhosted.org/packages/c4/28/ffb9f0b940041aeaec2194e840b5ffe19d0ae252de89579fa8b810174d9f/srsly-1.0.2.tar.gz
  Collecting numpy>=1.7.0 (from thinc<7.1.0,>=7.0.8)
    Using cached https://files.pythonhosted.org/packages/95/1b/48ba889a3b734f8bdb851dbeab8a6cbc676f1fb0db0ab762b911f9fec7da/numpy-1.18.3-cp38-cp38-win32.whl
  Collecting plac<1.0.0,>=0.9.6 (from thinc<7.1.0,>=7.0.8)
    Using cached https://files.pythonhosted.org/packages/9e/9b/62c60d2f5bc135d2aa1d8c8a86aaf84edb719a59c7f11a4316259e61a298/plac-0.9.6-py2.py3-none-any.whl
  Collecting tqdm<5.0.0,>=4.10.0 (from thinc<7.1.0,>=7.0.8)
    Using cached https://files.pythonhosted.org/packages/4a/1c/6359be64e8301b84160f6f6f7936bbfaaa5e9a4eab6cbc681db07600b949/tqdm-4.45.0-py2.py3-none-any.whl
  Installing collected packages: setuptools, wheel, Cython, cymem, preshed, murmurhash, numpy, blis, wasabi, srsly, plac, tqdm, thinc
    Running setup.py install for cymem: started
      Running setup.py install for cymem: finished with status 'error'
      ERROR: Command errored out with exit status 1:
       command: 'c:\users\nuovo\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Nuovo\\AppData\\Local\\Temp\\pip-install-8uyk6h_d\\cymem\\setup.py'"'"'; __file__='"'"'C:\\Users\\Nuovo\\AppData\\Local\\Temp\\pip-install-8uyk6h_d\\cymem\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Nuovo\AppData\Local\Temp\pip-record-yylvz4ou\install-record.txt' --single-version-externally-managed --prefix 'C:\Users\Nuovo\AppData\Local\Temp\pip-build-env-5rpkkbzn\overlay' --compile
           cwd: C:\Users\Nuovo\AppData\Local\Temp\pip-install-8uyk6h_d\cymem\
      Complete output (24 lines):
      WARNING: The wheel package is not available.
      running install
      running build
      running build_py
      creating build
      creating build\lib.win32-3.8
      creating build\lib.win32-3.8\cymem
      copying cymem\about.py -> build\lib.win32-3.8\cymem
      copying cymem\__init__.py -> build\lib.win32-3.8\cymem
      package init file 'cymem\tests\__init__.py' not found (or not a regular file)
      creating build\lib.win32-3.8\cymem\tests
      copying cymem\tests\test_import.py -> build\lib.win32-3.8\cymem\tests
      copying cymem\cymem.pyx -> build\lib.win32-3.8\cymem
      copying cymem\cymem.pxd -> build\lib.win32-3.8\cymem
      copying cymem\__init__.pxd -> build\lib.win32-3.8\cymem
      running build_ext
      building 'cymem.cymem' extension
      creating build\temp.win32-3.8
      creating build\temp.win32-3.8\Release
      creating build\temp.win32-3.8\Release\cymem
      C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\nuovo\appdata\local\programs\python\python38-32\include -Ic:\users\nuovo\appdata\local\programs\python\python38-32\include -Ic:\users\nuovo\appdata\local\programs\python\python38-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include" /EHsc /Tpcymem/cymem.cpp /Fobuild\temp.win32-3.8\Release\cymem/cymem.obj /Ox /EHsc
      cymem.cpp
      c:\users\nuovo\appdata\local\programs\python\python38-32\include\pyconfig.h(59): fatal error C1083: Non Š possibile aprire il file inclusione: 'io.h': No such file or directory
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.24.28314\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
      ----------------------------------------
  ERROR: Command errored out with exit status 1: 'c:\users\nuovo\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Nuovo\\AppData\\Local\\Temp\\pip-install-8uyk6h_d\\cymem\\setup.py'"'"'; __file__='"'"'C:\\Users\\Nuovo\\AppData\\Local\\Temp\\pip-install-8uyk6h_d\\cymem\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Nuovo\AppData\Local\Temp\pip-record-yylvz4ou\install-record.txt' --single-version-externally-managed --prefix 'C:\Users\Nuovo\AppData\Local\Temp\pip-build-env-5rpkkbzn\overlay' --compile Check the logs for full command output.
  WARNING: You are using pip version 19.2.3, however version 20.0.2 is available.
  You should consider upgrading via the 'python -m pip install --upgrade pip' command.
  ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\nuovo\appdata\local\programs\python\python38-32\python.exe' 'c:\users\nuovo\appdata\local\programs\python\python38-32\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\Nuovo\AppData\Local\Temp\pip-build-env-5rpkkbzn\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools 'wheel>0.32.0,<0.33.0' Cython 'cymem>=2.0.2,<2.1.0' 'preshed>=2.0.1,<2.1.0' 'murmurhash>=0.28.0,<1.1.0' 'thinc>=7.0.8,<7.1.0' Check the logs for full command output.
WARNING: You are using pip version 19.2.3, however version 20.0.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

Sapete dirmi dove sbaglio?
Grazie in anticipo

4
Videogame / [risolto] La libreria pygame
« il: Aprile 23, 2020, 17:00 »
Buongiorno a tutti, vi anticipo che sono una persona che da poco si è affacciata al linguaggio di programmazione python ma vorrei cercare di imparare il più possibile.
In questi giorni mi sono cimentato nella libreria pygame, e dopo numerosi esperimenti per capire un po' come funzionava, mi sono imbattuto in un problema. Vorrei creare un gioco 2D in qui il personaggio resti fermo e il resto si muove ma dopo avendo fatto decine di tentativi, non riesco a simulare il salto.
Il codice è questo qui:

import pygame

pygame.init()

schermo = pygame.display.set_mode((800, 600))
base = pygame.image.load("base.png")
omino = pygame.image.load("personaggio.png")

def inizializza():
  global basex, basey, base_vely
  global ominox, ominoy
  basex, basey = 0, 281
  base_vely = 0
  ominox, ominoy = 0, 208

inizializza()

def disegna():
  schermo.blit(base, (basex, basey))
  schermo.blit(omino, (ominox, ominoy))

c = True
while c:
  base_vely -= 0.5
  basey += base_vely
 
  pressed = pygame.key.get_pressed()
  if pressed[pygame.K_SPACE]:
    base_vely = + 1
  elif pressed[pygame.K_RIGHT]:
    basex += 1
  elif pressed[pygame.K_LEFT]:
    basex -= 1
  for event in pygame.event.get():
    if event.type == pygame.QUIT:
      c = False

  # collisioni
  if basex >= 380 and basex <= 0 and basey >= 280 and basey <= 280:
    basey = 281
 
  schermo.fill((255, 255, 255))
  disegna()
  pygame.display.update()

pygame.quit()
quit()


Avete idee?
Dimenticavo io uso Windows 10 e python 3.8.2
Grazie a tutti coloro che si renderanno disponibili

Pagine: [1]