15,181 Topics

Member Avatar for
Member Avatar for Scala

I'm working on a tic-tac-toe game, and run into a problem. My problem lies in lines 24/25 and 30/31. I want to take the returned dictionary from the convert_to_yx() function and assign the keys and values as the x and y of the game_grid I have on line 1. I …

Member Avatar for woooee
0
82
Member Avatar for gelcode

EDIT: Apologies... user error strikes. Tis the way of the newb. Nothing to see here, move along. I have a dict with the following pairs: [code]object = {'v1': 1, 'e5': 6}[/code] If I set a variable using this data and print it: [code] var = object['v1'] print var [/code] I …

Member Avatar for vegaseat
0
88
Member Avatar for fongoos

I am new to programming and after a month or so of googling, I have decided to learn Python. Is this a good time to learn the language or people will soon jump ship since JAVA is now open source? By open source software, I understand that the code developed …

Member Avatar for linux
0
814
Member Avatar for yl388

Hi, everyone, I am a new user to Python. Now I have a webpage by "urllib2.Request" and "urllib2.urlopen(request)" method, but since there are several buttions in the page, how could I use "click()" to click the buttion I want? Cheers! Edward

0
36
Member Avatar for fk08

hey, i ve got an array of size 3500x300, when plotting with imshow (from pylab) then imshow takes the size of the array to build the axis. that means, my y-axis is 3500 long and the x-axis 300. is there any posibility to define 2 axes in an extra array, …

0
45
Member Avatar for 1337455 10534

Hi, I'm a high-school freshman that wont be taking a programming class until next year. I am proficient at Python, and they decided to put me in AB Programming, which is Java. When I first started programming on a z80 TI-83+ with BASIC, I set out to make my life …

Member Avatar for Ezzaral
0
94
Member Avatar for dabear

Trying to find a code to convert any base to any base, (the user specifies). I can convert numbers well, under base 10. The numbers mixed with letters confuses me. Do I read it as a string or integer? Should I use a list or dictionary? My brother is trying …

Member Avatar for ZZucker
-1
76
Member Avatar for Acidburn

Hey there, I've got a script in another language and I've set a writer from the script to python. Now I'm trying to send data back the other way... ie python -> to my script. However I've got nothing to reference in python, and i'm clueless. Can anyone provide assistance? …

Member Avatar for woooee
0
93
Member Avatar for nish88

hi everyone...... am designing an interface for security purposes where a user is allowed to enter a password to gain access... i want when password is entered its ********** that appear on the text box instead of password secret itself so that if someone is looking at the screen he …

Member Avatar for woooee
0
165
Member Avatar for scru

Is there a way to detect the internet browsers "registered" on the system my script is running on, and if possible get the location of the browser's executable? I don't mind if it requires branching the code by platform. And frankly, I don't mind if you give me a response …

Member Avatar for woooee
0
152
Member Avatar for IU34

