15,185 Topics
| |
What's Up? OK, So I have a working python script that sends and receives text to and from the client and server python files, However if the Server and Client are on different computers, And therefore we need to connect over the internet, How would we do that? New to … | |
I've read in data from a file using a GET request through a browser data= open(path) data2= file.read() return data2 and returned it to the console just fine. how do I post this same data to the browser I used as a client for the GET request? socket.send(<htmlcode here>)? what … | |
I am trying to catalog mysql database items in a plone site using python. The function that catalogs the SQL query results takes 2 arguments. First is the item returned by the query (for example Select * from books would return many book objects) and second argument is the string … | |
Hello there, i've been searching the web and a few books for the last days with this (simple?) problem and only ended up fairly confused. the scenario: me and my friends are learning python while/by writing a little game together. My current problem is conserning getting the items (from classes) … | |
using graphics in python how am I able to contain a movable object within set bounds eg a ball with obstacles that it will not pass through. I can produce the ball and obstacles but the ball passes right through the obstacles :( | |
Hi guys:-) I have no experience in programming, and i realise that asking for someone to write an entire programme for me might be a stretch, but unfortunately i havent got any mates that are good at programming. I think the program i need is fairly simple once you know … | |
Alright, let's try this again. I've started over from scratch and we have got the basic functions working. Everything so far has checked out, but I am still trying to get it to pull the right credentials. I can get it to pull one of the rows out of the … | |
I am writing a script to rename and reorganize the mp3 on my iPod. For those who don't know, if you drag and drop your music from the iPod to a computer, there is a crazy F## folder structure and all the names are 4 random characters. I want to … | |
I have some random text like: [CODE]>>>text= \ """import sys n = int(sys.argv[1]) ;;print "blbalbalbalabllalbaa" replace me i in range(1,n) {print "numbers:";;replace me j in range(1,3) {print j} ;;print i ;;replace me k in range(1,3) {print k} ;;print "end!"} replace me n < 5 {print n ;;print "youragenious"} """[/CODE] i'd … | |
I really need help in some parts of my minesweeper code using Tkinter. I don´t have much experience in python and I am facing two major problems that I just can´t solve. The first one is that, as I generate buttons dynamically, they all have the same name and receive … | |
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 … |
The End.