User Profile

Collapse

Profile Sidebar

Collapse
aLiase
aLiase
Last Activity: Apr 23 '08, 08:37 PM
Joined: Nov 20 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • aLiase
    started a topic understanding class

    understanding class

    Hi,

    I've been learning python for quite a while now, and I understand everything very well, except class.

    So, if somebody could help me understand class. I think my main problem with not understanding class is that I'm not sure how I should use it in a program.

    Thanks.
    See more | Go to post

  • aLiase
    started a topic simple deleting problem

    simple deleting problem

    I need some help figuring out what the problem on this. It actually a simple program that just read lines that has comment of #, if it does it delete that line and moves on. But for some reason it not working very well.

    Code:
    #!/bin/python
    input = open('/boot/config', 'r')
    output = open('/tmp/config', 'w')
    lines = input.readlines()
    number = 0
    for line in lines:
    	if line[0] == "#":
    ...
    See more | Go to post

  • aLiase
    started a topic negative number problem

    negative number problem

    so heres my code

    Code:
    input = open('DATA1.txt', 'r')
    output = open('OUT1.txt', 'w')
    numbers = input.readlines()
    for x in range(1):
    	set = numbers[x]
    	a = float(set[6])
    	b = float(set[4])
    	c = float(set[2])
    	d = float(set[0])
    	r = (a - b)**2 + (c - d)**2
    	answer = round(r * 3.14169,3)
    	output.writelines('%s\n' % answer)
    output.close()
    ...
    See more | Go to post

  • aLiase
    replied to Carrying values over in a function
    Yes, that really helped thanks, program works fine now : D.

    I didn't actually know you could assign a variable to a function....
    See more | Go to post

    Leave a comment:


  • aLiase
    started a topic Carrying values over in a function

    Carrying values over in a function

    I'm pretty new to python, and I'm currently having problems carrying a value inside a function, to be used again by another function.

    I'm not sure if that make sense, and I don't really have a good simple example, sorry.

    And since I'm totally new to programming I might just be misunderstandin g what a function really does.
    See more | Go to post
No activity results to display
Show More
Working...