15,175 Topics
| |
Ok.. so I just started python (just = 3 hours ago). I have basic input and output set. Hell I even understand slicing and stuff (OMG SUBSTRINGS SO MUCH EASIER ON PYTHON :O ) but Im finding it not so easy to understand how to use for loops (silly me. … | |
[B]Context[/B] I'm retrieving data from Google Analytics (via the python-googleanalytics library, as Google's API is way too complex for me right now) and putting that data into a table using an HTML library. Python experience: very low. [B]Problem[/B] I have this: [u'string', u'string'] [integer] [u'string', u'string'] [integer] [u'string', u'string'] [integer] … | |
Hi. I want to sort the keys of my dictionary. The keys are consisted of list of 3 different numbers, for instance - (0, 5, 0) So I want to sort them first over key[2], then over key[1] and then over key[0] Then to print the value accorfing to the … | |
Hello! I have defined a function to create a combo box to log into a database [CODE]def comboLogin(): import MySQLdb db= MySQLdb.connect(host='localhost', user='root' , passwd='acrsci00', db='Ornithobase') self.cursor = db.cursor() sql = '''select Username from Users''' self.cursor.execute(sql) result = self.cursor.fetchall() result2 = [] x = 0 for record in result: for … | |
Looking for 'unqualified exec is not allowed in function' lead here... This is a collaborative thing... so here's all of the code (some parts just description of eventual 'future' implementation) for a [I]universal code parser[/I] (biiig name for a smaaaall thing, that is not working at all yet, and is … | |
im trying to make it so that the discount box will only accept numeric input to 2dp, and i know the code is roughly solid, but when i run the code, it says CashTransaction has no attribute discount input, and i have been tinkering with this code for the better … | |
Hello daniweb I am currently trying to convert one of my finished python games to a working executable file for windows, which proves harder than expected even though the py2exe side-package is avalable. The program i'm trying to convert is [URL="http://dl.dropbox.com/u/2905284/The_Pirate_Game_v1.1.2.rar"]The Pirate Game[/URL]. I create the standard file for using … | |
Hello Python community :) This is my first post so don`t judge strictly. I need the user's client to start, so that the user may edit the message and decide himself whether he clicks on the Send button to really send it. I have searched on google and most code … | |
Been a while since I posted anything here, so I decided to post what I've currently been working on. I use ImageChops to get a difference between two consecutive frames from my webcam. I would like to replace the pixel values > rgb 50, 50, 50 with 255, 0, 0. … | |
Been banging at this all day HELP! I had to go back to Python 2.5 from 2.6 and now everytime I try and run my setup.py py2exe it gives me the error that it cannot find the python26.dll. I have uninstalled and reinstalled and even went into the registry and … | |
Hello! I have this function that prompts a wx.MessageDialog [CODE]def DelUserDlg(self, event): dlg = wx.MessageDialog(None, 'Are you sure you want to delete your user?', 'Question', wx.OK | wx.CANCEL | wx.NO_DEFAULT | wx.ICON_QUESTION) dlg.ShowModal()[/CODE] I would like to assign an event to delete a mysql database user. How can I assign … | |
Hey guys, I posted earlier about py2exe not working in general. Now I got it to actually run, but the .exe produced does not work... Any help would be appreciated. Thanks. Info: I've tried various things to solve this issue, but no luck. When I run my setup.bat file, which … | |
Using py2exe I've made an exe file which processes a file then creates a new file which details the errors found in the original file. However, at the moment I have to change the file allocation in the code each time I want to do it on a different file … | |
First of all, thank you for taking the time to read my question. With the following code, what I have done is make a database in MySQL and created a table using python. I then imported an excel document with three columns. These three colums are: 1. POS_TYPE which is … | |
how do i print the 3 most common word that begins with capitals? also how do i count how many times they appear? | |
>>> import g4 >>> g4.systs() Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'module' object has no attribute 'systs' Why is that ? The code works ok from shell >>> import time >>> def systs(): return str(time.localtime()[5]) >>> systs() '18' g4.py ------- [CODE] import os import … | |
Hello everyone, I am currently working on a code and I got stuck in a part. My algorithm is a text generator that operates on project Gutenberg and its flow is like this: Enter a sentence as input 1-Pick longest word of input sentence 2-Search the longest word of the … | |
After importing the script below as g4.py as >>import g4 followed by >>> pad ="ram:t/list.lha" >>> g4.extract(pad,"path") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "g4.py", line 52, in extract return takeaction.get(itemnw,errhandler)(fromvar) TypeError: errhandler() takes no arguments (1 given) This error does not appear when i … | |
Hi, i have downloaded 3d blender and Python 2.5 and tried to run Python with blender for the use of importing models, but when i tried to import the model a message came up in the command prompt saying : [CODE]module use of python25.dll conflicts with this version of python[/CODE] … | |
I'm new to python and programming in general but I'm looking into off site backup programs. I'm wondering how to code differential backups, any help would be greatly appreciated. | |
hello for exapmle cam sees people.and ıt should detect dıstance between people how can we calculate ıt does anyone any ıdea about ıt? ı couldnt fıgure out the algorıthm:) thanks | |
Hello! I have designed an initial frame for a database app using this code [CODE]#! /usr/bin/env python # OrnithobaseGUI.py import wx, MySQLdb, wx.lib.intctrl ID_HELP = 1 ID_ABOUT = 2 ID_LOG=3 class Ornithobase(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, id, title, size=(750,225)) #Define menus menubar = wx.MenuBar() #Define file menu … | |
If you bind a Tkinter widget to an event, normally only the event information is passed to the function responding to the specific event like a mouse click. Python allows you to expand the event handler to include any number of values to be passed on. Here is a typical … | |
Hello! I have written this dialog to connect to a MySQL database. It asks for the Username and Password, and it should use this data to connect to the database. [CODE]#! /usr/bin/env python # pwd.py import wx, MySQLdb class LoginDlg(wx.Dialog): def __init__(self): wx.Dialog.__init__(self, None, -1, 'Login', size=(250,150)) # widgets userLbl … | |
Okay, so yet another post here due to my utter confusion with this language...in all honesty, this isn't a question about threading, per say, lemme just demonstrate what I mean. This: [CODE]class RevoiceThread( threading.Thread ): def run (self): print "Remember to replace this line with the actual code" [/CODE] is … | |
I'm a newbie to python and I have a problem. My problem is that I have a CSV file with hundreds and hundreds of rows of data. Each row contains temperature data that has been recorded daily. What I want to do is try to extract certain rows of data … | |
Defining a Class Define the class rectangle. It's constructor takes a pair of numbers representing the top-left corner, and two other numbers representing the width and height. It has the following methods: * getBottomright() - return the bottom right corner as a pair of numbers. * move(p) - move the … | |
I'm quite new in Python. I've been trying to solve this IndexError but couldn't get the answer yet. Need you guys advice or help. I want to extract the sentence matched with the keyword strSearch from 5gm-007 file(just text file). The error occured in "[COLOR="Red"]str5gram = lines[a][/COLOR]". here is the … | |
Hello all, I recently made a mysql database using python and imported an excel file into the database. However, I am having some issues with some of the python. Using the following code, I have selected 11 numbers from a table in the database. # c.execute('SELECT REF_PNL FROM actual_data_table WHERE … | |
I found this little program for a game in a book. [CODE]class Tank (object): def _init_(self, name): self.name = name self.alive = True self.ammo = 5 self.armor = 60[/CODE] It is named tank.py When I import it in python and I try to add [CODE]my_tank = Tank("Bob")[/CODE] Python gives an … |
The End.