15,406 Topics

Member Avatar for
Member Avatar for lisa92222

Hello, I need to install the module pycrypto to run a program but ive been stuck for about 2 hours trying to figure out where to put it exactly. Ive tried in the folder where my program is, also in the usr/lib/python2.6/ using python setup.py install (i actually did build …

Member Avatar for TrustyTony
0
191
Member Avatar for C0ding

Hello everyone, I've been working with some python scripts for few days now, what editor i've been using? the answer is Notepad, but then i move to Notepad++ which is the one i use to edit batch files php files, and many other programming files formats, but just now i'ma …

Member Avatar for C0ding
0
417
Member Avatar for aquaben

Hey As my title sais having issues getting characters (like names and such ) in my code. I can only get numbers Any help would be appreaciated print ("Program 2: Using Inputs") #prints the title print ("Author: Benoit Labelle") #prints the author's name print ("ID: 3065521") #prints the authors id …

Member Avatar for woooee
0
106
Member Avatar for Twin802

As you can tell I am very new to python...I stumbled upon pygame and it looked fun. So I started to build a game and I got stuck right away...Player controls. I would like the player to be able to contorl the person. Thank you. import pygame, random import random, …

Member Avatar for Twin802
0
171
Member Avatar for C0ding

Hello everyone, I search for this answer, and yeah, it looks like many asked this question before, but my answer was not on those posts. now i would liek to double ask the same question again... how can i invoke a python script from command pronpt? this is the way …

Member Avatar for C0ding
0
324
Member Avatar for SpartanIE

I'm trying to design a function that accepts a list of numbers as an argument. I can get the program working when i put a list into the programme but I can't figure out how to allow a user to enter a series. What i've got so far is below. …

Member Avatar for TrustyTony
0
2K
Member Avatar for Kaptain Khronic

Whats up guys! To start off I am really new to python. I got this program that keeps giving me this error message. I was wondering if anyone could help me. Heres the code: from math import * from numberTest import * Lname=['Zdofalos','Johnson','Terrell','Wilson','Key','Smith','Alfonso'] Fname=['Fred','Malcom','Monkey','Wilson', 'LeDoor','Jim Bob','Ralph'] City=['Charlotte','Monroe','Broken Pine','Hogwart','Spot In Road','Denver','Gastonia'] …

Member Avatar for TrustyTony
0
305
Member Avatar for meli123

hey all..if I have a 5 files in PDF named PDF1, PDF2, PDF3, PDF4, PDF5 I want to create a program that renames them to project 1, project 2, project 3, project 4, project 5 import os,sys namelist=['jon', 'leon', 'david', 'nombre',] for filename in os.listdir("C://YOUR/PATH/HERE/"): os.rename(filename, namelist.pop()) print "succesfuly renamed" …

Member Avatar for snippsat
0
113
Member Avatar for Twin802

Hello again everyone. I am creating a math game sort of...I dont know if they call it a case or switch statement but I want one in both my Menus. Also I am wondering if you can create an if statement or case statement that will support two variables...for example: …

Member Avatar for vegaseat
0
246
Member Avatar for oldSoftDev

I am reading from a file and creating two lists, then sorting them after sorting I am trying to compare each elements number of occurances in a list but printing them with that number for example if a list is something like {1,2,3,3,3,5,5,5,6} then I want to print a report …

Member Avatar for TrustyTony
0
218
Member Avatar for vlady

Hello I try to get py output (s_subject) to a web bage table using html code. Thing is that result is in one line. I'd like to have it for each subject one line. Pls can you show me how to make it? Example: Predmet: maths fyzics history here is …

Member Avatar for woooee
0
192
Member Avatar for jone kim

I want to design: 1. address class ->using dictionary data structure where items are; state, city and street for individual person 2. name class -> person's first and last name 3. display class -> searches for the given name and displays the address of that particular name my questions are: …

Member Avatar for woooee
0
156
Member Avatar for crazy99

Hi I'm trying to build two seperate dictionaries with a file thats arranged in this format. I need to take the name's reverse it so first name then last name, for the first dictionary I need to take the first name as the key and the other names in the …

Member Avatar for crazy99
0
342
Member Avatar for M.S.

Hi I found this script from http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/189858 it uses getopt module for managing cmd arguments, but I need it to work on mobile phones. I want to make a Mobile app using this script but I cant figure out how to change the comand Args to simple raw_inputs. can somebody …

Member Avatar for M.S.
0
412
Member Avatar for Niner710

Hi, I have a dictionary with the key as a tuple. x = { ('AA',1,3):0.56, ('BB',0,3):0.70, ('AA',1,3):0.10, ('CC',1,3):0.60 } I would like to get all the values where the key is equal to... ('AA',1,3) However, when I use it only returns the last value where ('AA',1,3) is found. x.get( ('AA',1,3) …

Member Avatar for TrustyTony
0
3K
Member Avatar for gge18

Im trying to solve a question of python Data Structures and Sorting, and i meet a question about mergesort, this question ask me make two mergesort and i just finished one mergesort. so i really need some help for this question. thank you !!!!!! # This is alternate mergesort # …

Member Avatar for vegaseat
0
147
Member Avatar for sainitin

Hi all, I have list of pubchem Compound names and want to retreive pubchem Ids from NCBI Pubchem database using NCBI eutilities to acheive that i wrote biopython script as follows ~~~ from Bio import Entrez Entrez.email = "ni@gmail.com" #Input names infile = open("file1", "r") out_put = open("file2.csv","w") for line …

Member Avatar for woooee
0
276
Member Avatar for Twin802

I need some help with programming python. I need to have what it would normally state in the terminal (Linux Mint 12) to be stated in something for example the search bar. Thanks for your help.

Member Avatar for Twin802
0
108
Member Avatar for lfmconsummates

I'm trying to have HTML generate random background colors using Python. What I have so far is: `print "<body bgcolor='%s'>" % choice` what python code should follow?

Member Avatar for prerakmody
0
392
Member Avatar for pleasecompile

I ask the DaniWeb Community for guidance in resolving the following NameError. I have attached the import (OpenOPC for Python Library Module), but basically my code: import OpenOPC opc = OpenOPC.client() produces this NameError: >>> import OpenOPC >>> >>> opc = OpenOPC.client() Traceback (most recent call last): File "<pyshell#4>", line …

Member Avatar for pleasecompile
0
6K
Member Avatar for pakiali007

ile problem 2. Write a function named countTriWords() that opens a file for reading, reads each line in the file, and returns the number of three letter words in the file. For simplicity, you may ignore the fact that some characters are punctuation and treat them as part of the …

Member Avatar for hughesadam_87
0
110
Member Avatar for JenniferT1980

I have been working on this for a while. I'm new to python programming. I've been designing a user interface. I origionally created a python file for each interface. Such as the two below. mainmenu.py from Tkinter import * class mainMenu: def __init__(self, master): frame = Frame(master, width=500, height=400, bd=1) …

Member Avatar for JenniferT1980
0
182
Member Avatar for pakiali007

File problem 1. Write a function named stringsToFile() that opens a file for writing and writes a list of strings to the file, with each element of the list written to a line. Hint: use a for loop to iterate over the list of strings and write them to the …

Member Avatar for TrustyTony
0
76
Member Avatar for joey_r

Hello, long time lurker first time poster. I was looking for some help on a problem I came across on a python site. I am supposed to count the number of times 'code' apears in my string. But any letter can be in the place of the 'd' in 'code'; …

Member Avatar for TrustyTony
0
164
Member Avatar for paulzef

So I'm just learning python still, and I've got this assignment to make a maze program (no graphics or any of that, just a text based one) and I'm trying to get it working, but the function I've written to find the legal moves keeps throwing errors. The most recent …

Member Avatar for TrustyTony
0
197
Member Avatar for jon92

Write a program that accepts a filename as a command-line parameter. The program will search the given file for each letter in the alphabet and print statistics on the number of occurrences. I was wondering if i could have some help with this as i dont understand how to do …

Member Avatar for woooee
1
116
Member Avatar for blahman

I am running into some issue with scraping data. If I hardcode value for key "lbo race" in the code below it is able to scrape the data but if I try to set key "lbo race" to a variable which is being read in it doesn't seem to scrape …

Member Avatar for blahman
0
542
Member Avatar for hughesadam_87

Hey everyone, Last semester my buddy and I made a tutorial on application programming in Python. This video uses the Enthought Tool Suite (ETS), a free powerful Python development toolkit, to build quick, easy and powerful GUI's. I see many posts on this site about Tk, wx, qt but haven't …

Member Avatar for hughesadam_87
0
487
Member Avatar for Programmer_Girl

I am having trouble trying to figure out how to write code so the room number increases by 1 each time it asks for length and width. Here's what the assignment is about.. In this program, you are going to calculate the total square footage of a five room apartment. …

Member Avatar for Programmer_Girl
0
686
Member Avatar for RogerGC

**So i am having trouble with printing as you have noticed with the title** **i need to have 2 things print after the 2 menu choices. it is a smiley face creator** `Inline Code Example Here import time def eyes_menu(): print "These are your choices for eyes:" time.sleep(1) print " …

Member Avatar for RogerGC
0
154
Member Avatar for gbonline

Hi to all, i'm writing a little interface in python with Tkinter on linux debian, with this interface i need to execute some program like rdesktop and vnc. but i've a little problem: i use a fullscreen window without decorator (read buttons for iconify and close) where i've putted some …

Member Avatar for gbonline
0
266
Member Avatar for hemant_rajput

I want some help to generate a report in PDF/Doc(MS Word) format . I’m not able to find any module to generated report in doc, except “docx” which I’m not able to comprehend. Actually my actual task is to generate the report in Doc only, but as I’m not able …

Member Avatar for hemant_rajput
0
468
Member Avatar for KickAssElmo

I want to call 'n' which is the input number followed by a string. I've been putting it like this: (n 'string') but it is wrong. How do I write it?

Member Avatar for KickAssElmo
0
86
Member Avatar for midnightparade

Hi I'm new to python and this forum and I am trying to work on a program that splits the html text file into its components: The HTML file looks something like this: " Hello World #title Today is a Friday. The weekend is coming. Lets have fun. #summary 1923 …

Member Avatar for bumsfeld
0
227
Member Avatar for sinnebril

Hi there again, I'm still a newby in Python, so I'm taking the Google Python Class. They talk about `ls -l` and `rm -rf` (with the last command the class started laughing) But I don't understand it. I googled it and a hint came to me, that is is a …

Member Avatar for sinnebril
0
3K
Member Avatar for LDJ95

Hi all, I apologise in advance if this is too simple, but I've been searching around for a good hour or two now, and I can't quite get my head around this. Basically, I'm looking to teach myself Python (3), and one of the things I'm trying to do is …

Member Avatar for LDJ95
0
850
Member Avatar for frivolous
Member Avatar for guidely

Hi I dont really sure what I did wrong but it no working. I am making Snakes and Ladders game with out using list import random separator = '-' * 20 spaces = [None] * 90 c_l_spaces = {r'slid down a chute ': [[14, 3], [20, 15], [39, 33],[66, 53],[69, …

Member Avatar for TrustyTony
1
1K
Member Avatar for utkarshsahu

Suppose i have a list l=[1,2,3] i want to make this list as [2,3,4] i.e. add 1 to all the values in list l. I want to do it by the method of for loop.. Can someone help?

Member Avatar for TrustyTony
0
125
Member Avatar for NeoSyn

Been stumped over this for a while.. I was just wondering how I'd go about creating pattern movement and randomising it. The movemnt itself is just simple back and forward. But I wanted to make it random rather then fixed (which is what it is now) The main isn't posted …

0
82
Member Avatar for SlzzyDzzy

Im trying to teach myself a little bit of python and have become stuck/frustrated. Im on [Python.org](http://www.learnpython.org/page/Loops#) and so far have had no luck. First, the objective is not too clear "Loop through and print out all even numbers from the numbers list in the same order they are received, …

Member Avatar for M.S.
0
187
Member Avatar for dobermiller

I've been trying to finish up an otherwise straightforward assignment for my python comp sci class but for whatever reason everytime I try importing cTurtle it informs me that such a module does not exist. I'm a little confused because I've never had this problem before. The relevent bit of …

Member Avatar for TrustyTony
0
226
Member Avatar for greatman05

Hello. What are some ways that one can work with (x,y) coordinate pairs in Python? I'm doing a homework assignment that requires me to create a program that can check for certain binary relations (reflexive, transitive, symmetric), and I'm having an issue coming up with the best approach for it. …

Member Avatar for greatman05
0
277
Member Avatar for bsh6wc

I have a file that looks like this: 110603/1200 stuff stuff stuff min and max 0.00 1.00 110604/1200 stuff stuff stuff min and max 0.00 1.50 etc... I want to pull out the date and pair it with the associated min and max value associated with it. I know how …

Member Avatar for TrustyTony
0
134
Member Avatar for Niner710

Hi, I am interested in trying to make a cumulative distribution function in Python. I have a set of data in a numpy array and just want to plot that data. numpyArray = [0.4, 0.3, 0.6,1.2,1.8, 0.5] I would also like to have a vertical line on the x-axis at …

Member Avatar for Niner710
0
244
Member Avatar for kernel>panic

I wrote an XML parser that works great to fit my needs, but I can't retrieve the root attribute nodes no matter what I try! So far I have the following code that works great to retrieve the child tag values: import xml.dom.minidom def parse(filename): xmlDoc = xml.dom.minidom.parse(filename) tag = …

0
125
Member Avatar for adrigreat14

I am starting to learn python as my first programming language, but i ran into a problem while trying to make a function that calculated the missing variable in the simple equation v= u+at. The problem is that i am incapable to change a variable's value from False to True …

Member Avatar for adrigreat14
0
282
Member Avatar for Despairy

Hi, Im trying to parse a file which contains some random text. How can i match a case which seperates "garbage" (anything but digit/letter) char?? for e,g: 25.5.5 will produce . (the 2nd dot, because 25.5 is a number (rational)) another e.g: ----3.82 will produce --- (because -3.82 is a …

Member Avatar for nbaztec
0
155
Member Avatar for 4evrmrepylrning

So I have been told by various people on numerous occasions that you cannot parse XML by using regular expressions or any means other than a parser. So, here at work, I have LXML and that is what I have to use. At the moment I am trying to remove …

Member Avatar for 4evrmrepylrning
0
285
Member Avatar for Despairy

lets say i have these two patterns patternWord=r'[a-zA-Z]+' #word patterns patternNum=r'[+-]?\d+\.?\d*' #numbers patterns can i make a third pattern that is made out of them? patternTrhee= NOT patternWord AND NOT patternNUM? so than it will find all others? didnt find how to combine patterns and my teacher doesn't know either …

Member Avatar for TrustyTony
0
146

The End.