15,181 Topics

Member Avatar for
Member Avatar for mahela007

Is there someway I can parse badly written HTML code in python? I want to get some info from a web page which uses HTML tables for it's formatting and I found numerous flaws in the code using w3cs validator. can I parse this code in python?

Member Avatar for mahela007
0
93
Member Avatar for explorepython

Hello all, After googling around for a few hours i can't find any example for passing arguments to an user-defined method in pyqt.. The only link i found related to this is [URL="http://www.commandprompt.com/community/pyqt/x1408"]http://www.commandprompt.com/community/pyqt/x1408[/URL] . In this example we have to make it to emit the signal and pass the argument.. …

Member Avatar for explorepython
0
1K
Member Avatar for Godflesh

Hello! I have more questions :) Is it possibe to create a "threadlock", "lock" if you use a file as a common resource? If you have a class that create data and put the data into a file and you have another class that will take data from the same …

Member Avatar for Gribouillis
0
97
Member Avatar for Godflesh

Hello i have a big problem, i want to import queue but i get this message, somehow it dont exist. Traceback (most recent call last): File "D:\Python26\test.py", line 9, in <module> import queue ImportError: No module named queue isnt that strange.

Member Avatar for Godflesh
0
16K
Member Avatar for Krstevski

I have created upload script and worked great, but I don't know how do I check the size of the file before upload because I want to limited on 10mb per file... So, mu question is: How do I check the size of the file before upload ? Thanks...

Member Avatar for Krstevski
0
99
Member Avatar for lewashby

I'M reading "Beginning Game Develpment with Python and Pygame". In the following code, I'M gettin this error in sysfont.py [COLOR="Red"]NameError: global name 'glob' is not defined[/COLOR] [CODE]import pygame from pygame.locals import * from sys import exit pygame.init() SCREEN_SIZE = (800, 600) screen = pygame.display.set_mode(SCREEN_SIZE, 0, 32) font = pygame.font.SysFont("arial", 16) …

Member Avatar for Firewolf
0
835
Member Avatar for emir_gradacac

I have a folder with my game on Desktop. I've installed py2exe, 'cause it seemed to be a very good game and I wanted to share it. Now, I did everything right (i followed youtube tutorial), but when I start command prompt and typed 'a.py py2exe' it returned a message …

Member Avatar for Stefano Mtangoo
0
151
Member Avatar for gunbuster363

I want to use MySQLDB to connect MySQL but I got a problem. the problem is: --------------------------------------------------------------------------------- cs6201:/home/lamwaiman/python/data # python dm.py Traceback (most recent call last): File "dm.py", line 11, in <module> import MySQLdb File "build/bdist.linux-i686/egg/MySQLdb/__init__.py", line 19, in <module> File "build/bdist.linux-i686/egg/_mysql.py", line 7, in <module> File "build/bdist.linux-i686/egg/_mysql.py", line 6, …

Member Avatar for Stefano Mtangoo
0
378
Member Avatar for Godflesh

Hello again! I have a new question. I have run a script and wants to run it again with a "keypress" input from the user, how do i code that. Like this: import subprocess drive=input(" If you want to start the script again , press 1: ") if drive == …

Member Avatar for Godflesh
0
2K
Member Avatar for ivh90

hey all what is the best way to execute a certain function repeatedly after a certain period of time ? for example: the increment of a certain variable every second thx

Member Avatar for Namibnat
0
58
Member Avatar for El Duke

Hi, I am using Linux, and I was looking for free source code ( Python) for speech recognition, I found "Speech" for Windows. I have tried to run it on Linux, I got errors of missing modules, I found most of them online but when I got this error: [COLOR="Red"]No …

Member Avatar for El Duke
0
152
Member Avatar for butcher71793

i am making a game in python 2.3.5 and i wanted to know if there is a command that would make it so one sprite will move to another no matter what the position is on the screen.

Member Avatar for Firewolf
0
165
Member Avatar for charlottetemp

Hello. I am stuck on a simple piece of code. For some reason it keeps saying it can't call the Str object. Im also unsure on how to float the data to 2 decimal points (i don't know where the 2.f% should go.) The task is to make a taxi …

Member Avatar for charlottetemp
0
7K
Member Avatar for selimhanov

Hi, It must be a simple issue, but couldn't find any answer googling. Here is the problem: I have a simple test application with a TextCtrl, Button and StaticText. When I press the Button, it must query PostgreSQL with ...[code]SELECT name FROM contacts WHERE name LIKE '%"+TextCtrl.Value+"%'[/code] and return the …

Member Avatar for Pupo
0
153
Member Avatar for ewall

I've been working on a simple little PyGTK app that shows an icon in the system tray. When you right-click, the pop-up menu appears as expected. However, first the menu appears with just some up and down scroll arrows, and I have to scroll down before it fills in and …

Member Avatar for ewall
0
217
Member Avatar for gangster88

how could i print the length of a parameter?.. like def length(word) gives the output "word 4"?.. I have no clue of what to do? def length(): len=length()

Member Avatar for vegaseat
0
117
Member Avatar for punter999

