15,192 Topics

Member Avatar for
Member Avatar for paquerettee

Hi, could you tell me where I can find some information about regex engine optimizations used by Python regex engine?

0
22
Member Avatar for sob_andizzle

i have to write a code that tells the user to enter the amount of minutes they were allowed to use, it has to be between 200 and 800 if it exceeds or goes below then it should print "please enter minutes between 200 and 800" the problem is: if …

Member Avatar for jice
0
142
Member Avatar for kur3k

Hello My english is not good, so pleas - understat me ;-) I have two question about python ;) 1. I'm from poland, in poland letter a == ą, z == ź itp. Can i remove polsich letter? example in input - jacek bąk in output - jacek bak I …

Member Avatar for jice
0
668
Member Avatar for Purnima12

[CODE] while True: try: wd = int(input('How wide would you like your letter to be? (5 - 20)' + ': ')) break except ValueError: print ("Oops! That was no valid number. Try again...")[/CODE] If the user inserts a number that is not 5 - 20, I want the program to …

Member Avatar for TrustyTony
0
540
Member Avatar for jozz3

How would you define a recursive function that asks the user for a string and prints it from the outside in. For example, 123456 would print as 162534. Any help would be appreciated.

Member Avatar for jozz3
0
573
Member Avatar for sob_andizzle

please please please help me this is my last program i have to write and i am having difficulty, this could mean a pass or fail. Thank you for your patience and help. I need a very simple code that asks the user, #input the minutes that are allowed how …

Member Avatar for sob_andizzle
0
102
Member Avatar for ihatehippies

[CODE=python]>>> import wx >>> wx.NullBitmap.SubBitmap Traceback (most recent call last): File "<pyshell#0>", line 1, in <module> wx.NullBitmap.SubBitmap File "C:\Python25\lib\site-packages\wx-2.8-msw-unicode\wx\_gdi.py", line 659, in GetSubBitmap return _gdi_.Bitmap_GetSubBitmap(*args, **kwargs) TypeError: Bitmap_GetSubBitmap() takes exactly 2 arguments (1 given)[/CODE] I didn't call it, I just tried to reference it. happens with all these methods wx.DefaultDateTime.Day …

Member Avatar for ihatehippies
0
222
Member Avatar for ITgirl2010

Ive started with this program def calcFinal(): while True: try: asg1Mark = int(raw_input("Enter Asg1 mark: ")) asg2Mark = int(raw_input("Enter Asg2 mark: ")) examMark = int(raw_input("Enter Exam mark: ")) final = asg1Mark + asg2Mark + examMark return final except ValueError: print 'Please enter only numbers' def mark_check(finalMark): print "Final mark is …

Member Avatar for woooee
0
112
Member Avatar for Stev0

Several weeks ago, I wrote a simple web crawler that was designed to simply retrieve robots.txt from a range of IP addresses. It was entirely CLI based, and I had it working perfectly. As my python experience has increased, I decided to start learning about GUI based programming, and decided …

Member Avatar for Stev0
0
162
Member Avatar for Hoban

First off this is for a homework assignment and I am new to python. I have attempted to tweak an example of how to make a table from another post on this forum but with no luck. Here are my problems: 1) my range is small (0, 1, 0.1) This …

Member Avatar for vegaseat
0
113
Member Avatar for goodwin912

I've got a little app to resize and watermark images. At the moment it only does one at a time but I would like to get it to do a full folder of images in one go. I have done this previously in VB using loops but im new to …

Member Avatar for Tech B
0
229
Member Avatar for ktsangop

Hi everybody. Could someone explain me the usage of python's modulo operator and/or the fmod function? why do i get these results? >>> 23%0.1 0.099999999999998729 >>> import math >>> math.fmod(23,0.1) 0.099999999999998729 >>> normally 23 mod 0.1 = 0 because 23 / 0.1 = 230 exactly is there anything wrong there …

Member Avatar for ktsangop
0
242
Member Avatar for kjock002

the random function gives you a number between 0.0 and 1.0 . im trying to get a random number between -0.5 and 0.5. i asked someone for help and they told me to go off of this: [0, 1) + .1 this changes the range to [1, 2) and i …

Member Avatar for Gribouillis
0
98
Member Avatar for leviaeon

i am really wondering why this type of error continues to occur for every bluetooth code i try.. i am trying to connect to a bluetooth module... i am wondering why i cant connect to that module where in i can connect to other devices like mobile phone and laptops... …

0
58
Member Avatar for leviaeon

i have an error with this sample code i got from the net... the error says: TypeError: unsupported operand types for +: 'int' and 'str' here is the code: from time import ctime [COLOR="Red"]import[/COLOR] codecs [COLOR="red"]import[/COLOR] inbox, appuifw box = inbox.Inbox() msg = box.sms_messages() f = [COLOR="red"]codecs.[/COLOR][COLOR="Green"]open[/COLOR]('E:/Others/listSMS.txt', 'w', 'utf8') # …

