473,544 Members | 801 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.
2
5,882
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...
3
2,419
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 =...
1
1,704
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:
0
1,190
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...
2
1,986
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^
1
1,940
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
1
2,508
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
5
2,700
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)
4
1,968
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
3
2,569
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:
6
3,766
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...
2
5,426
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
1
2,035
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...
8
1,713
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...
2
1,656
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()...
0
1,242
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():...
3
2,654
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...
1
2,948
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...
0
1,439
thread by: phub11 | last post Oct 24 '12 by: phub11
Hi, I have 3 columns, the first is text, the second are checkbuttons, and the last are comboboxes. Could someone tell me how I can populate the comboboxes using only data added to the child list? Below is the code I have so far: treestore = gtk.TreeStore(str, bool) for imol in molecule_number_list(): mol_name = molecule_name(imol)...
3
3,210
thread by: argbsk | last post Oct 27 '12 by: zmbd
Below is the dictionary {0: ACC_diff.log\n'], 1: BACKUP_diff.log\n'], 2: }
1
3,123
thread by: greenpy | last post Oct 28 '12 by: dwblas
i try to use all fonts in tkfont. But some fonts are not working. I must use tt fonts in tkfont please give a solution
2
3,977
Jory R Ferrell
thread by: Jory R Ferrell | last post Oct 29 '12 by: Jory R Ferrell
The following attachments may help better than my own description. CTypes_1 is a picture of the python code calling the function from the DLL. CTypes_2 is the code contained within the DLL. (Before compilation of course. The actual DLL looks nothing like this.) CTypes_3 is the DLL located in the directory I am calling it from during...
3
1,945
roberttonafelix
thread by: roberttonafelix | last post Nov 1 '12 by: bvdet
hi, In a folder there are 10 files, in that 3 files are in used by another process i want to pick only the files which was in not in use.... If the Python script is available kindly share with me... Thanks in Advance, Robert.J
2
9,773
thread by: TalHuang | last post Nov 7 '12 by: TalHuang
Why this code return error AttributeError: 'tuple' object has no attribute 'join' Any help will be appreciated; Thanks import string
1
4,351
thread by: greenpy | last post Nov 8 '12 by: bvdet
I am using python 2.7 on windows 7. Drawing is wonderful in tkinter canvas widget. Now i need draw 3D objects in tkinter and make a z cords in tkinter. I know tkinter have only x and y cords. I try so. But i get errors

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.