15,190 Topics

Member Avatar for
Member Avatar for Ismatus3

Hello , I'm working to build a programme that connects to MySQL database using Tkinter .In a step , i wanted to create dynamicly a number of entries widgets ( here : tailles_entry[i] ) depending on the number of elements of a list ( here liste1 ) . I could …

Member Avatar for Ismatus3
0
5K
Member Avatar for rom.

Hi there, I need a simple socket server which will echo a client message to all connected clients. I've found this easy py script below, but it only echos the string to the client that sent the message. Any way to mod this so that it will send the message …

Member Avatar for silver.moon.37819
0
2K
Member Avatar for nutrion

All, I have a personal script that I'm trying to write, and I've run into a small problem. The problem is that I want to be able to support a '-s' argument no matter where the argument is. I also want that argument to be allowed more than once. For …

Member Avatar for Gribouillis
0
205
Member Avatar for edward.okech.5

def edward_okech(): """ An introduction of my self.""" print ' I am a newbiee to this website and python.' print ' I am from Kenya, Africa.' print 'Am here to get more insight on python and other relevant technologies' print 'Thank you' edward_okech()

Member Avatar for happygeek
1
120
Member Avatar for Tcll

[Click Here](hey there everyone... :) I need some help with an external runtime interface with PyQt... here's my current code: import API API.init() #show the Qt window _init_(depth) #(this module): print text to both the console and the Qt window (checking for updates to API) API.run(files) #take over the Qt …

0
135
Member Avatar for robotakid

Hey there! I'm currently trying to get my first text-adventure-game in python started,and I wanted to import some features that are totally unnecessary. just for the lulz. So,I want to start a timer,that starts when the game starts,and ends,when the player is dead or won the game. I want it …

Member Avatar for Gribouillis
0
725
Member Avatar for stealthless

Hello, I'm trying to get my program running but I ran into an error. When I want to type a block of text on a new line, I get this error below: AttributeError: 'str' object has no attribute 'append' What am I suppose to adjust in order to fix it? …

Member Avatar for PsychicTide
0
238
Member Avatar for stealthless

Hi, I'm trying to prompt the user to enter a block of text until he/she types EOF on a separate line by itself. After that, the program should present him/her with a menu. When I go to Option 1, it only prints out EOF and not everything that was typed …

Member Avatar for PsychicTide
0
415
Member Avatar for robotakid

Hello everyone, I just started with the book 'Learning Python the hard way' by Zed A. Shaw,and I have to say that it is really fun to learn code. I thought that it would be a problem because I'm 15,but I'm understanding it pretty well so far. Anyway,enough of the …

Member Avatar for TrustyTony
0
370
Member Avatar for stealthless

I'm a Python noob trying to make a program where the user will enter as many integers as they want and have the program calculate the total sum. They have to type the word "done" to execute the sum calculation. When I ran my program, I tped in 'done' and …

Member Avatar for edward.okech.5
0
227
Member Avatar for stealthless

This is **Python** language. Hello, I'm trying to make a program where the user enters his/her initials followed by a block of text. After that, the program will print out the number of times his/her initials showed up in the block of text. For example, if my initials are VKL, …

Member Avatar for edward.okech.5
0
253
Member Avatar for epicSHOOTER236

How would i make python read a text file and find something then read a certian number of lines below it i.e if you had: card 1: ball red it need to find card 1:, then it needs to read the line below (ball) and set it to a string …

Member Avatar for epicSHOOTER236
0
279
Member Avatar for stealthless

Hello, I'm a starter in Python and I need help. I'm trying to ask the user to input as much text as he/she likes until he/she types EOF (end of file) on a separate line. Once he/she does, the program should end. I started on my code and below is …

Member Avatar for slate
0
543
Member Avatar for alienwave

How can write these fuctions differently ? def computeVoltages(Vs, TC, tValues): return [Vs * (1 - e ** (-t / TC)) for t in tValues] def computeTimeValues(TC, intervals): time = [] width = 5 * TC / intervals for i in range(intervals + 1): time.append(i * width) return time

Member Avatar for alienwave
0
144
Member Avatar for wolf29

I have a program that takes csv values, parses the content and inserts it in an sqlite3 database. I am using sqlite3 to save on space and to make the py scripts a little more portable. The next refactoring may well need to have postgresql or mysql to deal with …

0
176
Member Avatar for slamshuffle

Hi all, I'm quite new to Python (and programming in general) and I'm a bit confused about how to implement inheritance in an assignment I'm doing at the moment. The basic gist is: we're supposed to make a program that can record stock items for a company. We're to make …

Member Avatar for james.lu.75491856
0
187
Member Avatar for Mohammad_7

