15,185 Topics

Member Avatar for
Member Avatar for Syphilis

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 …

Member Avatar for SoulMazer
0
98
Member Avatar for QueryPoser546

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 …

0
24
Member Avatar for keshav magge

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 …

Member Avatar for vegaseat
0
1K
Member Avatar for nezbo

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) …

Member Avatar for nezbo
0
194
Member Avatar for hittmann

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 :(

Member Avatar for vegaseat
0
25
Member Avatar for larsen182

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 …

Member Avatar for larsen182
0
215
Member Avatar for helios0684

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 …

Member Avatar for woooee
0
294
Member Avatar for toadzky

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 …

Member Avatar for TrustyTony
0
181
Member Avatar for mesuge6666

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 …

Member Avatar for griswolf
0
119
Member Avatar for gsmoura

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 …

Member Avatar for strider1066
0
144
Member Avatar for morgadao

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 …

Member Avatar for strider1066
0
60
Member Avatar for helios0684

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 …

Member Avatar for helios0684
0
483
Member Avatar for cyon

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 …

Member Avatar for TrustyTony
0
2K
Member Avatar for vlady

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 …

Member Avatar for vlady
0
144
Member Avatar for oaktrees

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 …

Member Avatar for oaktrees
0
106
Member Avatar for toadzky

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 …

Member Avatar for vegaseat
0
214
Member Avatar for vello
Member Avatar for ivh90

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 …

Member Avatar for griswolf
0
95
Member Avatar for sarosh

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 …

Member Avatar for vegaseat
0
126
Member Avatar for vegaseat

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.

1
2K
Member Avatar for qqabb

im a beginner of coding and using python. Im trying to code for a linear search but I don't know how to:(

Member Avatar for TrustyTony
0
1K
Member Avatar for shwick

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 …

Member Avatar for TrustyTony
0
108
Member Avatar for cyon

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 …

Member Avatar for ultimatebuster
0
7K
Member Avatar for blazahjazz

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 ) …

Member Avatar for griswolf
0
154
Member Avatar for ktsangop

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 …

Member Avatar for ktsangop
0
376
Member Avatar for ErlendHL
Member Avatar for vsagarmb

<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?

Member Avatar for vsagarmb
0
86
Member Avatar for valorien

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 …

Member Avatar for Gribouillis
0
14K
Member Avatar for hadoque

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 …

Member Avatar for hadoque
0
469
Member Avatar for ennoil

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 …

Member Avatar for sergb
0
2K

The End.