Member Avatar for leviaeon
0
90
Member Avatar for LostGurl

Hello.. Im doing some simple text processing using Python which include indexing, splitting and tokenizing text from folder. i want to improve the stemming and tagging process using MontyLingua by importing the Monty library for tokenizing and tagging. I dont know how to edit and call them in my coding. …

Member Avatar for PassBy
0
483
Member Avatar for kjock002

the program below simulates a game of craps and its pretty much done except for a way to get the while loop to stop. i was trying to get an input from the user when they wanted to stop rolling and to enter "n" for no but im not sure …

Member Avatar for jcao219
0
115
Member Avatar for kjock002

so im trying to simulate a walk where the user will randomly take either a step forward or backwards, hence using the probability of a coin flip. i think the program is pretty much self explanatory. i just need help debugging it because it doesn't seem to work properly yet. …

Member Avatar for jcao219
0
179
Member Avatar for girlscodetoo

Hi Guys! I am a Python noob. I wanted to merge data and eliminate duplicates. I have the solution. Now I am stuck at dumping the dict contents to MySQL. Any help is really appreciated. Data : [QUOTE]a b c d e f key dupe -------------------- 1 d c f …

Member Avatar for girlscodetoo
0
182
Member Avatar for JJBallanger

Hi there, As a student I am new to python and am struggling with the following program I have been tasked to create. My code so far is like so. The idea is that the function will take a guess x, incorporate an arbitrary function f(x) and then take feps, …

Member Avatar for JJBallanger
0
229
Member Avatar for alabay2010

Hello everyone! I have task to write a program that would read a data from any txt file and visualize it on a bar chart using turtle module. I have to structure the program using modules and functions for nice design. The program must be fit for any other txt …

Member Avatar for TrustyTony
0
621
Member Avatar for zoro007

Hello, I want know how to find some of words in a file. For example : find one word [CODE]if "word" in open(file).read(): print file[/CODE] I wand do that but with 5 words [ word1 , word2 , word3 , word4 , word5 ] If find word1 or word2 or …

Member Avatar for sebcbien
0
162
Member Avatar for belboy

Country Gold Silver Bronze Total US 9 15 13 37 GE 10 13 7 30 CA 14 7 5 26 NO 9 8 6 23 AU 4 6 6 16 RF 3 5 7 15 KO 6 6 2 14 CH 5 2 4 11 SW 5 2 4 11 …

Member Avatar for TrustyTony
0
112
Member Avatar for kjock002

i found this code [URL="http://www.daniweb.com/forums/thread233959.html"]here[/URL] and i tested the code and it isn't working for me this is what my code looks like: [CODE] # PURPOSE: to count the number of words, lines, and characters in a file # # INPUT(S): a file name to be used # # OUTPUT(S): …

Member Avatar for TrustyTony
0
2K
Member Avatar for ihatehippies

Anyone know of a way to tell the difference between an inherited class method and a individually defined one? ie: [CODE=python]class test(str): def unique(self): pass x = test() # how to test for difference between x.unique # and x.lower[/CODE]

Member Avatar for ihatehippies
0
73
Member Avatar for pareshverma91

can any one please give me a link from where i can find out how python executes internally,i mean the way objects are declared, stuff stored etc.

Member Avatar for scru
0
107
Member Avatar for peppermints

[CODE]from Tkinter import * import random weapons = ("rock", "paper", "scissors") class Application(Frame): def __init__(self, master): Frame.__init__(self, master) self.grid() self.create_widgets() def create_widgets(self): Label(self, text = "Choose your weapon!\n" ).grid(row = 0, column = 0, sticky = W) Label(self, text = "Weapons:" ).grid(row = 1, column = 0, sticky = W) …

Member Avatar for jcao219
0
714
Member Avatar for Enders_Game

***Editted: added second problem I have this code, how do I make it stop once it's found the first instance of the [B]if[/B] happening. break, myparser.close(), and return don't work. [CODE]from html.parser import HTMLParser class MyHTMLParser(HTMLParser): def handle_starttag(self, tag, attrs): if tag == 'a' and (attrs[0][1].find('downloads&showfile') != -1): print(attrs[0][1]) print(attrs[1][1]) …

Member Avatar for Enders_Game
0
169
Member Avatar for Diomedes

Hello Python forums, I started working with Python recently and picked up a book. The book stated discussing using the ctypes module in python which is slick because it's exactly what I need to be learning. I started trying to test my knowledge by implementing a simple, singly linked list …

Member Avatar for TrustyTony
0
692
Member Avatar for biomed

I have files that contain lists of lists. Each file has about 20.000 lists that each list member is a list of itself with 15 values. Think of it as a database table. I know we can use a binary search to find a member of a list but can …

Member Avatar for sneekula
0
137

The End.