I am running canopy 64 bit Version: 1.0.3.1262 on mac Mountain Lion. I have installed virtualenv using easy_install. But while I am trying to execute the command: virtualenv venv --distribute It shows the following error: Using base prefix '/Applications/Canopy.app/appdata/canopy-1.0.3.1262.macosx-x86_64/Canopy.app/Contents' New python executable in venv/bin/python dyld: Library not loaded: @rpath/Python Referenced …

Member Avatar for slate
0
295
Member Avatar for red23

I'm a beginner in phyton. i'm just starting to read things about phyton because we need it for our project. I really need basic and detailed instructions on how to use it and use it using notepad++. Could someone help me? or teach me? ill also do my part and …

Member Avatar for JasonHippy
0
3K
Member Avatar for epicSHOOTER236

so I need to be able to open a text file, and when a button is pressed it searches for a tag in the file such as <l1> and anything after that tag would be put into a label. how would I go about doing this?

Member Avatar for epicSHOOTER236
0
157
Member Avatar for james.lu.75491856

code: #I meant memory card import pygame, sys,random from functools import partial def image(x=50,y=100,default=True,nondefault_color=(0,0,0)): if default: color = hiddencolor else: color = nondefault_color print color image = pygame.Surface((x,y)) image.fill(color) pygame.draw.lines(image, [0,0,0],False, [(0,0),(0,100),(50,100),(50,0),(0,0)], 1) rect = image.get_rect() return image def card(pos): x= pos[0]/50 #integer divison y= pos[1]/100 if (x,y) in flashcards: …

0
98
Member Avatar for stealthless

I'm trying to make a short program where the user enters as many integers as they want. When they type 'done,' the program will calculate all of the numbers the user entered. So far when I run this program, all I get is "done." Am I close to being finished? …

Member Avatar for slate
0
184
Member Avatar for pythonforlife

I am looking for someone who can teach me how to segment a video file into chunks. Will appreciate it greatly if anyone decides to help me!

Member Avatar for Gribouillis
0
282
Member Avatar for stealthless

How to make initials-counter program? Hello, I'm trying to make a program that asks for the user's initials (3 letters) and a block of text, and then reports how many times their initials showed up in the block of text. For example, if my intials are VKL, and I type …

Member Avatar for TrustyTony
0
249
Member Avatar for toniann.midori

the input is [120, [10, 20, 30]] i split the balance using this code def checkio(data): balance=[int(x) for x in data[0:1]] withdrawal=data[1:2] but when i split it the withdrawal section looks like [[10,20,30]] which hinders the loops im going to do. I want it to have single brackets like so: …

Member Avatar for toniann.midori
0
3K
Member Avatar for james.lu.75491856

Weak refrences to an object can be collected if no strong refrences remain, but we can disable it! Lists and dictionaries cannot be weak refrenced, but this can: class Dict(dict): pass class List(list): pass If your holding a large dictionary, you might want to split up over diffrent variables, like …

Member Avatar for james.lu.75491856
0
140
Member Avatar for Cducks

I need help writing a program that will read a string from the user and print the string with every other word removed. Ex. Input sentence: Hello everybody Eloeeyoy

Member Avatar for snippsat
0
166
Member Avatar for ihatehippies

I stumbled on upon this anomaly in one of my programs and can't figure out why this is happening. I made a small test function that exhibits the same behavoir. It's like the local variables of my function are being saved after the function exits. The exclude_ids variable keeps growing. …

Member Avatar for james.lu.75491856
0
791
Member Avatar for Matigo

Hello I want to make a GUI tool in python Tkinter that can check if the site is up or down, I did a quick search on google and i came up with the following code import httplib conn = httplib.HTTPConnection("www.google.com") conn.request("HEAD", "/") r1 = conn.getresponse() print r1.status, r1.reason I'm …

Member Avatar for james.lu.75491856
0
173
Member Avatar for james.lu.75491856

notdone = [tuple((x,y))for x in range(5) for y in range(6)] for i in showns: s = lambda :tuple(random.sample(notdone,1)) #random.sample gives a LIST even though I used tuple() print notdone #debug a = s() print a #debug notdone.remove(a) b = s() flashcards[a] = Flashcard((x*20,y*100),i) flashcards[b] = Flashcard((x*20,y*100),i) [(0, 0), (0, 1), …

Member Avatar for james.lu.75491856
0
175
Member Avatar for 26bm

Hi, I'm wondering if anybody knows of a python compiler to make an exe with. I have tries cx_freeze and py2exe so far, but I haven't been able to get it to work. If anyone has any good python to exe compilers please post here. Thanks, 26bm

Member Avatar for james.lu.75491856
0
377

The End.