Q
?
A -
Informatica
search
Login
Remember
Register
New Activity
Questions
Unanswered
Tags
Categories
Users
Course
News
FAQs
Do you need any help?
Ask a Question
Notice Board
Prossime date d'esame
SITUAZIONE VOTI AL 24/10/21
-- ESAME ONLINE --
TUTORAGGIO
GUIDE e FAQ
COME PARTECIPARE ALLE VIDEOLEZIONI
REGOLAMENTO DEL CORSO
SOFTWARE DA INSTALLARE
Info sul corso (libro,
diario lezioni
ecc..)
Programming AY20-21 (il nostro corso gemello in Inglese)
Eserciziario Python
WTF Python!
Python Cheatsheet
Time complexity of methods
import antigravity
FAQ
TUTTI GLI HW sono linkati qui sotto
Exams
Test
Grades
Attachments
Esame 18-6-21
check
link
Esame 12-2-21 mattina
check
link
Esame 12-2-21 pomeriggio
check
link
Esame 19-1-21 mattina
check
link
Esame 19-1-21 pomeriggio
check
link
HW8 recupero
link
HW6 recupero
link
HW4 recupero
link
HW8 obbligatorio
check
link
HW7 opzionale
link
HW6 obbligatorio
check
link
HW5 opzionale
link
HW2 recupero
link
HW4 obbligatorio
check
link
HW3 opzionale
link
HW2 obbligatorio
check
link
HW1 opzionale
link
707
questions
1.655
answers
1.988
comments
804
users
Related questions
possibile errore nell' HW5
Errore su png.py
Most popular tags
homework
homework4
hw6
hw4
hw8
homework6
test
python
ricorsione
homework2
homework8
homework-di-recupero
prosodia
recupero
error
esame
hw4rec
peer-assessment
voti
spyder
test-segreti
avvisi
guida
hw2
hw5opz
obbligatorio
timeout
vm
ammessi
homework6-di-recupero
hw6rec
efficienza
eserciziario
hw6req
tempi
caratteri-speciali
immagini
pa
prova-di-esame
#python
rettangoli
soluzioni
tempo
anaconda
classi
images
opzionale
periodo
results
#dizionari
Errore nell'aprire file png HW5
F
Federico Rossi
(710 points)
1
2
5
asked
Nov 16, 2020
in
HW5 opzionale
by
Federico Rossi
(
710
points)
Buonasera,
Cercando di aprire un file png, attraverso la libreria images -> images.load(nome file), riscontro un errore nel prompt Anaconda: Opening file 'nome file' with mode='rb' is forbidden!
175
views
homework
error
hw5
hw5opz
10
2 Answers
Best answer
AdSum
(16290 points)
9
20
134
answered
Nov 16, 2020
by
AdSum
(
16,290
points)
selected
Nov 16, 2020
by
Federico Rossi
Non ti è concesso di aprire il file in modalità lettura binaria (rb)
EDIT:
Sono ammessi solo 'r' ed 'wb'
2
comment
F
Federico Rossi
(710 points)
1
2
5
commented
Nov 16, 2020
by
Federico Rossi
(
710
points)
Mi servirebbe sapere come poter ovviare a questo problema dato che non posso far girare i test.
AdSum
(16290 points)
9
20
134
commented
Nov 16, 2020
by
AdSum
(
16,290
points)
Non sono sicuro ma penso tu lo debba aprire solamente in read mode, ovvero 'r' non 'rb'. Prova e fammi sapere
F
Federico Rossi
(710 points)
1
2
5
commented
Nov 16, 2020
by
Federico Rossi
(
710
points)
Niente, stesso errore solo che con r al posto di rb.
AdSum
(16290 points)
9
20
134
commented
Nov 16, 2020
by
AdSum
(
16,290
points)
R dovrebbe andare, ho controllare personalmente nei file
F
Federico Rossi
(710 points)
1
2
5
commented
Nov 16, 2020
by
Federico Rossi
(
710
points)
Per aprire il file viene utilizzato il metodo load del file images.py il quale apre il file in modalita' rb, anche se cambio quello in r non riesco a far girare i test per l'errore descritto in precedenza.
Su Spyder diversamente i test mi girano.
AdSum
(16290 points)
9
20
134
commented
Nov 16, 2020
by
AdSum
(
16,290
points)
Non so che dirti onestamente
Please
log in
or
register
to add a comment.
andrea.sterbini
(172780 points)
513
935
1789
answered
Nov 16, 2020
by
andrea.sterbini
(
172,780
points)
Il file PNG lo devi generare tu.
1
comment
F
Federico Rossi
(710 points)
1
2
5
commented
Nov 16, 2020
by
Federico Rossi
(
710
points)
Ho risolto, volevo aprire il file PNG generato da me per contare i pixel 'rossi' ma ho fatto con la matrice.
Please
log in
or
register
to add a comment.