14,949 Topics

Member Avatar for
Member Avatar for StarZ

the topic is writing/reading text files, but i got this simple question. how do i make this program so it will look like this: [url]http://i39.tinypic.com/5554wi.jpg[/url] i can't figure it out. - to make it keep looping and asking "enter your name or break to exit" continue the question until the …

Member Avatar for vegaseat
0
192
Member Avatar for leegeorg07

hi again! at school we were learning about perfect numbers and i thought it would be useful to write a program to find them i currently have this code: [ICODE]b= 1 h= 1 factors = [1,] n = float(raw_input("what is the number?")) while h < n: if h*b == n: …

Member Avatar for jlm699
0
257
Member Avatar for faniryharijaona

Hi all, Is it possible to copy an object (instance) and manipulate the copy without affecting the original one. I mean, Suppose: D.node = 'Node' and D.child = {0:'child1',1:'child2'}. Now, copy D to D_c and put D_c.child={}. So, D should be kept as it is originaly, which means D.node = …

Member Avatar for scru
0
89
Member Avatar for clareypants

hi everyone, I am having issues with an assignment for university. I know that you are not here to do my work for me but I could really use a little help. My assignment involves a parse file that the uni tutors have written for us and we have to …

Member Avatar for jlm699
0
72
Member Avatar for sneekula

I just bought an inexpensive used Dell notebook that has Ubuntu/Linux as an operating system. Compared to Vista this is sweet. It came with Python25 installed, but it was easy to use the Add/Remove application feature to get open source software from the Ubuntu site. I downloaded/installed Stani's Python Editor …

Member Avatar for MaxVK
0
321
Member Avatar for kiddo39

I am printing out the R,G,B values of an image and get results like this: (30, 0, 0) (29, 0, 0) (28, 0, 0) (27, 0, 0) (26, 0, 0) (25, 0, 0) (24, 0, 6) (23, 0, 0) (22, 0, 0) (21, 0, 0) That is just a partial …

Member Avatar for kiddo39
0
112
Member Avatar for jeffj

Hi, Don't hate me cuz I am a NUB. This may be very basic but I am more basic when it comes to python I simply need to add some variables together some come from a database and some are calculated. but I am getting a very frustrating error [code]TypeError: …

Member Avatar for woooee
0
169
Member Avatar for faniryharijaona

I've got this strange problem, I created an instance called structure, I made a function which return an object of this type. Just before returning, I print it, it gives me the right object. Now when I collect it in 'main' and print it, it becomes 'None'. If someone can …

Member Avatar for faniryharijaona
0
75
Member Avatar for hunterm

