15,181 Topics

Member Avatar for
Member Avatar for nxavier

Hi guys, I've almost finished my assignment but the last question is kind of a curve ball (for me). She wants us to create function that accepts a list of words and then returns the longest word in the list. This is what I've come up with: [code] def longestWord(wordlist): …

Member Avatar for scru
0
94
Member Avatar for a1eio

Hi, I'm a bit stuck on getting 1 function that's not inside any class or function, accessible or callable to everyother part of the program, from within classes and the Main function.. i've tried to make it global but i'm not sure on how to make it work and it …

Member Avatar for BearofNH
0
121
Member Avatar for julichrist

hi, i'm using django framework. but now i'm facing some problem... i want to check if the system time is the same with the time that user input? i don't know how to do it in django framework... but i'm sure in VB, php or something just like this if …

0
50
Member Avatar for huglybits

I got a text file and saved it in python25 (a folder) as .txt. I need to import this file and I am getting syntax error that file is not defined. I am a complete biology novice to defining and importing files. Please help!

Member Avatar for 1337455 10534
0
111
Member Avatar for sigkill9

I've been working on this script all weekend and am almost done with it accept for one last detail; implementing a "process another number?" prompt after a user input is processed. The script works like this: First, the user enters a number to test (to find the two prime numbers …

Member Avatar for sigkill9
0
202
Member Avatar for nish88

hi.... i have an image Oscillator.gif and i want to implement the animation which is being shown by this image. can anyone tel me how to do this. or can you please give me some links or tutorials where such programs are being wrote. thanks you very much

Member Avatar for nish88
0
87
Member Avatar for nish88

hi everyone.....i'm designing a simulator and i need to study John Conway's Game of Life. i'm getting the source code in java or c++ everywhere i search. Have anyone ever implement it using python or can you please give me a link where i can find the source code in …

Member Avatar for nish88
0
134
Member Avatar for nish88

hi everyone. i'm try to load an image by clicking on a botton insert imag but the problem thata i having with this is that the image is not being insert it just appear and disappear immediately. can anyone tell me what is wrong with my codes and tel me …

Member Avatar for nish88
0
122
Member Avatar for alivip

how to ingrate my code to read text in in parent folder contain sub folders and files for example folder name is cars and sub file is Toyota,Honda and BMW and Toyota contain file name Camry and file name corolla, file name Honda contain folder accord and BMW contain file …

Member Avatar for jrcagle
0
99
Member Avatar for 1337455 10534

So I have a pyGTK app going on nicely, but it requires sudo permission (under Linux) to perform a BASH operation. If I prompt for a password using a GUI, is there any way I can do my BASH stuff without sudo asking the user for a password in the …

Member Avatar for 1337455 10534
0
203
Member Avatar for huglybits

I would like some advice as to how to write my wc program. Program should accept a file name as input and then print three numbers showing the count of lines, words and characters in the file. Chapter 4 question 15 of zelles introduction to python

Member Avatar for misty_mirage
0
509
Member Avatar for Zelores

Hey guys, I got another stupid question. For my last assignment, I have to take a .txt file that has contacts in it, import it into python (already did that) and use it to search with. the file goes last name first name number # repeats about 4 more times. …

Member Avatar for vegaseat
0
103
Member Avatar for shadwickman

Hi, I have a string that I want converted to an integer. I tried int() but it doesn't work because of what my string (as an example) is "2*2/4". I want it to make that into an integer and just put the answer (1). Is there a simple way to …

Member Avatar for shadwickman
0
111
Member Avatar for a1eio

Hi, I'm trying to create 6 buttons in a for loop using tkinter, each button's command points at the same function, but passes a variable (the loop counter.. in this case i) now for some reason.. when i run it, and click on each button, the function is supposed to …

Member Avatar for a1eio
0
139
Member Avatar for alivip

Is python provide search in parent folder contain subfolders and files for example folder name is cars and subfile is Toyota,Honda and BMW and Toyota contain file name camry and file name corola, file name honda contain folder accord and BMW contain file name X5 Is there way to enter …

Member Avatar for woooee
0
150
Member Avatar for okcomputer24

I am wanting to produce a number matrix which will result in displaying the numbers in chronological order. For example, if a 3 x 3 matrix is desired, the output would result as such: [[1,2,3],[4,5,6],[7,8,9]] The first part of my code can produce the initial list. However I am unsure …

Member Avatar for woooee
0
74
Member Avatar for piasek

