Please ignore secret bonuses. Secret tests do NOT award bonus. Max hw grade is 30+2 bonus efficiency
Q
?
A -
Informatica
search
Login
Remember
Register
New Activity
Questions
Unanswered
Tags
Categories
Users
Course
News
FAQs
Do you need help?
Ask a Question
Notice Board
Situazione finale voti HW
Eserciziario Python
WTF Python!
Exams
Test
Grades
Attachments
Esame 6-11-19
check
RECUPERO Homework 1
link
RECUPERO Homework 2
link
RECUPERO Homework 3
link
RECUPERO Homework 4
link
Esame 19-9-19
check
link
Esame 16-7-19
check
link
Esame 24-6-19
check
link
Esame 10-4-19
check
link
Esame 31-1-19
check
link
Esame 8-1-19
check
link
Homework 4
link
Homework 3
check
link
Homework 2
check
link
Homework 1
check
link
1.162
questions
1.988
answers
3.710
comments
591
users
Related questions
Dubbio HW4 Es3
Separatore path macchina virtuale
hw4 es3 test segreti
Possibile errore nei test segreti Es3 HW4?
linee verticali es3 hw4
Most popular tags
esercizio3
homework3
es3
homework
es2
es1
hw3
homework1
homework4
homework2
esercizio1
esercizio2
avvisi
hw4
hw2bis
peer-assessment
python
hw4bis
problema
prova-di-esame
homework-di-recupero
hw3bis
hw2
voti
esame
test
ricorsione
consegna
hw1bis
tempi
aiuto
homework2bis
errore
librerie
dizionari
consigli
risultati
liste
scadenze
attore
feedback
ricalcolo-classifica
leggibilità
zip
hw1
research
oggetti
esercizio
metodi
program_03
Categories
Announcements
(13)
Intro. to Programming and Lab AA22-23 (Latina)
(14)
Programming AY20-21
(123)
Programming AY21-22
(205)
Programming AY22-23
(296)
Programming AY23-24
(182)
Fondamenti di programmazione AA18-19
(1.2k)
Info sul corso e sugli esami
(278)
Homework
(650)
Homework 1
(165)
Homework 2
(149)
Homework 3
(216)
Homework 4
(120)
Es1
(48)
Es2
(26)
Es3
(46)
Programmare in python
(31)
Avvisi
(65)
Homework di recupero
(138)
Fondamenti di Programmazione AA19-20
(436)
Fondamenti di Programmazione AA20-21
(708)
Fondamenti di programmazione AA21-22
(366)
Fondamenti di programmazione AA22-23
(564)
Fondamenti di programmazione AA23-24
(349)
Other
(26)
Anni precedenti
(784)
Architetture degli elaboratori AA20-21
(3)
BUG BOUNTY / IMPROVEMENTS
(4)
Dubbio path Es3 hw4
a.capobianco1
(16770 points)
14
54
165
asked
Dec 27, 2018
in
Es3
by
a.capobianco1
(
16.8k
points)
In VM, La path passata come parametro alla funz Es3 è comprensiva della directory dirs oppure le cartelle da testare sono tutte nello stesso percorso del file prog3. Py?
718
views
closed
5
1
Answer
Best answer
_andrea_
(45670 points)
13
42
297
answered
Dec 27, 2018
by
_andrea_
(
45.7k
points)
selected
Dec 27, 2018
by
a.capobianco1
Fallo come lo faresti sul tuo pc, poi sulla VM funziona non preoccuparti
3
comment
a.capobianco1
(16770 points)
14
54
165
commented
Dec 27, 2018
by
a.capobianco1
(
16.8k
points)
Ok. Allora è compresa. Questo mi porta ad un'altra domanda collegata... Se ho 'dirs//informatica' come faccio a estrapolare 'informatica' così da poterlo disegnare?
_andrea_
(45670 points)
13
42
297
commented
Dec 27, 2018
by
_andrea_
(
45.7k
points)
Iterando su listdir ottieni i nomi senza percorso, quindi facendo for i in os.listdir(path) dove path è il percorso di Informatica, ottieni direttamente "Hardware" e "Software" ecc
a.capobianco1
(16770 points)
14
54
165
commented
Dec 27, 2018
by
a.capobianco1
(
16.8k
points)
Ho capito. Ma io nel test in locale, passo come parametro path 'dirs//informatica' come è trovo tutti i figli di 'informatica' ma non 'informatica' stesso... Premetto che non ho ancora lanciato il test03 perché sto lavorando solo su informatica al fine di ottenere un png identico.... Il test03 quali 'path' testa?
_andrea_
(45670 points)
13
42
297
commented
Dec 27, 2018
by
_andrea_
(
45.7k
points)
Splittalo su "/"
a.capobianco1
(16770 points)
14
54
165
commented
Dec 27, 2018
by
a.capobianco1
(
16.8k
points)
Che stupido :)) quasi quasi mi vergogno... Troppo tempo davanti al pc.... Mi stavo perdendo nei meandri dei metodi di OS per nulla...
Grazie
a.capobianco1
(16770 points)
14
54
165
commented
Dec 27, 2018
by
a.capobianco1
(
16.8k
points)
Aspetta però... Non è che con altre piattaforme potrei avere problemi? Io ho Windows... Invece la VM non è win
_andrea_
(45670 points)
13
42
297
commented
Dec 27, 2018
by
_andrea_
(
45.7k
points)
Io ho splittato per ottenere il nome e poi ovviamenre per la ricorsione ho usato il nome intero per andare nelle sottocartelle
a
alex_err
(5800 points)
1
3
32
commented
Dec 27, 2018
by
alex_err
(
5.8k
points)
Esiste anche la funzione os.path.basename se vi può essere utile ;)
_andrea_
(45670 points)
13
42
297
commented
Dec 27, 2018
by
_andrea_
(
45.7k
points)
Sarebbe utile capire se è più veloce split o quella, ma penso non cambi nulla
a
alex_err
(5800 points)
1
3
32
commented
Dec 27, 2018
by
alex_err
(
5.8k
points)
Fa esattamente uno split, quindi non cambia nulla, però se vuoi puntare sull'efficienza listdir ti dà il nome del file e non l'intero percorso.
os.path.basename lo usi solo sulla path in ingresso, sugli altri nodi prendi semplicemente il nome del file dal for.
a.capobianco1
(16770 points)
14
54
165
commented
Dec 27, 2018
by
a.capobianco1
(
16.8k
points)
ottimo!!! grazie
Please
log in
or
register
to add a comment.