14,947 Topics
| |
Hello .. I'm new in python and I have a problem in a project that I have to deliver later this week (the dashboard of a car). Whenever I do a refresh of the frame to update data pointers account revolutions speedometer .. he paints everything again including background image … | |
Hey, I need help with setting up an authentication code. I am currently working on a project to build a blog server in python for an intro level python course. We are using the PESTO and POSTGRESQL wsgi and sql clients respectively. I am trying to authenticate against a user … | |
| What is the most efficient way to: [LIST=1] [*]Check if a list has duplicate items (return a boolean) [*]Get duplicate items in a list (return a list) [/LIST] I'm looking for something quick and concise, as my solutions are rather cumbersome: [CODE]def list_has_duplicate_items( L ): for item in L: if … |
Hello, pls.can anybody help me? I try to solve a exercise where I need to involve random module. Here is a text: Exercise 2 In this example, ties are broken by comparing words, so words with the same length appear in alphabetical order. For other applications you might want to … | |
Is there a way to append the current date to an output file. My output statement looks like, [CODE]result=open('Results.csv','wb')[/CODE] If I run it today, I would like the file name to be something like Results20100528 (for May 28, 2010). If I run it tomorrow, I would like it to be … | |
I use python for various personal projects and hobby stuff. I do mostly command line stuff, just cuz I don't need the gui for a lot of it. I would like to start moving on to GUIs, but I have run into a problem. I started with Python v3. All … | |
Input 2x+x Return: 3x Input: +2x-1y+3x+2 Return: 5x-y+2 | |
hey guys... I have a simple question ... is it possible to write a python code (a function or a class) that would take coordinates as parameters (four angles of a rectangle), extract the image from google earth and then save it ? I ve been looking around but no … | |
if at the end of the code i write this o execute main, [code] if __name__ == '__main__': try: main() except KeyboardInterrupt: pass[/code] isnt thre anyyy other way to exit the interpretor except pressing ctrl -c ???? the interpretor halts even if code ends and then i have to press … | |
Starting with version 2.6 Python has introduced a new container called the named tuple. You can use it similar to a class based record structure, but it has the memory efficiency of a tuple. | |
im a beginner of coding and using python. Im trying to code for a linear search but I don't know how to:( | |
I've been trying to match some incoming strings from a mud(text based rpg) and I'm having some trouble. I need a regex that will match the <mob> tag in these strings. You can have a separate regex per sentence to match the surrounding text. You would stomp <mob> into the … | |
| Given a coordinate string -- 'x, y' -- where x and y are 1-4 digits, separated by \D+: '34, 58' I want to able to get a tuple with each number as an integer: (34 , 58) [B]Method 1[/B]: I could find the numbers, convert the tuple groups() to a … |
Hello, I'm a high school student and I just started learning Python. I'd really appreciate some help on some problems I've been assigned, and some tips that could help me out in the future with problems like these. >>> getLeaves ( jenny ) [5,3,0,9] >>> >>> getLeaves ( joshua ) … | |
Hello everyone! I am using python 2.6 on cygwin environment and wondering how could i prevent two python processes from writing to a file at the same time. The file that is shared between the python processes is an ini file and is accessed through ConfigObj module. The first python … | |
Hi! I am new to Python. How to print number+string+array? | |
<code=python> >>>f = file("sendBuffer.dat","rb") >>> f.read() '\x81x\x00>\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00A .\x00\x10aG\xce\x00 \x00\x00\x00\x00\x00\x00\x00\x01\xcd\xccL@\x00\x00\x00\x00\x00\x00\x00\x00\x00\x 00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' >>> text = f.read() >>> print text </code> In the above code f.read() prints the data, but when i say print text or print length of text it returns NULL and zero respectively. Any Ideas? | |
Hi Everyone :cool: What is the best way to represent, modify, and perform calculations with hexadecimal values (for instance, byte addresses) in Python? It seems every time I play with hex numbers, I'm always getting the result as a string or regular int type. case in point: Let's say I … | |
Hi i'm totally new to python and I'm trying to make an easy GUI with tkinter that should take a name of a textfile in an entry widget, and when you click a button the text in the entry should be passed to a function handling the file. This is … | |
I have a csv file with 4 columns that I want to use to create menus. For example, the second column has values such as "TEST", "QA", "PROD" and a couple of others. I want to take all the values from the second column, weed out the duplicates, then create … | |
Hi guys, a not so complex question: [CODE] form xml.etree.ElementTree import * >>> tostring("<home><room>bedroom</room></home>") '<home><room>bedroom</room></home>' [/CODE] I would like to have the indentation in for the string. Something like: <home> [INDENT]<room>bedroom</room> [/INDENT] </home> Of course my document is a little complex. Is it possible to have it in an automatic … | |
[CODE]# -*- coding: utf-8 -*- p = [1, 2, 0, -1, 3, 4, 5] smaller = 0 bigger = 0 i = 0 while i < len(p): if p[i] >= p: bigger += 1 print bigger i += 1[/CODE] #bigger than -1 is (1, 2, 0, 3, 4, 5) #bigger … | |
Hi there. Day 2 of programming python. In this thread I posted my first attempt [url]http://www.daniweb.com/forums/post1231604.html#post1231604[/url] and growing from there it goes to slightly deeper water here. I have three .txt files: nvutf8.txt here new vocab items are stored esutf8.txt here example sentences are stored exoututf8.txt example sentences from esutf8.txt … | |
i need to make a program that adds numbers, but asking first the user how many numbers he wants to add, and then adding them. any one knows how to do that | |
I just used MonoDevelop 2.2 for Python under Ubuntu. IT'S AMAZING! Code hinting seems to not be working though... Anyone has any idea on when the python is gonna jump to windows? | |
Hi! I'm trying to use the opencv bindings of Python. I tried the following code: [CODE]from opencv.highgui import * from opencv.cv import * cam = 'cam' cvNamedWindow(cam) cap = cvCreateCameraCapture(0) while cvWaitKey(1) != 27: img=cvQueryFrame(cap) cvShowImage(cam,img)[/CODE] Although the window seems to open fine, I cannot see any image. I just … | |
I have code that opens a URL, whose page looks like this... "A",31.49,"5/26/2010","4:00pm",+0.25,31.51,32.25,31.37,3811721 The code parses this web page and writes it to a CSV file. Here is a snipet of the code, [CODE] def __req(stat): url = ... % (stat) return urllib.urlopen(url).read().strip().strip('"') #Manipulate data from web and write to … | |
I'm writing a script to scan Windows shares. Running the script from Windows, it works fine. But running it from Linux and it doesn't work. I don't get any errors, it just doesn't return anything. I'm guessing this is probably an authentication issue of some kind. On Windows, it automatically … | |
Hello, I learn tuples and I came acros the folloving explanation which I don't understand practicly because the scipt is not complet..., I think tha they want to show the direction but for me would be better complet example... so it's from document: Think Python (version 1.1.19) and text is … | |
Hi, I have a code which uses HTMLParser to reach a webpage where an exe file is located. The code then downloads and installs the file on local machine. I need a solution for the below problem: HTMLParser reaches a webpage where there are links to clients_test2, clients_test5, clients_test8. Each … |
The End.