strings for beginers

Discussion in 'Python' started by Sapote, Mar 7, 2009.

  1. Sapote

    Sapote Guest

    I am attempting to modify a python program (Discspan) that I
    downloaded from sourceforge. I know nothing of Python and little of
    programming.

    The program will back ups large numbers of files to to multiple
    DVDs. The burning routine was rather primitive I have modified the
    burn burn_cmd to write an iso file to the hard drive. Unnfortunately
    I do not understand the string building that is going on here

    I have an incrementing variable disc_num that I could insert in the
    line below to create discspanisoX.iso where X is incrementing...

    burn_cmd = "mkisofs -udf -o /home/donkey/discspaniso.iso -graft-
    points --path-list %s" %(temp_list)

    ^^^^^
     
    Sapote, Mar 7, 2009
    #1
    1. Advertisements

  2. Sapote

    Tim Wintle Guest

    On Sat, 2009-03-07 at 12:53 -0800, Sapote wrote:
    > I have an incrementing variable disc_num that I could insert in the
    > line below to create discspanisoX.iso where X is incrementing...
    >
    > burn_cmd = "mkisofs -udf -o /home/donkey/discspaniso.iso -graft-
    > points --path-list %s" %(temp_list)


    burn_cmd = "mkisofs -udf -o /home/donkey/discspaniso%d.iso
    -graft-points --path-list %s" %(x,temp_list)

    (i.e. %d for an integer, %s for a string, %f for a float etc.)
     
    Tim Wintle, Mar 7, 2009
    #2
    1. Advertisements

  3. Sapote

    Tim Wintle Guest

    On Sat, 2009-03-07 at 21:25 +0000, Tim Wintle wrote:
    > burn_cmd = "mkisofs -udf -o /home/donkey/discspaniso%d.iso
    > -graft-points --path-list %s" %(x,temp_list)


    obviously I meant to say

    burn_cmd = "mkisofs -udf -o /home/donkey/discspaniso%
    d.iso-graft-points --path-list %s" %(disc_num,temp_list)

    - hadn't noticed the variable was disc_num.

    Full explanation should be easily found on Google.
     
    Tim Wintle, Mar 7, 2009
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Skywise
    Replies:
    11
    Views:
    4,925
  2. Kurt Krueckeberg
    Replies:
    2
    Views:
    827
    =?ISO-8859-1?Q?Ney_Andr=E9_de_Mello_Zunino?=
    Nov 17, 2004
  3. Rick

    Comparing strings from within strings

    Rick, Oct 21, 2003, in forum: C Programming
    Replies:
    3
    Views:
    516
    Irrwahn Grausewitz
    Oct 21, 2003
  4. Klaus Neuner
    Replies:
    7
    Views:
    788
    Klaus Neuner
    Jul 26, 2004
  5. Ben

    Strings, Strings and Damned Strings

    Ben, Jun 22, 2006, in forum: C Programming
    Replies:
    14
    Views:
    1,072
    Malcolm
    Jun 24, 2006
  6. Replies:
    6
    Views:
    494
    blangela
    Mar 9, 2007
  7. Additya

    Html for Beginers

    Additya, Dec 8, 2009, in forum: HTML
    Replies:
    9
    Views:
    730
    Jukka K. Korpela
    Dec 10, 2009
  8. Replies:
    1
    Views:
    350
    Seebs
    Nov 9, 2010
Loading...