14,962 Topics

Member Avatar for
Member Avatar for acrocephalus

Hello! I have a problem which I think it is related to Python, however I may be wrong. I am writing a database using wx.Python and MySQLdb. My problem is that when I want to send some string which contains accents to the MySQL database (for instance, 'Empordà') it is …

Member Avatar for acrocephalus
0
411
Member Avatar for acrocephalus

Hello! I am trying to set up a masked combobox using wx.lib.masked.combobox.BaseMaskedComboBox with autocompletion. However, I've found a couple of problems. On one hand, if I run the code as I provide it (code at the end of the post), I get an error caused by the 'Antigua and Bermuda' …

Member Avatar for acrocephalus
0
164
Member Avatar for Ashena

Hi everyone. I have two dictionaries. In dictionary1 I have numbers as keys and the occurrence of those numbers as values. In dictonary2 I have numbers again as keys, but there are more numbers here than in dictionary1. The values in dictionary2 are the description of the numbers. From dictionary1 …

Member Avatar for Ashena
0
103
Member Avatar for recyan

Hi, Am a total newbie to programming & trying to learn python thro pdf tutorials. I have this working code which uses four numbers as arguments to calculate the distance between 2 points. Tried to unsuccessfully convert it to use Class. Can some one guide me & can I request …

Member Avatar for recyan
0
2K
Member Avatar for omprakashrudhru

I have been using Pymssql to connect to MS SQL Server from Python. Currently I am not able to debug my python scripts due to a issue ("No buffer space available") in pymssql. I was also thinking of other options like using pyodbc. I need a good solution to connect …

0
61
Member Avatar for sss33

When you have a file with a lot of lines of numbers. I want to know if instead of writing the formula to calculate the numbers for everyline of data. Is there a way to tell it to apply the formula I have made to every line until there are …

Member Avatar for Gribouillis
0
95
Member Avatar for Ghostenshell

How would I pass something from a driver into a list inside a class. I then need remove a word from the list and replace it with a new word.

Member Avatar for griswolf
0
153
Member Avatar for lewashby

[CODE]background_image_filename = 'sushiplate.jpg' sprite_image_filename = 'fugu.png' # imports import pygame from pygame.locals import * from sys import exit from gameobjects import Vectory2 pygame.init() screen = pygame.display.set_mode((640, 480), 0, 32) background = pygame.image.load(background_image_filename).convert() sprite = pygame.image.load(sprite_image_filename).convert_alpha() clock = pygame.time.Clock() position = Vectory2(100.0, 100.0) speed = 250. heading = Vectory2 while True: …

0
69
Member Avatar for jayzee1989

So I have an assingment that I am stuck on -_- So I am supposed to create a code that "tests" out a range of integers and determine the perfect squares(4,16,25, etc) within the range without using square root calculations and using a function. I have written the following, and …

Member Avatar for TrustyTony
0
107
Member Avatar for JJHT7439

Alright, so for the lab I have to do using turtle in python I have to draw an H and then draw H's off of each end of the first H at a 45 degree angle and switch the color between blue and orange. The first H has to be …

Member Avatar for JJHT7439
0
105
Member Avatar for python_user

Hi Everybody, Can someone please tell me how to pass a frame to other class method I am able to pass the frame but when i pack some entry field..the window stops responding here is my code [CODE]class InfoFrame: def addAttributeCriteria(self, parent = None, type = '', attrib = {}, …

Member Avatar for TrustyTony
0
143
Member Avatar for sravi.pearl

hai i am new to python, can any one please help me how to parse data from an html file, i want to display the content which lies under a particular tag,and also can you please tell where can i find tutorials for this topic with sample examples.

Member Avatar for griswolf
0
247
Member Avatar for novice20

can anyone pls illustrate the use of snmpget in python, along with the explanation?? thanx in advance:)

0
70
Member Avatar for sss33

out = open ("output.jh") towrite= a+b out.write (towrite) When you want to put an output to a file. instead of the information going right next to eachother how could they go one over the other in the file. This would be for many different outputs.

Member Avatar for cghtkh
0
97
Member Avatar for janaka_17

i'm a new comer to this language. can anybody tell me why this simple piece of code gives me an error indicating that "NameError,name 'example' is not defined". by the way i use Wing IDE to write my codings. class example(): def _init_ (): print("a class is created") def m1 …

Member Avatar for woooee
0
84
Member Avatar for sss33

