15,406 Topics

Member Avatar for
Member Avatar for poeticinsanity

I am coding a web spider for research purposes and have run into an error I am uncertain about. I am fairly new to web programming and need a bit of guidance. I use http.client to get a connection, request a site, get the response, and read the resonse into …

Member Avatar for poeticinsanity
0
224
Member Avatar for mg0959

I have written a program that is supposed to take a string via a socket connection and echo it back. This program is also run as a service. I can get a client program to connect to the service if the client program is on the same machine as the …

Member Avatar for mg0959
0
153
Member Avatar for hughesadam_87

Hey guys, Have been working on this tiny simple code for an hour and can't figure out how to fix it. The code does this: Reads in 3-column, tab-delimited data file Adds "1000" in the fourth column to every line Writes out the 4-column file [ICODE]def columns(infile, outfile): f = …

Member Avatar for woooee
0
131
Member Avatar for harrykokil

hi guys.. hw can i reset my whole software in tkinter?? as if to restart running the software?? thanks..

0
50
Member Avatar for perksieuk

Hi everyone I have been trying to combine the data from two seperate text files into a new text file. The code works OK and no errors are produced, but at the join between the two files, a few lines of data are left out. The same happens at the …

Member Avatar for Deepak.G
0
97
Member Avatar for dinilkarun

Hi All, I am using the .search function. [code=python] strValue="XXX" strTemp1="YYYXXX" strTemp= strTemp1.search(strValue) [/code] Python is not able to recognise the .search function. AttributeError: 'str' object has no attribute 'search' What should I import for this? Please help!

Member Avatar for scru
0
2K
Member Avatar for mohankumar554
Member Avatar for sillyboy
0
67
Member Avatar for betatype

I have a problem that I've been puzzling with so I thought it was time to ask the experts. I have two csv files that I am trying to search between. One csv has a Title column, and a URL column. The second has a variety of columns but a …

Member Avatar for betatype
0
126
Member Avatar for bhanu1225

Hello All. While making ".py" program to ".app", we need some steps to follow. [B]1. Create a setup.py file $ py2applet --make-setup MyApplication.py 2.Clean up your build directories $ rm -rf build dist 3.Development with alias mode $ python setup.py py2app -A Running your application 1.$ ./dist/MyApplication.app/Contents/MacOS/MyApplication 2.$ open -a …

0
49
Member Avatar for hunterm

I have to write a function to rotate an image 90 degrees clockwise. I got it to rotate. But it also flipped and rotated counterclockwise. So wrong way, and it flipped along the y-axis. Really weird. [code=python] def rotate(self): rotatedImage = EmptyImage(self.height, self.width) for row in range(self.height): for col in …

Member Avatar for hunterm
0
114
Member Avatar for poeticinsanity

I am coding a web spider for research purposes and have run into an error I am uncertain about. I am fairly new to web programming and need a bit of guidance. I use http.client to get a connection, request a site, get the response, and read the resonse into …

Member Avatar for scru
0
74
Member Avatar for fkadri

Hi I'm trying to create a dialog box with GenBitmapTextButton buttons. When I create the dialog using the standard button, I can use the enter key to push the button, and the escape key to cancel the dialog. However, when I use the GenBitmapTextButton, neither the enter nor the escape …

Member Avatar for fkadri
0
245
Member Avatar for hughesadam_87

Hey everyone, I have the following data set A B C D E F G H I J K L M N O P Q R S T Where every ten lines or so (though not a regular pattern) the data breaks its format and two of the data pieces …

Member Avatar for Alxandr
0
112
Member Avatar for hughesadam_87

First let me say thanks to everyone who has been responding to my posts and providing valuable insight. I have been trying to add rep whenever possible, and appreciate your help. My assignment was to write a python code which takes data from an infile, then has the user specify …

Member Avatar for jlm699
0
352
Member Avatar for Whelk

I found a nice little example chat server written in Python using Twisted. The problem I'm having is identifying each connected client in a way that I can use to send info to specific clients. So in the chat server situation, it'd be used to send private messages. I've spent …

0
91
Member Avatar for Vexten

I'm trying to make this game (pseudo code below) And I have no way to go about doing it. The game will have 30 trivia questions, and the player will have 3 lives When they get the answer correct, they will move on, and if they got all questions correct …

Member Avatar for Vexten
0
100
Member Avatar for billymcguffin