[CODE]import wx class McaMenu(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, id, title, size=(640, 432)) menubar = wx.MenuBar() file = wx.Menu() new = wx.MenuItem(file, 1, '&New\tCtrl+N', 'Creates a new document') file.AppendItem(new) file.AppendSeparator() open = wx.MenuItem(file, 2, '&Open\tCtrl+O', 'Open New document') file.AppendItem(open) save = wx.MenuItem(file, 3, '&Save\tCtrl+S', 'Save') file.AppendItem(save) save = …

Member Avatar for Namibnat
0
170
Member Avatar for gangster88

How could i index the program to output e.g. displayDate(10, 2, 2009) gives "10 Feb 2009" as the output. [code] def displayDate(day, month, year): Months = ['Jan', 'Feb', 'March', 'April', 'May', 'June', 'July', 'August', 'Sept', 'October', 'December'] [/code]

Member Avatar for vegaseat
0
102
Member Avatar for kbalamuk

I have a string as such: str = 'C:\Process new\RF\test.dat' I need to replace all the backslashes with '/': res = 'C:/Process new/RF/test.dat' It is NOT a straight forward search and replace as I need to replace escape sequence (\). Any ideas?

Member Avatar for slate
0
10K
Member Avatar for personx121232

hi there,i have installed win32all package for python 2.5 , but now the python IDLE does not load any more...whats the problem,thanks.

Member Avatar for Stefano Mtangoo
0
87
Member Avatar for spogs

When I do the following: [code] s= serial.Serial('/dev/',9600) # or set a function and pass via command line s= serial.Serial(arg1,9600) [/code] The code executes without any error. [b]But[/b], when I use AJAX and POST the parameters to the script [code] def index(req): info = req.form sys.stderr = sys.stdout s= serial.Serial(info['device'],9600) …

Member Avatar for spogs
0
113
Member Avatar for snake03

Hi I am new to python and am learning how to use tkinter. I am creating a game and need to create callbacks for the buttons so the game has a cell location when a player clicks on the corresponding button. I am unsure on how to do this, hope …

Member Avatar for vegaseat
0
96
Member Avatar for gunbuster363

Hi, I am new to here. I am doing with my honours project in University, it is about data mining. Before I can do data mining, first I need data. I want to extract data from a site : [url]www.tripadvisor.com[/url] Should I write my web crawler with python? I don't …

Member Avatar for gunbuster363
0
440
Member Avatar for Godflesh

How can you check the length of a file / list and then use the value in an "if-loop" in python? I want to create a "if-sats" that must check the amount of elements(numbers) in a textfile, if the amount is less then 5 do this... else do that..

Member Avatar for Godflesh
0
97
Member Avatar for danibootstrap

Hi, The following is a GPS string: $GPGGA,092204.999,4250.5589,S,14718.5084,E,1,12,24.4,89.6,M,,,0000*1F $GPGSA,093345.679,4234.7899,N,11344.2567,W,3,02,24.5,1000.23,M,,,0000*1F $GPGSV,044584.936,1276.5539,N,88734.1543,E,2,04,33.5,600.323,M,,,*00 $GPRMC,199304.973,3248.7780,N,11355.7832,W,1,06,02.2,25722.5,M,,,*00 $GPVTG,066487.954,4572.0089,S,45572.3345,W,3,09,15.0,35000.00,M,,,*1F I want to extract the line following and including $GPGGAand $GPRMC.The GPS string length is variable.Please let me know how to do this and store each of them into a single string or 2 separate strings. thanks in …

Member Avatar for slate
0
117
Member Avatar for fuston05

making for practice a temp converter. i got the basic program to convert C to F. heres that part: C = input("what temperature (celius) do you need converted? ") print "%s degrees celsius is equal to %s degrees Farenheit" % (C, 32+(212-32) / 100.0 * C now im trying to …

Member Avatar for fuston05
0
163
Member Avatar for punter999

import wx class McaMenu(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, id, title, size=(640, 432)) menubar = wx.MenuBar() file = wx.Menu() new = wx.MenuItem(file, 1, '&New\tCtrl+N', 'Creates a new document') file.AppendItem(new) file.AppendSeparator() open = wx.MenuItem(file, 2, '&Open\tCtrl+O', 'Open New document') file.AppendItem(open) save = wx.MenuItem(file, 3, '&Save\tCtrl+S', 'Save') file.AppendItem(save) save = …

Member Avatar for Namibnat
0
107
Member Avatar for Godflesh

Hello! I have some probs with this code, somehow it dont loop 10 times as it should, just one? How do i make python use a testfil.txt that already exist? I dont want to remove the old data in the file just add new data to it? In this code, …

Member Avatar for Godflesh
0
83
Member Avatar for Cornholio

Hi, I have jest started learning Python. I would like to get some help on writing a script that would delete a set number of lines from a text file which looks like this : 1846440556 1846440521 1846440491 1846440505 1846441137 1846441102 1846441080 1846441331 1846441323 1846441315 ... ... Thanks in advance …

Member Avatar for Godflesh
0
26K
Member Avatar for lrh9

And I can't get anything I write to work. I'm so far off course I think I just need a working example of import hooks in action. I've looked for examples on the Internet, but they only show what looks like correct code. They never show that code in action. …

Member Avatar for lrh9
0
346

The End.