15,185 Topics

Member Avatar for
Member Avatar for ohyeah

Hi I just started out with python.. I'm trying to write some code that will request a file with HTTP GET, be able to send custom headers to the remote host, download this file and save it locally, and show some kind of percentage downloaded which updates WHILE its downloading. …

Member Avatar for EAnder
0
482
Member Avatar for Jadellll

I know there exists the sort() function. What I want to know is how it was built. Is there a function in python to call the contents of a function Or can someone show me how that one was made. I'm doing a test, and it wants me to sort …

Member Avatar for sneekula
0
104
Member Avatar for dmpop

Hello, I need to fetch and display message subjects containing a specific word. Here is what I've got so far: [CODE]import imaplib imap = IMAP4("imap.mail.com") imap.login("username", "password") r, data = imap.select('INBOX') r, data = imap.search(None, '(SUBJECT "Reminder")')[/CODE] What I need now is to print a list of subjects of the …

Member Avatar for dmpop
0
7K
Member Avatar for Seagull One

Hello again, everybody. Now that I've just about learned all I can for programming my robot with 'smarts' (I think), I think I'm ready for a bigger challenge: Having my robot program aspects of itself. Right now I'm going to try to implement it into my robot's human socialization program. …

Member Avatar for Seagull One
0
453
Member Avatar for EAnder

I am in the process of writing a brainfsck interpreter. It's just a skeleton and I still have to add Ascii, multi-character, and loops but, I was wondering was their any way I could create a compiler with python? I heard I could use lex and yacc but I am …

Member Avatar for Gribouillis
0
113
Member Avatar for iamoldest

Okay everyone first heres a source page for this module that im having trouble with... [url]http://www.pygame.org/docs/ref/font.html[/url] Anyways my problem is finding out how to use this module to be able to print a variable with font.render....... anyone know how? Heres the code... [ICODE] #! usr/bin/env python import pygame, sys, os …

Member Avatar for sneekula
0
2K
Member Avatar for lllllIllIlllI

Hi What i want to do for this is to have my program run in the background simulate pressing a button such as ENTER every 10 seconds or so. I have trauled the net and found solutions for VB and C++ but none for python. Is this possible in python …

Member Avatar for lllllIllIlllI
0
379
Member Avatar for leegeorg07

hi my brother has created a program called 'guess my number' (see it here: [url]http://www.naughtyottselprograms.tk/[/url]) and i know the coding that i need but i dont know if there is a module that includes numbers does anyone know the name for that module if it exists?

Member Avatar for friendklay
0
229
Member Avatar for friendklay

I tried the package my application which has only two files, one for the GUI (wxPython) and a Library used by the GUI. Below is my setup.py code: [code=python] from distutils.core import setup import py2exe setup(name="U51 Converter", scripts=['convertapp.pyw']) class Target: def __init__(self, **kw): self.__dict__.update(kw) # for the versioninfo resources self.version …

Member Avatar for vegaseat
0
96
Member Avatar for lllllIllIlllI

Hi I have been trying to do one of the projects in the projects for beginners section that asks you to get your computer to log off after a certain amount of time has passed without any mouse or keyboard movement. I am not yet up to that bit, in …

Member Avatar for Gribouillis
0
1K
Member Avatar for FreezeBlink

Is there any easy, [i]very fast[/i] way to edit image files with Python? Any extension that Windows uses is fine.

Member Avatar for lllllIllIlllI
0
71
Member Avatar for dmpop

Hello, Yet another silly question from yours truly. I need to add escape characters to " and ', so that "monkey's cool" becomes \"monkey's cool\". My primitive solution to the problem is as follows: [CODE]str1=raw_input("String:") str1=str1.replace("'", "\\'") str1=str1.replace("\"", "\\\"")[/CODE] But I bet there is a more efficient and elegant solution …

Member Avatar for dmpop
0
114
Member Avatar for miraje

Hello everyone! I have several .ASC files generated from ArcGIS that contain data over the same domain. I want to somehow read the data directly from the ASCII files (rather than reading the data and plotting in MPL in another image format) and display it as a raster image on …

0
39
Member Avatar for friendklay

When I enter Unicode data as values for TextCtrl, I get the following errors: [code] UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 5: charac ter maps to <undefined> [/code] I am trying enter Burmese text (U+1000 to U+10FF).

Member Avatar for friendklay
0
201
Member Avatar for k9triz

I've been playing around with this library called 'mechanize' for automated form-filling ( [url]http://wwwsearch.sourceforge.net/mechanize/[/url] ). Now, I've tried this library across a number of websites, but although it works on some, on others I get an error saying - mechanize._html.ParseError: ParseError(ParseError(SGMLParseError("unexpected char 'u' in internal subset",),),) I also tried the …

Member Avatar for vegaseat
0
92
Member Avatar for dmpop

Hello, A complete Python newbie needs help. :-) I have a simple script that updates the 'note' field in a MySQL database table based on the record's id: [CODE]id=raw_input("Record id: ") update=raw_input("Note: ") cursor.execute ("UPDATE notes SET note='"+update+"' WHERE id='"+id+"'""") print "\nRecord has been updated."[/CODE] The problem with this solution …