i need some help writing a GUI for the program i'm making. it is a simple text-based number-guessing game and i would like to have the prompts displayed in a nice window. i would also like to have the "number_guesses" and the "guess_list" variables displayed off to the right of …

Member Avatar for billymcguffin
0
359
Member Avatar for hughesadam_87

Hey all, I ran a code today which digested an input file which was 304 MB, consisting of about 10 million lines with six columns a piece. I ran the code and got an indexing error. In troubleshooting, I copied only the first 1,000,000 lines into a new data file, …

Member Avatar for hughesadam_87
0
151
Member Avatar for Joe Hart

I am using a program called MUST. It is for the electrical transmission industry. It uses excel to do its computations. It runs macros based on the buttons that were pushed on a form. The outputs are excel based worksheets. It has a feature to allow you to record the …

Member Avatar for slate
0
127
Member Avatar for tehbrozor

Hello, I am trying to label the axes of an array of subplots. The units of each plot are the same so I would like to just label each axis once. The array is of in determinate size. For odd numbered rows/cols I just use ylabel/xlabel on the middle row …

Member Avatar for tehbrozor
0
81
Member Avatar for hunterm

So I am trying to add a graphical element to my game. And it draws a circle for white or black pegs. However, the list that contains "Black" and "White" isn't acting quite like I want. The list prints like this: B l a c k B l a c …

Member Avatar for scru
0
184
Member Avatar for mindis

Firstly I don't understand english very well, so there may be a lot of mistakes. I use python-2.6.2, wxPython2.8-win32-unicode-2.8.10.1-py26 and numpy-1.3.0-win32-superpack-python2.6 in this example. So I would like to hnow, how to get variable elements form one class into another. I use wxPython, and i don't hnow how get value …

Member Avatar for Ene Uran
0
227
Member Avatar for bhanu1225

Hello All. [COLOR="Red"]I created a login form and an application form in a single system. For that navigation, i imported application form's file name in login form. Then, we can easily execute it. If we enter "user id" and "password" in login form, then it navigates to application form.[/COLOR] This …

Member Avatar for jlm699
0
94
Member Avatar for dinilkarun

Hi All, I have two frames.viz., frm1 and frm2. On click of a button on frm1, I want frm2 to pop up and frm1 to hide. Presently I am using the following code: [TEX]self.Hide() self.frm2=frm2.clsFrame2(self) self.frm2.Show()[/TEX] clsFrame2 is the class present in frm2. The above code if written on the …

Member Avatar for woooee
0
144
Member Avatar for ihatehippies

I've googled this quite a bit and can't find a way to tell if a file is currently being accessed or at least written to. Anyone dealt with this before? If one app if writing to a file another can be reading it before the first is finished writing..

Member Avatar for woooee
0
78
Member Avatar for frank.zappa

Hey everybody, I'd like to write a python script which renames a file on my desktop to a number which is 1 less than what it was before. If you're wondering, the number tells me how many days left 'till I finish high school, lol, but I've also got other …

Member Avatar for frank.zappa
0
400
Member Avatar for roro2

I am trying to make the code below make decisions between two different data sources. Basically, if the data source is m_mas it should go through one set of processes, and if it is m_rma, the coding should go through another set of processes. I am not sure if I …

Member Avatar for woooee
0
115
Member Avatar for adamdidthis

