Jump to content



Παρακαλω μια βοηθεια σε ενα πολυ απλο θεμα python


Recommended Posts

Αυτη η γραμμη ειναι κομματι ενος python script

 

if file.find('Volumes') > 0:
                filelocation=protocol+":/"+file.replace("Volumes",loginstring+server)
 
 
θελω αντι για Volumes να αντικαθιστα volume1, volume2, volume3, volume4 . Πως το κανω αυτο;
 
Ευχαριστω πολυ
Link to comment
Share on other sites

 

Αυτη η γραμμη ειναι κομματι ενος python script

 

if file.find('Volumes') > 0:
                filelocation=protocol+":/"+file.replace("Volumes",loginstring+server)
 
θελω αντι για Volumes να αντικαθιστα volume1, volume2, volume3, volume4 . Πως το κανω αυτο;
 
Ευχαριστω πολυ

 

for ( var i = 1 ; i <5 ;i++ ) {

var volumeName = string.format( {0}{1},"volume", i );

if file.find(volumeName) > 0:

                filelocation=protocol+":/"+file.replace(volumeName,loginstring+server)
}
 
Σε C# ειναι βεβαια γιατι βαριεμαι να το ψαχνω τις εντολες για python, but you get the idea.
Έγινε επεξεργασία από papakaliati
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Δημιουργία...

Important Information

Ο ιστότοπος theLab.gr χρησιμοποιεί cookies για να διασφαλίσει την καλύτερη εμπειρία σας κατά την περιήγηση. Μπορείτε να προσαρμόσετε τις ρυθμίσεις των cookies σας , διαφορετικά θα υποθέσουμε ότι είστε εντάξει για να συνεχίσετε.