473,695 Members | 2,884 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Python Forum

Python programming language - Ask questions about python interpreter, control flow, data structures, modules errors, classes, standard library, gui, databases, unit testing, object oriented, structured programming and more.
1
2,961
Jory R Ferrell
thread by: Jory R Ferrell | last post Oct 23 '12 by: Jory R Ferrell
Uhm...."Why might my interpreter be unable to find the pyOpenCL function 'create_some_context'." Is what I meant to write. Anyways... I both manually installed (simply pasted the files into the python directory) and used the 64-bit Windows binary install by Christoph Gohlke: http://www.lfd.uci.edu/~gohlke/pythonlibs/ The interpreter also...
3
2,660
thread by: jpersson | last post Oct 23 '12 by: dwblas
Hi I am making a calendar (in Swedish): have problems with the Type Error. The problem i s that the user type in under val_1 what year he or she want to se a calendar of. The I want to send that information (val_1) up to def. valt_ar to continue calculate.. ------------------------------------ from time import* import time class...
0
1,247
thread by: phub11 | last post Oct 22 '12 by: phub11
Hi, I have a routine that creates multiple checkbuttons. I'd like to add a separate combobox that, in part, changes the status of the checkbuttons made in this loop. Could someone point me to some code that allowd me to change, say the second checkbutton made in the loop from False to True? for imol in molecule_number_list():...
2
1,663
thread by: phub11 | last post Oct 22 '12 by: phub11
Hi, I have a variable number of check buttons and comboboxes I want to add to a window; however, I keep getting memory faults when I try to horizontal box a check button and combobox and then box each one of these vertically. Any help would be appreciated: window = gtk.Window(gtk.WINDOW_TOPLEVEL) combobox = gtk.combo_box_new_text()...
8
1,723
thread by: amankillz2346 | last post Oct 21 '12 by: amankillz2346
Hello, my program is supposed to print the length of the string inputed, print put characters into a list only if they dont repeat, then print a list of the location of those characters. I am sure there are many ways to do this however, this is the only way i could think of, just setting another variable and adding that variable to a list, however...
1
2,042
thread by: Trolkar8 | last post Oct 16 '12 by: jamesh1999
I am trying to understand the way that pixelperfect collisions works, I have made a program using two circles(images) bouncing around in the pygame window. This is the script: import pygame, importedfunctions, random pygame.init() clock = pygame.time.Clock() screen = pygame.display.set_mode() class BallClass(pygame.sprite.Sprite): def...
2
5,448
thread by: amankillz | last post Oct 16 '12 by: dwblas
My program is supposed to reverse the string inputted, print it then extract the numbers and print the numbers of the reversed string in a list. def reverse_str(string): revstring =('') length=len(string) i = length - 1 while i>=0: revstring = revstring + string i = i - 1 return revstring
6
3,772
thread by: crumble113 | last post Oct 15 '12 by: Rabbit
Can anyone please tell me where I am going wrong with this for loop which is meant to take as input a specific corpus, sample size and number of samples and then give the averages of the expected sentiment tokens, normalised lexical diversity and probability of short sentences. It is also meant to give me the standard deviation of these three...
3
2,578
thread by: ATNC33 | last post Oct 14 '12 by: dwblas
I've solved this problem... I had a little error on the path of the frame that i have to open to reach the form. Now the form is being opened, but i can't find the login text box. Can you help me @Rabbit? Here is the code and the text message:
4
1,974
thread by: Ascender | last post Oct 10 '12 by: Ascender
def wordFunc(myDict, currentWord, n): if n==0: #Base case print(currentWord) else: for char in "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ": if myDict <= 0 : continue elif myDict > 0: #Decrease current dictionary's character value by 1 then call function myDict -=1
5
2,706
thread by: ATNC33 | last post Oct 9 '12 by: Rabbit
Hello I'm new here, but I need some help. I'm trying to do a login into the safilo website (http://www.safilonet.safilo.com/) running python code. There is an error that I'm not capable to find where it is: ---------- run.py """UPDATE SAFILO""" ss = SafiloSupplier(updateBrands=True)
1
2,519
thread by: argbsk | last post Oct 8 '12 by: bvdet
Following is the text file i have Test logname : DISK$REGRES:ACC_diff.log FACILITY : ACC FAILED LOGINACCOUNTINGTST Total : 42 Passed : 41 Failed : 1 Not Run : 0
1
1,946
thread by: mirshany | last post Oct 5 '12 by: bvdet
I could understand yet what indent mean, how to write a block of code in example. IndentationError: expected an indented block >>> for letter in 'Python': # First Example ... if letter == 'h': ... print letter File "<stdin>", line 3 print letter ^ IndentationError: expected an indented block
2
1,991
thread by: orgnlmrwiggles | last post Oct 5 '12 by: Rabbit
I have been working on this; It is a formula for estimating pi. My problem is that I am getting values no where near 3.14; all of my pi results are even coming out negative, and around -.000003, etc.. Can you see where i made my mistake in the structure of the math? The formula is as follows: Sigma from K=0 > inf. 2( -1^k ) * 3^
0
1,195
thread by: wangolo | last post Oct 4 '12 by: wangolo
Well i have a problem with properly sharing data or messages between client threads when they have connected to the server. Iam trying to create some kind of messaging server or a chat like Server. where the message from one client is placed on the Queue and sent to other client who are connected or sent to new clients who are just connecting. I...
1
1,708
thread by: dor132 | last post Oct 4 '12 by: bvdet
I wrote this program: try: x=int(raw_input("Please enter a number: ")) except: print 'Please enter a numeric number.' import sys sys.exit() and after it prints "Please enter a numeric number." it shows this problem with the exit command line:
3
2,426
thread by: dashtons7 | last post Sep 24 '12 by: bvdet
I get the following message when I try to run the below program: builtins.NameError: global name 'gallons' is not defined def main(): square_feet = float(input("Enter the square feet of the wall that is to be painted: ")) gallons = (square_feet/115) paint = float(input("Enter the cost of paint per gallons: ")) labor =...
2
5,887
thread by: kricchet | last post Sep 24 '12 by: dwblas
I'm trying to create a caesar's cipher that uses raw_input for a sentence and key to encrypt. What I can't figure out is how to maintain spaces as spaces, originally they were treated as though they had a zero value. For example if i typed in a space with a key of 2 it would return b. I can't seem to figure it out. import string codedsen...
4
2,495
thread by: newbieinpython | last post Sep 23 '12 by: dwblas
Here are my code below, i have two issues: 1) user input was overwritten. 2)i don't see the line is printed. What did i miss? please help. ------------------------------------------------ #!usr/local/bin/python3 f = open('python1/inputter.txt', 'w') while True: i = input("Write a sentence:") f.write(i) if i == "": break
1
3,177
thread by: newbieinpython | last post Sep 21 '12 by: Rabbit
Hi, please help to hence me how to break a pargraph to print line by line if it ends with coma, it is a phras, if it ends with period , it is a sentence. Thank you soo much in advance. Andrea For example: text = "It's probably a great morning for a doughnut run in New York City, since you won't have to fight off the NYPD. Officers are...
3
1,546
thread by: leyla | last post Sep 18 '12 by: Rabbit
wanting to build a word index table ,for each word in a large data set of files , where it would have the word and document ID's where it was found ,, in order to use it in a search engine model.
1
1,546
thread by: cbeeson | last post Sep 14 '12 by: bvdet
I have a list of values in an array named V that i need to plot against a list of "dates". At the moment the dates are in an array (spanning 6 months) in the format date= How do i convert these dates into dates that can be sensibly plotted?
9
24,664
thread by: Miguel Valenzue | last post Sep 12 '12 by: bvdet
I want to round a list of numbers to basically remove all the decimal places or even just convert them to integers. So this is what I've tried and I just can't get this to work. myList = #declare my list for i in range(len(myList)): myList == round(i,0) #tries to round all numbers. print myList
1
1,674
thread by: Encchhh | last post Sep 12 '12 by: Rabbit
Hi, its a really simple script, but since I'm new to python I have no clue what I am doing wrong. Also if you could, I would appreciate tips on a good IDE for python. #!/usr/local/bin/python x1 = raw_input("What is x1 ") x2 = raw_input("What is x2 ") y1 = raw_input("What is y1 ") y2 = raw_input("What is y2 ")
1
1,651
thread by: ronparker1 | last post Sep 11 '12 by: anil6035
Hello all, I am trying to create a python api (i think thats what i need) and was just hoping for some pointers. I have an html website and a python script, and I want them to work together. the html site simply asks the user to input two numerical values. the python script takes two numerical values and adds them together. So I am looking...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.