Hi all, I have the following string: [CODE]<REQUEST><KEY_HEADER><STATUS>CREATE</STATUS><TIME_CODE>0</TIME_CODE><COUNT>344</COUNT><TARGET>8</TARGET></KEY_HEADER><KEY_INFO><NAME>TEAMLIST</NAME><ARGS>97</ARGS><ARG>COACH: XXX</ARG><ARG>Crusaders</ARG><ARG>WHITE</ARG><ARG>BLACK</ARG><ARG>Crusaders</ARG><ARG>WYATT</ARG><ARG>CROCKETT</ARG><ARG>JASON</ARG><ARG>MacDONALD</ARG><ARG>OWEN</ARG><ARG>FRANKS</ARG><ARG>BRAD</ARG><ARG>THORN</ARG><ARG>ISAAC</ARG><ARG>ROSS</ARG><ARG>KIERAN</ARG><ARG>READ</ARG><ARG>RICHIE</ARG><ARG>McCAW</ARG><ARG>THOMAS</ARG><ARG>WALDROM</ARG><ARG>ANDY</ARG><ARG>ELLIS</ARG><ARG>STEPHEN</ARG><ARG>BRETT</ARG><ARG>ADAM</ARG><ARG>WHITELOCK</ARG><ARG>RYAN</ARG><ARG>CROTTY</ARG><ARG>TIM</ARG><ARG>BATEMAN</ARG><ARG>JARED</ARG><ARG>PAYNE</ARG><ARG>LEON</ARG><ARG>MacDONALD</ARG><ARG>DANIEL</ARG><ARG>PERRIN</ARG><ARG>BRONSON</ARG><ARG>MURRAY</ARG><ARG>MICHAEL</ARG><ARG>PATERSON</ARG><ARG>JONATHON</ARG><ARG>POFF</ARG><ARG>KAHN</ARG><ARG>FOTUALI'I</ARG><ARG>SEAN</ARG><ARG>MAITLAND</ARG><ARG>HAMISH</ARG><ARG>GARD</ARG><ARG> </ARG><ARG> </ARG><ARG></ARG><ARG></ARG><ARG></ARG><ARG></ARG><ARG></ARG><ARG></ARG><ARG></ARG><ARG></ARG><ARG></ARG><ARG></ARG><ARG></ARG><ARG></ARG><ARG></ARG><ARG></ARG><ARG></ARG><ARG></ARG><ARG></ARG><ARG></ARG><ARG></ARG><ARG></ARG><ARG></ARG><ARG></ARG><ARG> </ARG><ARG>1</ARG><ARG>2</ARG><ARG>3</ARG><ARG>4</ARG><ARG>5</ARG><ARG>6</ARG><ARG>7</ARG><ARG>8</ARG><ARG>9</ARG><ARG>10</ARG><ARG>11</ARG><ARG>12</ARG><ARG>13</ARG><ARG>14</ARG><ARG>15</ARG><ARG>16</ARG><ARG>17</ARG><ARG>18</ARG><ARG>19</ARG><ARG>20</ARG><ARG>21</ARG><ARG>22</ARG><ARG> </ARG></KEY_INFO></REQUEST>[/CODE] Yep I know it's a mess but it's the only way I can receive it. What I need to do is loop through the string and change ARG to be ARG then a number e.g. <ARG>14</ARG> changes …

Member Avatar for slate
0
76
Member Avatar for dinilkarun

Hi All, I have the following string: "AND Category 07|Spec 01|ABC 01 AND Category 07|Spec 02|XYZ 02 AND Category 07|Spec 03|PQR 03 " It is stored in a string variable. I want to remove only the "ABC 01", "XYZ 02", "PQR 03", etc from the original string. The new string …

Member Avatar for dinilkarun
0
150
Member Avatar for rinaldinho

Hi, i want to manage 2 type of Exception lightblue._obexcommon.OBEXError 1) lightblue._obexcommon.OBEXError: (111, 'Connection refused') 2) lightblue._obexcommon.OBEXError: (11, 'Resource temporarily unavailable') how i can do it? example: [CODE] try: lightblue.obex.sendfile(device.getAddr(), c[1],"advertisement.jpg") except lightblue._obexcommon.OBEXError????????????: print "Connection refused!" except lightblue._obexcommon.OBEXError????????????: print "Resource temporarily unavailable!" [/CODE]

Member Avatar for scru
0
195
Member Avatar for tomtetlaw
Member Avatar for tomtetlaw
0
454
Member Avatar for perksieuk

Hi everyone I'm new to python and programming in general and wonder if anyone would be able to help me... I am trying to open a text file, search for a certain value (1585 in this case), and then write all of the lines containing this value to a new …

Member Avatar for perksieuk
0
99
Member Avatar for tomtetlaw

When I run this, my charactor won't move, i don't get any errors, he just doesn't move. I've been trying to fix this for ages to no avail, heres my code: [code=python]import pygame pygame.init() class Player: def __init__(self, speed, image): self.move_speed = speed ##self.x = 640/2 ##self.y = 480/2 self.speed …

Member Avatar for slate
0
298
Member Avatar for aot

So, as a scientist, I have plenty of geeky friends... and one of them is interested in creating a sound file from the brain waves she records. Essentially, she has a brain wave, and wants to feed it into a sound program to play it as if it were a …

Member Avatar for Bill Fisher
0
148
Member Avatar for abhinav.sharma