[TEX] Hello I would like get this effect using PIL: [url]http://www.echostar.pl/~piasekps/10.png[/url] i have this code but it is not what i want, can you help me somehow? i will be greatfull for any help best regards p.s. i have also problem with ImageFont.truetype(font_ttf, size) it does not work on linux, …

0
61
Member Avatar for Achayan

import os import maya.cmds as cmds class mypars_ts: def __init__(self): print "Hello\n" def testing(*args): print "Call Came\n" def window_lod (self): if cmds.window('ExampleWindow', exists=True): cmds.deleteUI('ExampleWindow', window=True) cmds.window( 'ExampleWindow' ) cmds.columnLayout() cmds.text( label='Size and position the window before closing it.' ) cmds.button( label='Close', command='testing' ) cmds.showWindow( 'ExampleWindow' ) my_calls=mypars_ts() my_calls.window_lod() when ever …

Member Avatar for Achayan
0
124
Member Avatar for xRuP7uR3x

Greetings everyone. This is my first post on this board, and I would like to offer thanks for any and all help, guidance, advice, and/or bonks on the head in advance. I am an aspiring programmer currently learning Python as a way to introduce myself to the world of software …

Member Avatar for jrcagle
0
541
Member Avatar for biggz

ive ben asked to make a program where the user inputs a floating number eg.(2.5) and the program displays the 2 alone and the .5 alone ive ben trying for a while but gone nowhere

Member Avatar for vegaseat
0
82
Member Avatar for sigkill9

Could someone help me streamline this? Like eliminate unnecessary coding and etc? I got the script to work, although I couldn't figure out how to handle small prime numbers such as 2 and 3. It wouldn't output "this number is prime" (see script below) so I had to force prime …

Member Avatar for 1337455 10534
0
121
Member Avatar for alivip

I wont to find most 10 frequency word of specific file for that I have written this code [CODE] import sys import string import re file = open ( "corpora.txt", "r" ) text = file.read ( ) file.close ( ) word_freq ={ } word_list = string.split ( text ) for …

Member Avatar for alivip
0
126
Member Avatar for linux

Alright, I'm trying to make a small GUI application that'll allow me to run a .ck file (with ChucK) from a GUI, from a preset directory. Okay, so I have: [code=python]from Tkinter import * class chuckrun: def __init__(self, master): ui = Frame(master) ui.pack() self.file = Entry(ui, text="Filename") self.file.pack(side=LEFT) self.play = …

Member Avatar for linux
0
522
Member Avatar for vagab0nd

i have had a busy day and its late in the uk? I have with a little help earlier on here combined lots of snippets orf old code and tutorials into a app that works and is all new code. problem I have run into is that I want to …

Member Avatar for vagab0nd
0
116
Member Avatar for raswin

Can someone help me with this? My problem is like this... There is a string "India is" ... Then there is a unicode string Now if I try unicode("India is") I get an error like [B]"'ascii' codec can't decode byte 0xa0 in position 8: ordinal not in range(128)"[/B]. So what …

Member Avatar for jrcagle
0
26
Member Avatar for sigkill9

I have a question about a script i'm making. It asks the user to input an integer, then finds two prime numbers that sum up to the number, and displays what those two prime numbers are ( something like "54 = 5 + 49" ). I have most of the …

Member Avatar for sigkill9
0
100
Member Avatar for Thradok

I'm just starting out with Python, and for some reason I am getting a syntax error. This only happens when I run the whole program at once, but if I run only this little bit, it works fine. while choice != "q": choice = raw_input("What would you like to find …

Member Avatar for Thradok
0
104
Member Avatar for vagab0nd

ok below code is v rough but first implementation in python. i get the error name error name self is not defined in relation to teh first use of self.panelL in the layout function? it was working then i tried adding a button and it stopped I removed the button …

Member Avatar for vagab0nd
0
378
Member Avatar for amddma

ok this is my last one and i am still a total n00b to this. this is my assigment: [QUOTE]Lab: Finding the largest number In this lab, you will write a program that finds the largest number of a sequence. First, your program asks the user to enter an integer …

Member Avatar for amddma
0
107
Member Avatar for sigkill9

I'm doing some reading in a python book and am doing one of the chapter exercises but I cant figure out how to get it to work and was hoping some of you python guru's could help out? Heres description of the problem to be solved: "A positive whole number …

Member Avatar for woooee
0
2K

The End.