15,406 Topics

Member Avatar for
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
74
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
42
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
204
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
94
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
170
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
748
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
117
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
129
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
107
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
348
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
251
Member Avatar for PsychicTide

Hey, just kind of some background so you don't think I'm fishing. I've worked with ASP,PHP,JS, AJAX, HTML, XML, etc... as well as fundamental programming languages like C#, C++, VB.net, Python, etc. I don't know all these languages extensively, but psuedo code works for me. It seems I have the …

Member Avatar for langsor
0
173
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
93
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
100
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
72
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
123
Member Avatar for chython
Member Avatar for woooee
0
41
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
95
Member Avatar for eibwen

I have a text file that I need to modify. It contains about 100 or so lines formated as follows: [CODE]123456789*DOE JOHN A *PY*SUPER HERO *179250*026450*000000*68*026450* *000000* *000000* *000000* *000000[/CODE] What I need to do is insert decimal points at specific places so it looks like this: [CODE]123456789*DOE JOHN A …

Member Avatar for Gribouillis
0
174
Member Avatar for planetPlosion

I've just taken a beginners project from Vegaseat and modified it to fit with a Tkinter tutorial. I'm just trying to get a Tk window that has a "Go!" button and by pressing it prints the sentence. I'm having lots of trouble. I've gained a lot from this though, so …

Member Avatar for planetPlosion
0
341
Member Avatar for dr_kac

Hi! I have a file with data that looks like that: 123 34 0.45 232 54 0.01 And so on (the file contains more than 1300 lines). I am trying to make dictionary from the data (like this: dict={0.45:'123_34',0.01:'232_54',...}). The problem is that I didn't get more than 1300 elements …

Member Avatar for dr_kac
0
68
Member Avatar for desm

I'm trying to write a phonebook application using Tkinter. It's not very advanced, and it's mentioned in this tutorial: [url]http://openbookproject.net//py4fun/gui/tkPhone.html[/url] The full source of the tutorial's version being here: [url]http://openbookproject.net//py4fun/gui/tkPhone.py[/url] However, I'm trying to write a version myself, yet I keep getting the following error: [QUOTE] File "phonebook_test.py", line 96, …

Member Avatar for desm
0
2K
Member Avatar for Hogg

Hey all! I'm new to programming so please be patient if my question is obvious or listed somewhere else (I've looked!) I want to be able to enter a sentence, split the sentence into septate words and then take the first letter of each word to create a new string. …

Member Avatar for Hogg
0
6K
Member Avatar for toughjamy

I have a webcam. iam able to write a python code for capturing photos from them now i need to know if there is some way of capturing images on my system as an administrator of a website. Now this pho automatically gets saved at server and then all users …

Member Avatar for toughjamy
0
64
Member Avatar for Seachmall

So I'm writing a small Blackjack game and divided a class up into 2 to keep everything tidy but keep getting this little error: [i]global name 'handle_input' is not defined[/i] The code: The class being called... [ICODE] #File: handle_input.py class handle_input: ...[/ICODE] The file defining the class... [ICODE] #File: control.py …

Member Avatar for Seachmall
0
348
Member Avatar for TheOneElectroni

Hello everybody, I've a somewhat odd issue displaying a .png image onto a Tkinter canvas. The image is surrounded by a grey frame. Here below an excerpt of the relevant code and by the way I'm running under windows xp. The same thing happens with the menu of the gui, …

Member Avatar for TheOneElectroni
0
451
Member Avatar for reezin14

I have heard of python,yabasic,and perl along with several others and was wondering if anyone could point me in the right direction. I'm not interested in web creation I just want to be able to make a computer or network work better thanxs, Reezin14

Member Avatar for swaira umar
0
589
Member Avatar for nuaris

How do I read something from DOS? For example, doing a command in DOS, like 'dir'/etc. and writing the output to a variable in python? I know about the listdir() function, 'dir' in DOS is just an example.

Member Avatar for BearofNH
0
202
Member Avatar for mindmesh

I'm using the following tutorial to learn Python: [url=http://openbookproject.net/thinkCSpy/index.xhtml]How to think like a computer scientist[/url] I'm running the following code and I get an error: [CODE]from gasp import * begin_graphics(800, 600, title="Catch", background=color.yellow) set_speed(120) ball_x = 10 ball_y = 300 ball = Circle((ball_x, ball_y), 10, filled=True) dx = 4 dy …

Member Avatar for pyromjm
0
164
Member Avatar for miraje

Hi everyone, I'm new to wxpython, so I apologize in advance if this has a simple solution. The GUI I'm working on has the following basic structure: [I]def function(time) -> initialized from frame and generates data needed in panel class panel -> displays data and images generated in function class …

