15,190 Topics

Member Avatar for
Member Avatar for snfitz

Hi, I'm trying to make a program that prompts for input a certain number of times, like say the user inputs 5, it will prompt for other input five times. I get the number from the user, but how do I make a for loop that uses that variable instead …

Member Avatar for snippsat
0
232
Member Avatar for Naresh Bonagiri

Hi, I am very very new to python and in my application I have to create an XML file. Please any one help on this issue Regards, Naresh

Member Avatar for Stefano Mtangoo
0
250
Member Avatar for idreu2go4it

Boy, am I really confused about this!!! I have an assignment that is wanting me to create a python statement that will produce f(x) for: f(x) = 2xcubed - 8xsquared + x +16. Then, using the same function, write a python program that will find the extrema (both high and …

Member Avatar for vegaseat
0
406
Member Avatar for kedarm

Hi! I'm trying to build a Python extension with C/C++. I'm following the steps given in the documentation [URL="http://docs.python.org/extending/extending.html"]here[/URL]. I've followed the steps mentioned and written my first code. However, I have no clue on how to compile the project! I do not know how to create the .pyd file …

Member Avatar for kedarm
0
5K
Member Avatar for cerralife

I have to write a spell-check program for school and I have 2 specific quick problems: the first is that I'm trying to write a function that takes 2 adjacent letters of a word and switches them then returns the new word... it goes on to the next to letters …

Member Avatar for Gribouillis
0
178
Member Avatar for Purnima12

[CODE] #! /usr/bin/env python import random possible = [2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 30, 34, 50, 100] size = int(raw_input('Please enter the size of the die you would like: ')) if size not in possible: print """ Please check the Wikipedia Dice …

Member Avatar for snippsat
0
604
Member Avatar for hondros

Okay, so I have about 6 GB of music on my iPod. I don't want to go through and copy everysingle file and rename it manually, so I am making a python script to do it for me. I would just like to have some feedback on my code, make …

Member Avatar for hondros
0
552
Member Avatar for hondros

This simple script will copy all music files that were not purchased from the iTunes store to a directory of your choosing. It requires the ID3 module (Created by some person, from somewhere, I forget where, but I DID NOT make this module). The syntax is as follows: [code] ipoddir …

0
478
Member Avatar for Lygris

Hey, how's it going? I decided to pick up Python for the heck of it and have been having some trouble creating this Card Deck class. All this class is supposed to do is initialize a deck, and then draw a card at total random: [code] import random class CardDeck(): …

Member Avatar for Krstevski
0
342
Member Avatar for Begjinner

Hi, Sorry if this is asked before, but I'm having trouble figuring this out (tried already for a couple of hours). This is what is going on: Kids make a test with 50 question. These test are checked manually on paper and afterwards need to be put into a website. …

Member Avatar for Tech B
0
120
Member Avatar for Tech B

If you don't know what a quine is, it is a program or script that's only purpose or function is to print out its own source code. I was wondering would this be considered a quine? [CODE] f = open("quine.py","r"); print f.read() [/CODE] quine.py is the script that this code …

Member Avatar for Tech B
0
172
Member Avatar for persianprez

So for example, in the dictionary, the letter 'A' has a value of .8237 What I wan't to do is replace every letter with the value with .8237 to D in the string (not the dictionary) I've tried this without success and It's obvious why it wouldn't work: [CODE]if sorted(dictionary.values())>=.01: …

Member Avatar for Tech B
0
167
Member Avatar for Cyproz

Ok so i need to make a program that you put in an email address and it checks for the @ symbol and then makes sure its not the first digit or the last digit. Now i know that there is " like s.islower( for lowercase) and s.isupper but i …

Member Avatar for vegaseat
0
117
Member Avatar for Stev0

Hello all, I'm an information security professional who's decided to teach myself python, so for my first project I wanted to make something that I could actually find useful, so I've developed a small program for log file parsing and amazingly after some trial and error, it works :) However …

Member Avatar for Stev0
0
140
Member Avatar for newharvar

hi,everybody I am study ctypes,and got a big trouble,I googled lots a pages but get no usefull info. i want to know how to get the interface from winxp by using ctypes, for example: I want to use ActiveDesktop 's interface by using ctypes,but i don't know how to do,can …

Member Avatar for Tech B
0
189
Member Avatar for saurav4ever

i have updated my centos python2.4.3 to python 5.1 i followed the following process: which python /usr/bin/python python -V Python 2.4.3 cd /usr/local/src wget [url]http://www.python.org/ftp/python/2.5.1/Python-2.5.1.tgz[/url] tar xvzf Python-2.5.1.tgz make make install ls -l /usr/local/bin/python mv /usr/bin/python /usr/bin/python-orig ln -s /usr/local/bin/python /usr/bin/python ls -l /usr/bin/python -> /usr/local/bin/python python -V Python 2.5.1 …

Member Avatar for Gribouillis
0
319
Member Avatar for Kruptein

I have created a script to encrypt and decrypt a text message based on the bifid cipher([url=http://en.wikipedia.org/wiki/Bifid_cipher]wiki about bifid[/url]) everything works fine [B]IF[/B] the text message does only contain letters. How can I integrate the ability off spaces etc... the best way? by adding them to my alphabet might solve …

Member Avatar for Kruptein
0
2K
Member Avatar for leftyb

hi im am using this code(Python) to get the n -grams for a word : [CODE] import string; import sys; # N N = 6; # file f_in = open("test.txt", 'r'); ln = f_in.read() wlen = len(ln); i = 0; while (i < wlen - N + 1 ): for …

Member Avatar for KNatali
0
2K
Member Avatar for octopusgrabbus

I've read other posts in this form, but still do not know why I get this error: [CODE] File "/home/amr/bin/mysql_lib.py", line 196, in createNewCsRowSQL db_date + ");" TypeError: cannot concatenate 'str' and 'long' objects [/CODE] from this code [CODE] sql_cmd = \ "INSERT INTO customer_synch " + \ "VALUES ( …

Member Avatar for octopusgrabbus
0
338
Member Avatar for tzushky

Hello hello, This post is half related to Python because it is about its automatic documentation generation. I have been playing with Doxygen for a while in C, it was adapted to Python in a second evolution stage a while ago. However after reading a lot of small examples, and …

0
84
Member Avatar for heValbo

Hi! I’m going to explain to you in details of what I want to achieve. I have 2 programs about dictionaries. The code for program 1 is here: [CODE]import re words = {'i':'jeg','am':'er','happy':'glad'} text = "I am happy.".split() translation = [] for word in text: word_mod = re.sub('[^a-z0-9]', '', word.lower()) …

Member Avatar for heValbo
0
101
Member Avatar for vextorspace

I have a (rather large) program that does CAD work written with wxPython and OpenGL. The problem I'm having is that the memory use continually grows as it is used. None of my objects seem to get deleted. Now in order to perform a hit test, I need a dictionary …

Member Avatar for Gribouillis
0
105
Member Avatar for kartikwin

Hello, I am a newbie with Python and used a gheat application ([url]http://code.google.com/p/gheat/[/url]) to display intensity on the US map using a sample input file (points.txt). Currently there is a example.html page that came with the gheat package. I am trying to figure out how to understand the connection between …

0
44
Member Avatar for baki100

Okay i have created a wxPython application and converted it into an windows executable programme using py2exe. The app works perfectly but every time i run the exe the console window appears with the gui. Is there anyway to get rid of the console because the app has to run …

Member Avatar for baki100
0
981
Member Avatar for mattj63

I'm trying to create a csv file from a list of dictionary items where each dictionary in the list has the same keys. I want the csv file to have the keys in the first column and the remaining columns will have the values for each dictionary in the list …

Member Avatar for mattj63
0
1K
Member Avatar for AnnetteM

Hello, I would like to reshape and then transpose data that I import from a file. I downloaded the 'numarray' to access the shape and transpose functions since I am using python version 2.5. This is the pdf I'm using: [url]http://stsdas.stsci.edu/numarray/numarray-1.5.pdf[/url] The data is one long column (length=455), I will …

Member Avatar for AnnetteM
0
605
Member Avatar for pyprog

If I have a string "knockknock", and use the string method replace [CODE]s = "knockknock" s = s.replace("knock", "bam") s "bambam"[/CODE] it replaces both occurences of the substring at once. Is it possible to replace each substring individually as in ("bamknock", "knockbam")?

Member Avatar for vegaseat
0
100
Member Avatar for toll_booth

[CODE] def create_widgets(self): B_PAD = 4 PAD_X = 3; PAD_Y = 2 NUM_PAD = 7 '''Create Boolean variables for all the buttons.''' def create_button_vars(): self.backspace = BooleanVar() self.CE = BooleanVar() self.C = BooleanVar() self.MC = BooleanVar() self.MR = BooleanVar() self.Mminus = BooleanVar() self.num = [] for i in range (10): …

Member Avatar for vegaseat
0
128
Member Avatar for chavanak

Hi guys, I have a list which I have obtained from a python script. the content of the list goes something like [CODE] d.complex.1 24 25 67 123 764 d.complex.2 23 54 35 64 d.complex.3 . . . [/CODE] I want to split this list such that, a new list …

Member Avatar for vegaseat
0
91
Member Avatar for Friktion

hello everybody, im coding a game with opengl,pyggel,python,pygame etc and it runs smoothly without any problems =) [url]www.youtube.com/watch?v=JlDuje39S_8[/url] - My python 3d game projekt <--- sorry if outside links isnt allowed =( But the thing is that when im compiling it with py2exe using this as setup.py [CODE=python] from distutils.core …

Member Avatar for vextorspace
0
425

The End.