Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - IrishYoga

Pages: [1] 2
1
Thanks for not only putting the correct code but also pointing out what I did wrong! This really helped.

2
Hello, I have this code that I think should be giving me the average of a list but when I put it into python, the error says error:division by zero. I'd appreciate it if you guys looked at this code and told me what i'm doing wrong.
Code: (python) [Select]
def f(x):
    d = []
    if x == d:
        return None
    else:
        sum = 0
        for n in d:
            sum = sum + n
        length = len(d)
    total = sum/length
    print(total)
   

3
Projects and Discussion / Re: Program accessing database
« on: February 28, 2014, 07:49:05 pm »
ok so i looked into the source code thinking that it would have some <script calculate> blah blah</script> but it actually said something along the lines of <td> 37000 </td> so what i'm asking is if i put this <td> into my code, will it always say 37000?

4
Projects and Discussion / Re: Program accessing database
« on: February 28, 2014, 07:20:27 pm »
Thank you! Yes, that was what i was looking for. I've already looked into Web Scraping and it has solved my problem! I have one question, however. The source code says the number of the item, and i thought the source code would only show the logic behind the printed number on the actual website which could either facilitate or make it harder for me. Will the number constantly change in my program or will it stay as it was when i first put it into the program? I'll put in some pseudo code to help you understand:
Code: [Select]
import urllib
import re
url = "http://blahblah.com"
regex = '<value>(.+?)</value>'
pattern = re.compile(regex)
htmlfile = urllib.urlopen(url)
htmltext = htmlfile.read()
value = re.findall(pattern,htmltext)
print value

5
Projects and Discussion / Program accessing database
« on: February 28, 2014, 04:31:18 am »
How could i create a program to access a particular object's data in a database? I don't want to keep having to go to that website and checking the number, so i wanted to create a program that when i ran it, would tell me the current number of the item in question. I've searched Google for both C and Python solutions, but to no avail.

6
Projects and Discussion / Re: best language for multiplayer game?
« on: May 01, 2013, 01:18:15 pm »
Thanks for a straightforward answer! I was afraid that if i uploaded this post, i would have responses like "Use the program that you think is best."

7
Projects and Discussion / Re: best language for multiplayer game?
« on: May 01, 2013, 12:08:04 am »
How could i host my program on the school servers? I've tried to code php, but i haven't tried mysql. It doesn't have to be that fancy, i just need a chart saying the person's name and their gpa and their ranking based in the game. I think the school servers are on all the time.

8
Projects and Discussion / Re: best language for multiplayer game?
« on: April 29, 2013, 11:41:08 pm »
I know python, but i don't know much about ports. I would like this to be accessed from anywhere that has internet connection, is this possible? Because many students don't have access to a computer lab in my school.

9
Projects and Discussion / best language for multiplayer game?
« on: April 28, 2013, 07:48:43 pm »
I would like to create a "game" that focuses on the rankings of people at my school. For example, you would have to put your name, and your grade point average and you submit and the tables are refreshed and you find out your ranking in the game(not the school because everyone in the school would have to play the game for that to happen). Any suggestions? Could you guys also provide some pseudo code for me to start working on? I haven't made any multiplayer programs only single player programs, so i don't have much experience. The game doesn't have to have amazing graphics, it will only have this simple table. I know their will be a lot of people cheating with like 5.0 gpa, but it'll just be for fun lol.

10
Scripting Languages / Re: user created variables
« on: February 09, 2013, 03:34:59 am »
Ok thanks for helping. You guys understood my question, i'm just way too under-qualified to understand anything that has been suggested. I will try to learn more python, and come back to this post.

11
Scripting Languages / Re: user created variables
« on: February 08, 2013, 05:11:30 am »
Ok, i see. I'll try it out.

12
Scripting Languages / Re: user created variables
« on: February 07, 2013, 02:03:04 am »
When i tried to use that code, it didn't work for me. I'm using python 3.3. Is that the reason?

13
Scripting Languages / Re: user created variables
« on: February 05, 2013, 02:23:41 pm »
yeah,sorry the code is python. I meant that if i'm making a grade calculator, i don't want to keep making variables, and i'm not even sure how much grades the user will have. I want them to be able to input as much grades as they want without me having to make a new variable for each one. Is it possible?

14
Scripting Languages / user created variables
« on: February 05, 2013, 06:59:48 am »
So if i don't want to continue to make variables for the user to use, how can i make the user input values into new variables that have not already been created? I was thinking of a tuple that consists of a-z and that the user could input values into those, but i'm not sure how it could be done.

15
Scripting Languages / Re: missing python modules
« on: February 05, 2013, 06:55:43 am »
Thanks! Sorry i answered so late, but it worked, thanks a lot!

Pages: [1] 2