Member Avatar for dmpop
0
167
Member Avatar for TheOneElectroni

Hi everyone, I'm feeling a little dizzy trying to place the root window of my Tkinter app on the screen. I followed [URL="http://www.daniweb.com/forums/thread66037.html"]mawe[/URL] advice and coded like this: [code=python] root = Tk() root.config(bg="white") w, h = root.winfo_screenwidth(), root.winfo_screenheight() root.geometry("%dx%d+0+0" % (w, h)) [/code] However the window gets placed wrongly and …

Member Avatar for TheOneElectroni
0
744
Member Avatar for ub007

I'm looking for a simple proxy that would accept a Http 'get' request from my python program and forward it to the web server.....could anyone plz provide me with a sample python script for such a proxy..... i intend to deploy the proxy on a virtual IP-say 192.168.12.3 on eth0:3. …

Member Avatar for EAnder
0
115
Member Avatar for iamoldest

Hey everyone! Okay I have another pretty simple problem... [ICODE] while mainloop == 0: for event in pygame.event.get(): if (event.type == KEYDOWN): draw_level() if (event.key == K_ESCAPE): sys.exit() if (event.key == K_RIGHT): while roll == 0: if level[yd][xd + 1] == 1: xd = xd - 1 roll = 1 …

Member Avatar for jlm699
0
126
Member Avatar for Seagull One

Hello Everyone. I'm new to python and so far, I simply love it! I'm still just starting to get the knack though and there's a lot more I want to know. I've decided to use it mainly for my robots' programming scripts. Right now I'm currently stuck on a simple …

Member Avatar for Seagull One
0
1K
Member Avatar for ratperson

I am here making my video game wondering how to make an image appear when someone clicks in a certain area. If I need an image to pop up when some one clicks anywhere within a large rectangle of space how would I go about doing that? Thanks!

Member Avatar for vegaseat
0
2K
Member Avatar for leegeorg07

hi again sorry i havent been only lately but i have this problem with some code for a digital phonebook. the code is this:[ICODE]p = float(raw_input("do you want to add a new person? (1 = yes, 0 = no)")) v = float(raw_input ("do you want to see the phonebook now? …

Member Avatar for leegeorg07
0
104
Member Avatar for friendklay

[code=python] data = re.sub(u"\u102F*\u102D", u"\u102D\\2\u102F", data) data = re.sub(u"\u1031*\u103B", u"\u103B\\2\u1031", data) data = re.sub(u"\u1001*\u102C", u"\u1001\\2\u102B", data) data = re.sub(u"\u1002*\u102C", u"\u1001\\2\u102B", data) data = re.sub(u"\u1004*\u102C", u"\u1001\\2\u102B", data) data = re.sub(u"\u1007*\u102C", u"\u1001\\2\u102B", data) data = re.sub(u"\u1012*\u102C", u"\u1001\\2\u102B", data) data = re.sub(u"\u1013*\u102C", u"\u1001\\2\u102B", data) data = re.sub(u"\u1014*\u102C", u"\u1001\\2\u102B", data) data = re.sub(u"\u1015*\u102C", u"\u1001\\2\u102B", …

Member Avatar for friendklay
0
339
Member Avatar for monstro

Ok. So I wrote a simple boost python application. I put the exception handling code in. Now, as a test, I tried to run (purposely) a python script with a syntax error in it. The application crashes each time (Runtime Error!). How can I change the app so that it …

Member Avatar for monstro
0
240
Member Avatar for bikehike90

Hello, I am creating a new applications and i need to know how to couple a root.destroy and functionx() command to one button? I've tried to put the destroy command in functhonx() but that doesn't seem to work. Any ideas? Also, I am wondering if it's possible to refresh the …

Member Avatar for Gribouillis
0
89
Member Avatar for rysin

Hi im new to this board. Im beginning a new Python prject, my last one was a html GUI which I built in Tkinter. This time im going to make a AIM bot. Any idea on where to start with a project such as this. All help is appreciated! Thanks

Member Avatar for EAnder
0
97
Member Avatar for ub007

Good Day! I have set up virtual IPs on my Ubuntu client machine & assigned IPs 192.168.12.3 - eth0 192.168.12.4 - eth0:1 192.168.12.5 - eth0:2 192.168.12.6 - eth0:3 I have written python code to send multiple HTTP requests to my web server to load test it.When I check the logs …

0
71
Member Avatar for iamoldest

Okay everyone i am new to this post but i have a fairly easy problem (i think)... so could someone help me out? :-) anyways heres my code in python 2.4....... [ICODE] #! usr/bin/env python import pygame, sys, os from pygame.locals import * pygame.init() something = 1 def dosomething(): something …

Member Avatar for ZZucker
0
119
Member Avatar for chython
Member Avatar for woooee
0
38
Member Avatar for desm

The following example, when executed, returns: [QUOTE]Traceback (most recent call last): File "/home/des/programming/python/OOP/test.py", line 13, in ? demonstration(6).number() TypeError: 'int' object is not callable[/QUOTE] The example: [CODE = python] class demonstration: def __init__(self,number): self.number = number def number(self): fiveup = self.number + 5 print fiveup demonstration(6).number() [/CODE] Now, I know …

Member Avatar for desm
0
92

The End.