15,181 Topics
| |
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): … | |
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 … | |
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 … | |
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! | |
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 … | |
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 | |
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 … | |
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 … | |
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 … | |
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 … | |
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 | |
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. … | |
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 … | |
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 … | |
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 … | |
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 … | |
[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, … | |
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 … | |
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 … | |
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 | |
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 … | |
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 … | |
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 = … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … |
The End.