Member Avatar for Das246
0
245
Member Avatar for 2ashwinkulkarni

Hello, I am using the RE, Regular Expression Module. The operation I need to perform is a search; The syntax for which goes like this re.search(pattern, string, flags) #flags being optional where 'pattern' is the string I am looking for in 'string'. My problem is I want to look for …

Member Avatar for jlm699
0
109
Member Avatar for joey101

I'm working on making a server control panel in python (like cpanel, plesk, etc) and wanted to know if any one knew of some tutorials on using bash and python together for creating users and stuff on a *nix system. Also if any one knows of a tutorial on using …

Member Avatar for ovoid
0
762
Member Avatar for skymuss

Hi daniweb users My name is luc. I'm from Germany. Before I have started with Python I used PHP. There you have the funktion [B]urldecode[/B] to decode a url string or [B]urlencode[/B] to encode a url string. I don't really know I a function like that in python. can you …

Member Avatar for Gribouillis
0
323
Member Avatar for sepiso

Hi , Kindly assist me with resolving this defect from the testers team. am new to python. the defect is as follows: "A small code change must be added to checkif the password that has been received from the API call compares to "clear|......". If this is the case then …

Member Avatar for Gribouillis
0
91
Member Avatar for sameer123

i want to create a file exactly like pickled file using C program in Qt without using python. this file will be read by python (unpickled ) to initialize some properties. Or Is there any way one can know the exact syntax of pickled file n then write it using …

Member Avatar for sameer123
0
299
Member Avatar for Briz

hi guys im new to this forum so im not sure how it works :S. im currently using the Khepera robot and am trying to make it follow the wall. i know how to read the sensors but i i dont know how to make it follow the wall if …

Member Avatar for sneekula
0
70
Member Avatar for SUBHABRATAIISC

Dear Group, I am getting some questions on doing Web Pages in Python. I have some interactive codes in python for which I like to make web pages. I am trying to use kid. Kid I learnt, and is easy, too. My questions are: i) Am I going correct? ii) …

Member Avatar for ITVanguard
0
146
Member Avatar for breakbone

Hi, I'm writing a simple echo/chat GUI server using wxPython. I made a separate thread for the server. The only problem I have is that when I try to close the server it hangs in socket.recv() thus hanging the whole thread. How can stop the socket from receiving from the …

Member Avatar for breakbone
0
163
Member Avatar for FreezeBlink

I know, this is a stupid question, but is it possible for a class to have two variables, one of which has a value, and the other of which will [i]always[/i] hold the same value, unless the user changes it? In essence, making the second variable a duplicate of the …

Member Avatar for Gribouillis
0
116
Member Avatar for ChrisP_Buffalo

How do I test a byte string in Python? I want to manually convert (no libraries or functions) a UTF-8 string into UTF-16. My basic solution is to reading from the stream some number of UTF-8 bytes, convert them into codepoints, then convert those codepoints into UTF-16 bytes. I want …

Member Avatar for ChrisP_Buffalo
0
152
Member Avatar for Das246

I have a script with a wx.Python GUI that monitors game files for changes and then makes a .tar.gz backup of each turn. If I run the test script (.py extension) the program works well and I can play the game without noticing the python script running in the background. …

Member Avatar for vegaseat
0
288
Member Avatar for vegaseat

I keep hearing that Python is about as slow as Java. Does anybody have experience with speeding things up?

Member Avatar for Gribouillis
0
493
Member Avatar for tzushky

Hello, long time no see... I've been getting along fine with Python lately and I just need to ask you a question: Is it possible to just write to, NOT OVER , an Excel file, in a certain area, using a certain python module?. This way results from an application …

Member Avatar for Gribouillis
0
2K
Member Avatar for tzushky

Hello again, I have the following situation: I have a script which allows the commands of several instruments. for some of them, their configuration is easy and simply launching the application with [B]os.system()[/B] or through [B]telnetlib [/B]allows me to do what I need. But I have stumbled across something which …

Member Avatar for tzushky
0
171
Member Avatar for darkMatter2008

Hi all, I'm wondering if it is possible to convert an object reference to a string and vica versa? Thanks

Member Avatar for Gribouillis
0
106
Member Avatar for satelliteoflove

Hello, new to this site, although I use many other forums, came here from The Mighty Goosh to ask question about Python, whcuh I am starting, but hopefully i be able to help you guys with other things on the way...

Member Avatar for Vilice
0
60
Member Avatar for knish

Hi, I am using the following code to send mail from a open window in maya application. This gives me following error. I think it says that A2 is not created. What is a possible way to have this code send a mail. BRgds, kNish # Error: name 'A2' is …

Member Avatar for jlm699
0
861

The End.