So, Python 2.6.2 is supposed to have the following JSON module: [url]http://docs.python.org/library/json.html[/url] I have the standard MacPython 2.6.2, but the attributes of my JSON library are different, can someone help me fix this? Here's mine: [url=http://img30.imageshack.us/my.php?image=picture1axb.png][img=http://img30.imageshack.us/img30/481/picture1axb.th.png][/url]

Member Avatar for abhinav.sharma
0
139
Member Avatar for mohankumar554

hi how can i import python application from one system into my python application via lan network.i want to use the other system`s python program in my system.

Member Avatar for slate
0
89
Member Avatar for tomtetlaw

When I run this code, the window opens, and i can click on the X button and it quits normally, but my image doesn't show up, heres my code: [code=python]import pygame class Player: def __init__(self, speed, image): self.move_speed = speed self.x = 0 self.y = 0 self.speed = [0,0] self.image …

Member Avatar for slate
0
137
Member Avatar for aparadox

I'm kinda new to python, it really reminds me of Qbasic =\ ANYway lol. I'm looking to do something extra in a class I'm taking. We were to make a budget program. That wasn't the hard part, what im looking to do is be able to save each entry of …

Member Avatar for comprookie2000
0
175
Member Avatar for kiddo39

How can I write a loop using letters instead of numbers so it looks like this: 2 sets used 'a-z' and 'A-Z' aaaaa aaaaA aaaAa aaAaa and so on: aaaAA then on to b: bbbbb bbbbA I can do it with numbers, something like this: [code] for i in range(10): …

Member Avatar for kiddo39
0
4K
Member Avatar for seriousgeek

Hi all python programmers..I'm new to python and i'm having a doubt.. I'm running linux in my machine and i use "ipython" to run my python programs. I also write them in independent .py files.. But I'm not able to write loop-based programs in .py files, because after i save …

Member Avatar for jlm699
0
199
Member Avatar for hughesadam_87

Hey fellas, I have searched for this answer for about an hour on and off and cannot find anything so sorry to have to resort to posting. I have a list [a, b, c, d] And I want to write it to a simple output file, but I want it …

Member Avatar for jlm699
0
141
Member Avatar for aot

Okay, so I'm thinking of taking the plunge into wxPython. But it's especially important to me to know if wxPython can do the following things easily and well: 1) Display a vertical array of radio buttons (or perhaps any buttons will do). They must have no labels, and I need …

Member Avatar for aot
0
255
Member Avatar for mohankumar554

hi, how to access the security module from server system to the client system .. client's every module should be accessed from security module when the user login id is valid.

Member Avatar for vegaseat
-1
62
Member Avatar for mohankumar554

hi, how to get the database values into drop down box in python... how to configure the dropdown box....

Member Avatar for vegaseat
0
168
Member Avatar for hughesadam_87

Hey guys, I'm new to python so if this is a silly question, pardon me. I have the following basic assignment: Take a user-specified range of lines from some data file, call it input, and write them to an output data file. What I want to do is have the …

Member Avatar for The_Kernel
0
140
Member Avatar for kenji

I bought a bunch a cheap books on Python and am wondering whether I should read them as Python 3 introduced changes to the language and so to speak broke old code as far as I can tell. I am reading Programing in Python 3, and after that I was …

Member Avatar for kenji
0
135
Member Avatar for hyperzero4

Hello, I'm doing a project doing atomic models and am using a toolkit that was developed for Python 2.4 on Ubuntu. I have Python 2.4 installed as my default python currently; however, when I download the tools I need from the synaptic package manager. They only work for my original …

Member Avatar for woooee
0
156
Member Avatar for kiddo39

I'm trying to locate the 'x' positions of certain pixels. Here's and example image: [url]http://img404.imageshack.us/img404/3418/10x.png[/url] if I run this code it gives me the 88 'odd' pixels that I'm looking for: [code] from PIL import Image i = Image.open('10x.bmp') # I save it as a bmp for pixel in i.getdata(): …

Member Avatar for kiddo39
0
2K
Member Avatar for David.lewing

How do you store info (such as highscores, phone numbers, etc.) for your python program? I am thinking like you enter things into a list and then the next time you open the program you can acces that list with all the old info. Thanks.

Member Avatar for David.lewing
0
143
Member Avatar for bhanu1225

Hello All. I got a doubt. In general, for updating remote database, we use ip address for the remote system. Here, i would like to update two remote systems at a time. I wrote the code like the below one. Could anyone please give the correct advice and suggestions. [B]try: …

Member Avatar for jice
0
285

The End.