15,181 Topics

Member Avatar for
Member Avatar for TheNational22

I have a little program that goes to news aggregater's, gets the hrefs, and returns in a window. I want to have multiple windows open if multiple sites are choosen, right now, it will only go to the first one in a list, and completes perfectly. I assume I am …

Member Avatar for woooee
0
173
Member Avatar for gangster88

how could I make the function count?.. its a test marked out of 5, so if the user enters 1,1,2,2,4,5, then the output= 2 people got 1 mark, 2 people got 2 marks and 0 got 3 marks and so on?... i dnt knw if my code is even right.. …

Member Avatar for gangster88
0
81
Member Avatar for vitvn

response = urlopen("https://www.lingq.com/accounts/login/") #response = urlopen("http://www.google.com.vn") window = ParseResponse(response) window.document # HTML DOM Level 2 HTMLDocument interface forms = window._htmlforms # list of objects supporting ClientForm.HTMLForm i/face form = forms[1] print form #print form control = form.find_control("password") form["password"] = 'password' control = form.find_control("username") form["username"] = 'username' response2 = urlopen(form.click()) for …

0
53
Member Avatar for Godflesh

I try again in a new thread, the other went out of hand. I use this code line to create a n value. n = random.randint(0, 99), i use this n value as a lap index to my while loop. The loop is in a function called "def run(self)" in …

Member Avatar for Godflesh
0
109
Member Avatar for lrh9

I'm just wondering if it is possible to import a module as an object attribute. The basic description of what I want to accomplish is that I'm creating a software agent object. This agent will have a set of abilities (functions), but I don't know what these are ahead of …

Member Avatar for lrh9
1
335
Member Avatar for eva yang

Hi,there, assert pop == "berg", "Item removed from the stack was not \"berg\"." why using '...' can avoid syntax error ? Thank you :)

Member Avatar for eva yang
0
260
Member Avatar for Begjinner

Hi, Sorry if this is already asked, but I couldn't find it. I got a text file with 100010101001000010000011111001010 and it is 8bit, now I would like it to decimal. With the int(file,2) function it does not work. I get a very large number. Is there an extra command I …

Member Avatar for Begjinner
0
149
Member Avatar for sneekula

How would you make a simple bar graph from a list of data? [code]data = [20, 15, 10, 7, 5, 4, 3, 2, 1, 1, 0] [/code]

Member Avatar for Stefano Mtangoo
0
559
Member Avatar for sandorlev

Hello, I'd like to get help for a database engine in Python. I know that there are loads of databases out there and I cannot create one which would be even near as good as SQL but I'd like to do it for getting a good understanding of databases and …

Member Avatar for Stefano Mtangoo
0
99
Member Avatar for Godflesh

How do i reach a class from within another class? I have Class A and Class B How can i activate or run class A from Class B? example, if class A and class B work toward the same resource, one create data the other consume data. How can i …

Member Avatar for Stefano Mtangoo
0
248
Member Avatar for dynamicman

Hello my name is Mikal. I am working on some python code, and it is now at the point where it does what I want, but its not quite fast enough for my liking. Here is my current code that works: [code=python] self.timersVS = {'combat':0,'regen':0} ... # Tick Timers and …

Member Avatar for dynamicman
0
115
Member Avatar for charlottetemp

Hi guys i was wondering how in python you invert this line as I have indicated. I have tried all sorts of mathemtical functions. I am using zelle graphics module. Currnetly I have produced lines going in one direction im trying to produce the same lines again but in the …

Member Avatar for charlottetemp
0
122
Member Avatar for DGXI

i have created lines in graphwin but i did it the long way is there a simpler way using loops ? cheers

Member Avatar for vegaseat
0
181
Member Avatar for lifeworks

im completely new to python and not particularly experienced with anything that isnt running off of a web server... Im reading 'A byte of Python' and while my first shell script worked, which was just the 'Hello world', but if I create a separate file and have saved it within …

Member Avatar for vegaseat
0
124
Member Avatar for twoshots

I've been writing a Python module which contains a few classes. As I have come to use the module in earnest it has become clear that I need to create a _very_ large number of instances of these classes. This is using more memory than I would like. Speed is …

Member Avatar for twoshots
0
164
Member Avatar for shrikant.rails

Hi, Below is the snippet from my script which is working fine [CODE=python]if system is 'Conferences': assignedtomatrix[system]['Third'] = 'name'[/CODE] I have to now introduce one more loop checking, but could not find a way to do this. I have tried: [CODE]if system is 'Conferences': person = ['person1', 'person2', 'person3'] community …

