Search:

Type: Posts; User: cardboardtoast; Keyword(s):

Search: Search took 0.02 seconds.

  1. Replies
    35
    Views
    1,604

    Re: python question

    Let me see if I can help =)

    Open the editor, save the file as filename.py


    open the regular terminal, not the python "terminal" and type:
    python filename.py

    The stickies for the forum. ...
  2. Poll: Re: Kirk with Redshirts VS Darth Vader with Stormtroopers

    I think Darth would win cause 1 reason--The force can move objects right (as seen in like all the movies)? What is stopping darth from just flipping kirks teams weapons in their hands and mentally...
  3. Re: Changing files with python

    ah, I had the .join in the wrong place...

    THanks, that got it!:popcorn:
  4. Re: Changing files with python

    Ok, heres the input file:


    if I say morningtide-goblin_3, it should output with the goblin's 5 getting +3:



    and if I add a completely new one ie- new-creature_3:
    It should put out:
  5. Re: Changing files with python

    for line in fileinput.input('mtgcollection.txt',inplace=1):
    if not newcardlist.split('_')[0] in line.split('_')[0]:
    print line.rsplit()
    fileinput.close()
    why is this always printing...
  6. Re: Changing files with python

    damoxc: Unfortunatly, that seems to have the same problem as I am having:

    when I go look in the file, I see this:

    line1here
    line2here
    line3here
    newline2here

    leaving the old line 2 in the...
  7. [SOLVED] Changing files with python

    Hi,

    I have been trying to figure out how to remove lines in a text file, but can't figure out how...

    ie- if I have this:

    line1here
    line2here
    line3here
  8. Replies
    143
    Views
    18,365

    Re: [Beginner] Programming Challenge: 5

    Thanks for the explanation. So, a "structured" programing language is linear? (I think that is what is being said) What makes OOP non-linear? Sorry, but I don't know much about either..:(

    hope...
  9. Replies
    143
    Views
    18,365

    Re: [Beginner] Programming Challenge: 5

    ah, thanks!

    Here's mine:

    #!/usr/bin/env python
    import random
    Tries = 0
    myGuess = -1
    Randomnum = random.choice(range(1,101))
  10. Replies
    143
    Views
    18,365

    Re: [Beginner] Programming Challenge: 5

    What exactly ARE the rules??? I read the "structured programming" link, but that left me confused...:( Do we just make a number guessing program, or do we have to do it a special way?

    mosty...
  11. Replies
    137
    Views
    17,159

    Re: [Beginner] Programming Challenge: 4

    Umm...I'm a spy?:rolleyes: Nope, just was tired and in a rush...fixed

    Some of us didn't even know what urllib was before we did this(or that it was a "cop-out"), and stop making me look...
  12. Replies
    137
    Views
    17,159

    Re: [Beginner] Programming Challenge: 4

    I believe he/she said that his/her site(the test site) is valid xhtml
  13. Replies
    137
    Views
    17,159

    Re: [Beginner] Programming Challenge: 4

    My try:

    Python


    #!/usr/bin/env python
    #challenge 4
    import urllib2
    t = 0
    while t == 0:
  14. Replies
    127
    Views
    20,989

    Re: [Beginner] Programming Challenge: 3

    Well, here's my try (hope it works right)...:) still learning

    Python!


    #!/usr/bin/env python

    #challenge 3
    #read and write files:
    readfile = open("bhaarat.text", "r+")
Results 1 to 14 of 14