15,181 Topics
| |
Hi! I want to get information from a sports web site (ex:[url]https://www.bwin.com/pt/futebol)[/url], and I already tried htmllib and some other stuff.... the problem is that I can get the page's source code but not the same information that I can see in my browser. Particularly, I'm interested in the teams … | |
Hello, I'm writing my code into the 'vizard python editor' and sometimes it feels a bit bugged or something, now I get an error message that my class has no attribute. I feel it has to do something with editing in vizard because in other editors I don't think i … | |
I have a third party sending me some infomaion. They say to use php $_post to recieve the information as follows [CODE]<?php //include the database handling class include("mysqlclass.php"); //Assign POSTED variables $destination = $_POST['gwNumber']; $originator = $_POST['originator']; $message = $_POST['message']; $smsTime = $_POST['smsTime']; $timeZone = $_POST['timeZone']; $network = $_POST['network']; $id … | |
Hello, I have been using the python challenge to teach myself python as my first programming/scripting language outside of HTML. As I go along, I find that while I'm understanding the concepts rather well, I am not being as efficient as I could be. While the code I whip up … | |
In my programming class, we need to write a program where the user is prompted for a value. Once that value is provided, the program is supposed to multiply its digits. For example: if the user typed 1234, it would multiply 1*2*3*4 and give the answer. I'm not sure how … | |
does anyone know how to shutdown a computer on windows XP (using python of course ;) given the IP address and the computer name (probably don't need it, though)? I don't want to use os commands like os.system("shutdown -i"). Thanks in advanced! | |
Does anyone know of any good urllib tutorials other than [url]http://www.voidspace.org.uk/python/articles/urllib2.shtml#introduction[/url] & [url]http://effbot.org/librarybook/urllib.htm[/url]. Something which a little beginner friendly:| with good explanations. -Thanks | |
Dear all, I am trying to create x attributes in a class, to the effect of: class classic: def __init__(self,text): r=range(text.count('TI -')) for l in r: self.l=None Unfortunately I can't iterate through for some reason. I only get self.l, not, for instance self.1 to self.107 How do I do this? … | |
Is there a gui library that has already been ported to python 3? I'm interested in using some of the new python 3 features in the back end for my project. | |
Write a function which starts N processes in a ring, and sends a message M times around all the processes in the ring. After the messages have been sent the processes should terminate gracefully. How do we solve in in python please help me by giving the script or logic. | |
I know of ww.portablepython.com/ Can anyone know how to do a combination of IDE and this python in stick. Also if anyone have ever tried to add other python modules to it like Vpython, wxpython, etc Thanks alot | |
Attempting to scroll a simple background using pygame. This is proving to be near-impossible. It seems that once a surface is blitted anywhere, it WILL NOT blit into a new location. My two problem functions: [CODE] def loadMap(self): vid = _video._Video() self._bg = self._map.get_background().get_pyImage() self._fg = self._map.get_foreground().get_pyImage() vid.paint(self._bg,0,0) vid.paint(self._fg,0,0) def … | |
Hey guys, [CODE]import sgmllib class MyParser(sgmllib.SGMLParser): def parse(self, s): "Parse the given string 's'." self.feed(s) self.close() def __init__(self, verbose=0): sgmllib.SGMLParser.__init__(self, verbose) self.hyperlinks = [] def start_a(self, attributes): for name, value in attributes: if name == "href": self.hyperlinks.append(value) self.newhyperlinks.append(name) def get_hyperlinks(self): return self.hyperlinks import urllib, sgmllib f = urllib.urlopen("http://www.python.org") s = … | |
Can someone explain how to add a file to a dictionary. The file is simple. Maybe a word or a number on each line. Here is the code I have. Didn't know if i should use this post or the List and Dictionaries post so kind of posted twice... sorry … | |
Hi I'm getting the error TypeError: argument of type 'int' is not iterable when i run my program and don't know where I'm going wrong. My code is: [ICODE] class loan: global loanlist loanlist = [] def loanbook(self, name, ISBN, author, title): self.name = name self.ISBN = ISBN self.author = … | |
I am trying to set a cookie but when i check my browser cookies nothing is set. What am doing wrong [CODE] #!/usr/bin/python # e begoli, python connector for mysql # import MySQL module import MySQLdb import cgi import Cookie import time cookie = Cookie.SimpleCookie() cookie["ID"] = "" print "Content-type: … | |
Hello, if you have seen any of my other posts you will know I am working on a script to make a "vocabulary test". I currently having it functioning nearly perfectly, except I get an error if I enter the wrong word. Code: [code=python]def vocabtest(): for r in words.values(): count … | |
Hi I have certain number of books which each have an author, title and ISBN number. How is the best way I can store this so that when I want a list of the books I will be able to list the books with the title, author and ISBN number? … | |
In php you can use $_GET['adam'] to get the information from adam in the url Can you do the same in python? if so how? | |
[B]Hi i've been assigned with doing a torn square, and i've kinda got it working with the code below.[/B] [code] import turtle turtle.reset() length=100 degree=60 i=0 while i < 4: turtle.forward(length/length*40) turtle.right(degree) turtle.forward(length/2) turtle.left(degree+degree) turtle.forward(length/2) turtle.right(degree) turtle.forward(length/length*40) i+=1 turtle.right(90) else: raw_input("there's hopefully a square, all torn like!") [/code] as you … | |
Hi, I'm currently working on a project in Python 2.6.1 using the Tkinter interface, and being new to both Python and Tkinter I've quickly found a problem that keen internet trawling hasn't seemed to help. I'm sure its not a particularly difficult problem or anything, but instead of spending probably … | |
At my lab the professor bought a camera that came with a c library to control it from a computer. Right now he wants me to create a gui in matlab to control it but I'm such a python zealot I'd rather do it in that, and then call it … | |
Is there a way to add a directory to the locations that python look at when you call __import__ ? I need to import some scripts from a user folder at runtime, and since __import__ doesn't accept absolute file names, I'd like to try this. Copying the script to the … | |
Hey guys, well here are some more of my questions (sorry!! i know, im a pain..) Ive finished "most" of everything in this [URL="http://www.swaroopch.com/notes/Python_en:Table_of_Contents"]tutorial[/URL]. I missed some out because they were too much for me to understand at the time. will go back to them and come back with more … | |
I know the codes not the best well written but the only problem I'm having(besides the interpreting of the macro commands, the one here is just a base for me to work on) is how the UpdateLabels.start() method returns: [code]Traceback (most recent call last): File "C:\Users\Erik\Desktop\Stuff from last Night\MouseMacro.py", line … | |
hello again, Ive got the basics under my belt and ready to start making things happen:D. I want to experiment with different things so could you show me to some good tutorials on some of the following things. 1. sending and receive messages through the internet-what library/Mod should i use? … | |
hello guys im stuck for quite a while with this problem and i badly need ur help. in fact i wanna make the red rectangle slow down when it comes close to the blue one. it would be nice if they both move at the same speed. ive tried several … | |
Hi, This is my first time on daniweb, so if I've posted in the wrong section or there's already a similarly-themed thread or I've done something wrong I apologise. Anyway, I'm hoping someone can prod me in the right direction with a problem I'm having right now. I'm currently working … | |
Okay, my first question is about wxpython's registerhotkey. As far as I can find, there are not letter key keycodes. This example relies on the win32con module: def regHotKey(self): """ This function registers the hotkey Alt+F1 with id=100 """ self.hotKeyId = 100 self.RegisterHotKey( self.hotKeyId, win32con.MOD_ALT, win32con.VK_F1) -- I want to … | |
I am trying to write some simple information to a file and i am getting the error message "No such file or directory when i know full well it exists. If you take the url [url]http://www.adamplowman.com/uni_project/log.txt[/url] you get the file heres the code [CODE]#!/usr/bin/python print "Creating a text file with … |
The End.