yeah, I'm just keeping this thread open because I have another wrinkle. In my code [code=python]def prompt_house(): global gold prompt_hou = raw_input('>') if prompt_hou == 'examine table': print '''There are a lot of car magazines here. You flip through them and find 5 gold.''' gold = gold+5 prompt_house() [/code] (or …

Member Avatar for IU34
0
156
Member Avatar for renabada

1. (a) A positive whole number n > 2 is prime if no number between 2 and (inclusive) evenly divides n. Write a program that accepts a value of n as input and determines if the value is prime. If n is not prime, your program should quit as soon …

Member Avatar for Paul.Esson
0
367
Member Avatar for drjekil

I am totally new in biopython and its my first program.so may be i am asking stupid question. I am working with a text filelooks like this: #NAME AA TOPO ACCESS DSSP STRIDE Z-COORD 1lghB A i 79.8 H H -24.58 1lghB V i 79.6 H H -22.06 1lghB H …

0
77
Member Avatar for xRuP7uR3x

Hello again. Before I begin I would like to offer my heartfelt gratitude to the DaniWeb community; this website truly is a wonderful resource for a new programmer such as myself, and the help and advice that I have received have been incredibly useful. I am currently working on a …

Member Avatar for dabear
0
72
Member Avatar for drjekil

I am totally new in biopython and its my first program.so may be i am asking stupid question. I am working with a text file.Every line in that file represents one amino acid,which has some value.But i need to separate those lines which has a value between 10 to 22.how …

Member Avatar for vl4kn0
0
137
Member Avatar for dluc8461

[code] Would anyone be interested in writing a small Python script for me. Approx: 90 lines of code it is required for (Blender Python). Your help would be much appreciated. More an Edit than anything. Existing Code below needs to be edited so that the rightKey and the leftKey will …

0
48
Member Avatar for Jasper11

Hey guys, im new here, Ive been learning python for the past month or two and have run into a bit of a problem. I have read a previous post on this forum with a similar problem. There answer was to flatten the list and then search it. This approach …

Member Avatar for Jasper11
0
7K
Member Avatar for clalexa2

I am trying to save a picture from a website ever hour. Can this be done? can anyone help me out?

Member Avatar for clalexa2
0
82
Member Avatar for bachmabt

This seems like a very simple process, but I cannot get the data out of the loop: I have a data file "slink.txt": [CODE]88 10112213 33332332 22011220 23110122 21231102 12222321 32131132 10023232[/CODE] I am trying to store the numbers in a 2 dimensional array: [CODE]f = open('slink.txt', 'r') rows = …

Member Avatar for bachmabt
0
138
Member Avatar for IU34

[URL="http://corvettecraz92.pastebin.com/f59db1508"](new code)[/URL] so, my new error message is 'local variable 'gold' refferenced before assignment.' now what?

Member Avatar for IU34
0
107
Member Avatar for IU34

yeah, another one...but this time in python! yay, more errors! :) first off, [URL="http://corvettecraz92.pastebin.com/f65e1cd3c"]here's the code..[/URL] (based off of chris99's code...the only example i could find for a text adventure game!) Now, my problem is where it says [code=python] elif prompt_p == 'examine sign': print """Behold the mysterious grating! For …

Member Avatar for IU34
0
280
Member Avatar for aot

I've been trying to get some .JPGs to show up in Tkinter but have had no luck so far. Up until now I was just using PhotoImage, which takes .GIFs, but it would be nice if I could expand and use other formats. Any ideas? Also, I know that wxPython …

Member Avatar for woooee
0
232
Member Avatar for aot

I've been using Eclipse as my IDE for python programming, mostly because it's free. However, as far as I can tell, its debugger is not that great. All I ever get are notices of what line the error occurs on (and what the error type is) and, while this can …

Member Avatar for ZZucker
0
145
Member Avatar for Laurence26

I add a new name to this script, but when I want to quit and save it gives and error ValueError: need more than 2 values to unpack I have no idea what it means can someone help me? If you want to modify the program feel free... [CODE]filename = …

Member Avatar for Laurence26
0
178
Member Avatar for strictlycustom

I'm trying to write a program that asks the user their hours and returns it to the main program, and then their rate of pay and returns it to the main program. I can't run the program because it is saying there is a problem with this part of my …

Member Avatar for strictlycustom
0
929
Member Avatar for fengle1

Hey guys, new user here, just taking a course on python and theres a simple task I'm trying which im failing. [B]I'm basically trying to get a program to validate user input based on rules that i define. Namely, num1 input and num2 input are integers which can not be …

Member Avatar for sneekula
0
104
Member Avatar for blue_misfit

Hi folks! This is my first python script! It will be executed within AvsP, which is an application for writing AviSynth scripts. It provides a full Python interface, for macros and other operations. Here's the code I have now: [code] # batchCreateD2Vs # by Derek Prestegard # Last Modified 4/3/08 …

Member Avatar for woooee
0
143
Member Avatar for jgritty

I'm sure this is stupidly simple, but I am trying to add words to two different dictionary files I have created. I think my problem is here: [code=python] myDict = Dictionary.Dictionary() myDict2 = Dictionary.Dictionary() [/code] Because when I write out the files, it writes the same thing to both files, …

Member Avatar for jgritty
0
271
Member Avatar for bbmatten

I am very new to Python and am about three weeks behind due to textbook problems. I am having a problem with one programming exercise. I have no idea how to even begin writting a program to determine the distance to a lightning strike based on the time elapsed between …

Member Avatar for vegaseat
0
73
Member Avatar for hudson5cp

Hi all, im a beginner to programming Python with Tkinter. I have a windows with 2 form: 1 Listbox and 1 Textarea that load a txt file. The Listbox contains a name of chapters. How can I make because click on the listbox scroll the text inside the textarea a …

Member Avatar for hudson5cp
0
747

The End.