A file called input. john 9 7 6 7 4 3 9 5(double space)76 54 53 77 65(double space)4 45 45 def main(): fin = open ("input", "r") line = fin.readline() x = line.split(" ") a= (int (x [1])+ int (x [2]) +int (x [3])+ int (x [4]) +int (x …

Member Avatar for cghtkh
0
135
Member Avatar for lamtupa

Dear friends, I get a assigment and i very confused with this cases. How to write a function that computes the area of an arbitrary polygon – so not necessarily a triangle or rectangle, etc. The input of the function should be a list of points, where each point is …

Member Avatar for TrustyTony
0
202
Member Avatar for nbuchholz

I'm in the midst of developing a Python toolset for some proprietary hardware used at NOAO. The code has to write a series of EEPROMS in the hardware to determine conversion factors for hardware attributes. The EEPROM format is 2048 32-bit words each word represents the slope, intercept, minimum or …

0
96
Member Avatar for Roelof Wobben

hello I have this programm [code] class zoeken() : pass def __len__(self): return 0 def __str__(self): return test2 def find(self, strng="", ch="", start=0, stop=0): index = start while index < len(strng) and index < stop: if strng[index] == ch: return index index += 1 return -1 test = zoeken() test.woord …

Member Avatar for snippsat
0
118
Member Avatar for znake

Hi, I've just started learning python (and programming overall) and I would like to ask for a little help from you, guys. What fascinates me (and you may think it's weird) is programs which simulate human's action/behavior (bots), so I wanted to ask if anyone could show me some good …

0
167
Member Avatar for bettersaid

someone knows how to launch an app in mac?? [CODE] import os class LaunchApp: def launch(self): os.startfile("/Applications/QuickTime Player.app") s = LaunchApp() s.launch()[/CODE] this code works on windows and [CODE]os.system('gnome-open ' + /path)[/CODE] on linux but in mac, it returns this error "AttributeError: 'module' object has no attribute 'startfile'"

Member Avatar for nathan099
0
1K
Member Avatar for acrocephalus

Hello! I have a table with some rows and cells (code at the end), and created a function which searches for text inside the cells and returns the row number where the text is (to simplify the example, only English Name is working). Then, it should set the grid cursor …

Member Avatar for acrocephalus
0
152
Member Avatar for Macooper26

I just downloaded Python 2.7 and 3.2 and it just looks like DOS. I'm using Windows, so I don't know if that's the problem--because I saw someone using a MAC and it looked like they didn't have the same problems that I'm having--because I can't save and I have no …

0
35
Member Avatar for acrocephalus

Hello! How can I destroy a wx.MessageDialog after a given amount of time? I have tried EndModal without success. Cheers! Dani

Member Avatar for SoulMazer
0
83
Member Avatar for lewashby

I have another post entitled 'understanding wxPython' in which my code runs but fails to build the scroll bars as shown by my python programming book. Note that the code in the book is running on Windows and mine is running on Ubuntu.

Member Avatar for SoulMazer
0
132
Member Avatar for ihatehippies

why does this fail to call any event? [CODE=python] def StartTimer(self, timer = 1): timer_data = { 1: (self.TimeKeeper, False, 50), 2: (self.InterimSearch, True, 200), 3: (self.InterimCurSearch, True, 200), 4: (self.SetOpaque, False, 50), 5: (self.DisplayPhoto, True, 200) } function, singlefire, time = timer_data[timer] timer = str(timer) # class of constants …

0
148
Member Avatar for bspace

Hi, I'm trying to learn OOP, and I've run into a problem. I am supposed to have the user create a user name, and then I'm supposed to import a list of movies for the user to rate. I created a class called Movie. The function within is supposed to …

Member Avatar for bspace
0
245
Member Avatar for sss33

How to convert numbers from a file into integers the numbers in the file are alerady split but they are strings. Doesnt anyone know how to convert them to integers so they can be manipulated as numbers.

Member Avatar for griswolf
0
101
Member Avatar for Ghostenshell

Really stuck on this and its supposed to be easy. I'm supposed to input 2 positive nonzero integers into x and y. Then return the value of x times y. The book has an example of 7 * 4 = 4 + 4 + 4 + 4 + 4 + …

Member Avatar for TrustyTony
0
139
Member Avatar for james27

hello ALL im making some simple python post script but it not working well. there is 2 part to have to login. first login is using 'http://mybuddy.buddybuddy.co.kr/userinfo/UserInfo.asp' this one. and second login is using 'http://user.buddybuddy.co.kr/usercheck/UserCheckPWExec.asp' i can login first login page, but i couldn't login second page website. and return …

0
87

The End.