So, I am supposed to be encoding and decoding hidden messages in images. I have perfect the decoding hidden messages part, but am a bit stuck on the encoding part (encoding a message by changing the red value in the pixel color to the unicode number of the letter. I …

Member Avatar for sneekula
0
3K
Member Avatar for Rahul1123

Hi, I am trying to invoke a shell script from python. This shell script while running expects user inputs based on which it proceeds to perform several actions. I want to automate the process of sending the user inputs(may be from a file) I am using the subprocess Popen class …

Member Avatar for jlm699
0
4K
Member Avatar for shar123

I am having an issue with a project due. I am missing something? can you please help? here are the instructions and what i have so far. The final project will consist of three files called, Shape.py, Circle.py, and Square.py. I’ve written a test file you can use to see …

Member Avatar for jlm699
0
276
Member Avatar for planetPlosion

I have a list of directories named dirList. I need to filter and sort before I pickle I think. This is what I've got. [code] fileHandle = open( 'dirList.txt', 'w' ) fileHandle.write( 'yadda yadda yadda intro' ) cPickle.dump(mu1List, fileHandle) fileHandle.close() [/code] the mu1List is declared at the beginning and it …

Member Avatar for Gribouillis
0
78
Member Avatar for shadwickman

This technically isn't fully a Python-related question, but I couldn't find a better place to post it than here. I'm just curious about how to get/update weather information from the internet... like say that sidebar gadget in Vista that updates the weather and temperature from some online-source. The problem is, …

Member Avatar for shadwickman
0
121
Member Avatar for planetPlosion

I'm trying to get a dirList.txt file in 2 different directories to (eventually) compare them. I've got a basic start going [code] # A program to create and compare directory lists of # a music folder and its backup import os, cPickle, string, stat, fnmatch # Define variables for the …

Member Avatar for planetPlosion
0
120
Member Avatar for drfcool

Hello everyone, this time i have a question about this 2 algorithms,they are suposed to solve colisions in hash tables! Does anyone have Python Examples of Implementations ? I was given homework with this, im doing research on them, but the only language i consider myself capable of doing advanced …

Member Avatar for sneekula
0
2K
Member Avatar for badplasmid

Hi all, New to the forum here, and coding in general. I am posting because I am having a problem with a simple program intended to act as a word, character and line counter, with each counter being its own function. I keep running into the same problem over and …

Member Avatar for badplasmid
0
92
Member Avatar for kenji

Hello, I need some help understanding the nonlocal variables and functions. Currently I'm reading "A byte of Python" to ease myself into the language, which so far seems to be fairly straightforward even if the syntax is a little strange coming from C++. I have copied a small script from …

Member Avatar for vegaseat
0
133
Member Avatar for csergec

Hi I am writing a function which gets values. These ones will be used in my sqlite query [code] def updateDB(tel, month, price): mytel = (tel,) myprice = (price,) connection = sqlite.connect("mydb.db") cursor = connection.cursor() sql = 'UPDATE mydatabase SET %s = ? WHERE number = ?' cursor.execute( sql % …

Member Avatar for csergec
0
2K
Member Avatar for txwooley

If I have a list of 5 random integers, is there a simple way to iterate through the list and see how many of each number there are without using 25 if/elif statements. For example my list might contain [3, 7, 10, 10, 14]. How would I determine that there …

Member Avatar for txwooley
0
111
Member Avatar for txwooley

I am trying to order a list containing integers. I want them sorted in numerical order from lowest to highest. I tried using sort but got the list baxk exactly as it was. [code=python] x = [5, 3, 7] x.sort print x [/CODE] What command would I usr to make …

Member Avatar for txwooley
0
81
Member Avatar for dliving

Hello, I'm new nere and very much a beginner with python. I'm trying to make a blackgame program not to play but to test strategies, like I used to play this wristwatch game and always double at 12 and surrender at 17. Which is bad strategy but I swore it …

Member Avatar for woooee
0
335
Member Avatar for sunwei415

Hi, everybody, I just ran into a problem of running existing c-python code(python 2.5.4) from jython(version 2.5b3). Here I am trying to share the work around I find out. The idea is to make jython read [URL="http://docs.python.org/library/pickle.html"]pickle[/URL] from c-python. My c-python code reads in a xml into a class, in …

0
41
Member Avatar for tksrules

In python how to write a simple while loop?I am a C++ expert but i am starting to learn python. Lets say i need to write a while loop asking the user if he wants to input a number and if the user says yes, the program will input the …

Member Avatar for marium ahmad
0
82
Member Avatar for Zanbi

Pardon my newbness, I only just found this site today and I have been having this problem for a bit. Background: I am using Python 2.5.2 that I recieved from a CD from my college. My OS is Windows XP, and my internet provider is Internet Explorer. Problem: When I …

Member Avatar for lllllIllIlllI
0
1K
Member Avatar for OrcaSoul

I am rewriting a Python mechanize script to parse a site, after the entire site was altered... I am able to get part way into the pages I need to access, but have run into a bit of a problem. In the HTML below, the first segment has 2 buttons …

0
65
Member Avatar for David.lewing

I have programed before (QuickBASIC and Macromedia Flash MX) but I am new on Python I want to create a program in which you give it a keyword and it generates a cypher. Like this: (Built in alphabet) ABCDEFGHIJKLMNOPQRSTUVWXYZ (Asks for keyword) (Lets say the keyword is BLOCK) BLOCK (Adds …

Member Avatar for woooee
0
353
Member Avatar for funkyfresh

Before I explain what I mean in the title, I want to say that I 1) Have very little experience with python, so take anything I say with that in mind. I've only read about it, haven't really used it (although I have installed it), 2) I [B]want[/B] to learn …

Member Avatar for jlm699
0
136
Member Avatar for ihatehippies

I'm working on a simple update function to add to an existing program. It does a stat check of the source file and then copies the new file if necessary. This is easily accomplished with .py files. I've realized that I need a separate update app to delete a currently …

Member Avatar for ihatehippies
0
84
Member Avatar for MaxManus
Member Avatar for MaxManus
0
71
Member Avatar for besktrap

Any one know where I can find the pygame code to create a screen where you can draw simple lines by click and dragging the mouse? I know how to create lines with the pygame.draw.line(screen, (0,0, 0), (3,200), (9, 200)) script (using that as an example), but am looking for …

Member Avatar for world123space
0
310

The End.