Member Avatar for shrikant.rails
0
139
Member Avatar for RandV80

I'm completely new to Python, just started going through the tutorial at python.org but am getting compile errors in places that should not be errors. I've installed Python version 3.1 on a Windows 7 machine, but I don't see any documented compatability issues. For an example, here's some simple sample …

Member Avatar for RandV80
0
7K
Member Avatar for vlady

hello, Pls can anybody help me with a folloving exercise? (I must say that I am really beginer in this field, learning by myself and with daniweb (if sb gives me help)) Pompt the user to enter a string of forbidden letters and also to enter a words. Make a …

Member Avatar for vlady
0
126
Member Avatar for SgtMe

Hi everyone! I would like to make an Air Hockey game in pygame. I was wondering if it was possible to have 'proper' bouncing (ie. the puck goes in a direction relative to the angle the paddle hit it in). I can easily write the rest of the code. Thank …

Member Avatar for SgtMe
0
970
Member Avatar for charlottetemp

Not sure what I've done wrong here tried lots of alternative combinations and not sure why this logic doesn't work! Im pretty sure it has something to do with the parameter not reading as the results inputted aren't going through the loop. Any help would be appreciated! The idea of …

Member Avatar for charlottetemp
0
103
Member Avatar for lewashby

I posted a thread labeled pygame, global name "glob" but am unable to resolve the issue so I was just going to ask a few question about the code. Well first of all, I ran it on Windows Vista, python 2.6 and pygame, but I'M not sure what version of …

Member Avatar for vegaseat
0
146
Member Avatar for Godflesh

I have a problem again :) I try to use this code: [code] import time from threading import Thread from threading import Lock def main(): for i in range(3): my_thread = MyThread(i) my_thread.start() class MyThread(Thread): lock = Lock() def __init__(self, i): Thread.__init__(self) self.i = i def run(self): while True: self.lock.acquire() …

Member Avatar for jcao219
0
379
Member Avatar for breakbone

hi all I'm writing a application which uses Opencv and wxWidgets and sends camera frames via a socket connection. But it seems i'm doing something wrong: after starting a server on my machine, i can't connect my application to the socket the server is listening on...why is that? [CODE=python] import …

Member Avatar for breakbone
0
101
Member Avatar for Godflesh

How do i make this code to store data in a global variable, it create random number of elements. [code] n = random.randint(0, 99) for i in range(1): print "-"*60 print "Here is some new elements! " while n >= 0: data_list = random.randint(0,99) print data_list, time.sleep(.10) n= n-1[/code]

Member Avatar for Godflesh
0
308
Member Avatar for gangster88

I need to have 4 functions which asks the user how many times to flip the coin and then displays the number of heads and the number of tails as a decimal? [code] def getInputs(): times=input("please enter the number of times the coin should be flipped: ") def simulateFlips(): for …

Member Avatar for charlottetemp
0
1K
Member Avatar for Tech B

I've seen a program called Devcon ([url]http://en.kioskea.net/faq/sujet-1886-enable-disable-a-device-from-the-command-line[/url]) used for enabling and disabling hardware devices. I want to do the same hopefully with python. I want to turn the internet connection off with a script. I can already do it with popen('ipconfig /release') but I want something more robust. Is there …

Member Avatar for Tech B
0
2K
Member Avatar for subhan222

Hi, I am trying to embed python in c++. everything is working fine apart from couple of issue. what exactly i am doing is creating an API for C++ functions in my application to be accessible using python script. When i run a script its runs fine and when i …

0
106
Member Avatar for sandeep.m

Hi, I am facing a problem when i am trying to run the django server using python manage.py runserver.The problem is that the server is not starting because it gives the following error: Traceback (most recent call last): File "manage.py", line 12, in <module> execute_manager(settings) File "/usr/local/lib/python2.5/site-packages/django/core/management/__init__.py", line 340, in …

Member Avatar for Pupo
0
842
Member Avatar for Dembi

Hi All I have installed Python 2.6.2 When I use function of 'import Sybase,' I always received the following error: Traceback (most recent call last): File "export_alpha.py", line 3, in <module> import Sybase, sys ImportError: No module named Sybase Please gevi me your advice how I should correctly to add …

Member Avatar for msprayb
0
133
Member Avatar for sandorlev

Hello, I've been working on this self-made database. What do you think about it? What features should I create for it? I'd also like to get help in a select method, because I don't have the foggiest idea how it could be done. And what about making it a database …

0
238

The End.