Posts
 
Reputation
Joined
Last Seen
Ranked #1K
Strength to Increase Rep
+3
Strength to Decrease Rep
-0
71% Quality Score
Upvotes Received
7
Posts with Upvotes
5
Upvoting Members
6
Downvotes Received
3
Posts with Downvotes
2
Downvoting Members
3
2 Commented Posts
~20.9K People Reached
Favorite Forums
Favorite Tags
Member Avatar for DragonMastur

I am trying to convert a file to a dictionary here is the contents of the file, Name: DragonMastur; Hand: None; Inventory: {"Gold": 0, "Brush": 0, "Twig": 0, "Sapling": 0, "Metal Axe": 0, "Grass": 0, "Metal Pickaxe": 0, "Metal": 0, "Log": 0, "Diamond": 0, "Stick": 0, "Stone": 0, "Wheat": 0, …

Member Avatar for Gribouillis
0
345
Member Avatar for DragonMastur

It could be simplifide more, I know. I was doing it as an exersise so its rough and skecthy. But it's workable, I tested it more then 50 times.

Member Avatar for Slass33
0
529
Member Avatar for vegaseat

Nice. I like the way you used a loop to make the widgets and place them I never thought of that.

Member Avatar for vegaseat
4
2K
Member Avatar for Atul_4

use the random module and a for loop like this. import random ll = "a;b;c;d;e;f;g;h;i;j;k;l;m;n;o;p;q;r;s;t;u;v;w;x;y;z" ul = "A;B;C;D;E;F;G;H;I;J;K;L;M;N;O;P;Q;R;S;T;U;V;W;X;Y;Z" key = [] finalKey = [] finalKeyStr = "" lettersList = ll.split(";") + ul.split(";") for number in range(0, 100): key.append(str(random.randint(1, 26))) for letter in range(0, 100): key.append(str(random.choice(lettersList))) for char in key: rl …

Member Avatar for snippsat
0
643
Member Avatar for DragonMastur

I would like the widgets on the window to expand as you expand the window. I know you can do it with the pack method but I'm using the grid method to arange my widgets. Pack Method: label = Label(root, text="Some Text") label.pack(expand=1, fill=BOTH) Grid Method I'm using: self.inventoryLabel = …

Member Avatar for woooee
0
6K
Member Avatar for sbaw

It looks as if only 1/4 of your moudles are missing so looking in your python folder for your moduldes is a way to start. Locations of folders: Mac: /Users/Shared/bin/python Then look for the lib folder. Windows: C:\Python34\Lib Replace "Python34" with what ever version of python your running. If you …

Member Avatar for megaflo
0
1K
Member Avatar for BustACode

My dad gave me a programing idea but I needed ordered dictionaries. I could solve it till now. Thanks!

Member Avatar for DragonMastur
1
469
Member Avatar for DragonMastur

I needed a calculator and I didn't want to use google since my internet is slow. So I made one! Here it is. Working with it is simple. Use the number and operation keys("c" for clear, "p" for pi, and "s" for sqrt) as well as the return and enter …

0
690
Member Avatar for DragonMastur

karmstrong ask in the Python chat if any one was farmilar with converting a for loop in C to Python. Here is a program in python that will do it for you! Thank You!

Member Avatar for vegaseat
0
808
Member Avatar for DragonMastur

I made a little py editor because I didn't want to go to all the troble of installing an idle, but I didn't like notepad either. Here it is!

Member Avatar for DragonMastur
3
313
Member Avatar for Jalcock501
Member Avatar for Irka

I suggest using Tkinter. It is very simple and it is pre installed in python. Here is an example of a window with a single button. from Tkinter import * class App: def helloworldButtonClick(self): print("Hello World!") def __init__(self): self.root = Tk() self.root.geomentry("200x300") self.root.title("Window With Button") self.helloworldButton = Button(self.root, text="Hello World", …

Member Avatar for DragonMastur
0
350
Member Avatar for Mark54

what are the error msgs? I tried installing it and needed to set up a PATH for it to word.

Member Avatar for DragonMastur
0
279
Member Avatar for Riya_2

vegaseat has it right. I used the same kind of menthod in a program for counting the number of words in a file. I just didn't use the ".lower()" part.

Member Avatar for DragonMastur
0
305
Member Avatar for Henry_5

Use a for loop like this: for x in range(0, 8): if validatemove(move) == True: capture() There are 8 posible times of capture in a single move. This doesn't use variables so there is no risk of it running forever.

Member Avatar for DragonMastur
0
791
Member Avatar for vegaseat

I have a raspberry pi(Using it right now) and an arduino.Ill see if I can use them together. Iam useing the arduino for a science expiriment and know both python and sketch(I think that is the language that arduino runs on.) Thank vegaseat.

Member Avatar for vegaseat
0
658
Member Avatar for DragonMastur

I am try to make a program that alows the user to input their username and password to recive a set of options. Right now the options are to look at a file or quit. In order to complete it I need to know how to turn of the visability …

Member Avatar for DragonMastur
0
513
Member Avatar for Kai_Chang

You have some errors on the imports, json and RPG_Data. We need the json and RPG_Data files in order to run the program.

Member Avatar for vegaseat
0
274
Member Avatar for Andrae

What your asking sound a lot like what Im making right now. here is what I have so far... Note: If you run the program you will have to make some .txt file and change the directories. import time i = "" fileContents = "" #User 1 password1 = "hellomynameis" …

Member Avatar for Andrae
0
408
Member Avatar for bikash_2

That is very simple math. Try to see if you can come up with something more complex(You should tell the user that they can use a caculator.) Also in line 34 what if the answer is "1221" or somthing random like that?

Member Avatar for DragonMastur
0
197
Member Avatar for DragonMastur

This is a PyEditor I made because I couldn't get a IDLE working on windows 95.

Member Avatar for DragonMastur
0
411
Member Avatar for DragonMastur

Is it posible to have an optional veriable in a funtion? Such as this: >>>def Say(msg, (optional)): >>> print msg >>> print optional >>> >>>Say('hi', 'option') hi option >>>Say('not') not If so How?

Member Avatar for DragonMastur
1
365
Member Avatar for DragonMastur
Member Avatar for RichardGalaviz
0
136
Member Avatar for frankie198

I have made a py editor which you can open save and run files. It is in python and is .py so you can just run as is. import sys if sys.hexversion >= 0x030000F0: #First find which version and imports to import runningPython3 = True else: runningPython3 = False if …

Member Avatar for Jack_9
0
846
Member Avatar for DragonMastur

I want to make a game that requires the arrow keys to be pressed. How do I detect if a key has been pressed?

Member Avatar for Gribouillis
0
478
Member Avatar for abaddon2031

I'am using different imports and python 3 import tkinter.filedialog as tk_FileDialog from tkinter import* fileCount = 0 for x in range(0,10) #read as many as you want f = tk_FileDialog.askopenfile(mode='r') #Or what file your trying to open fileContents = f.readlines(1) #Or what lines you want to read if fileContents == …

Member Avatar for flebber
0
192
Member Avatar for flebber

I made a PyEditor so here are a few of the lines from it: import sys if sys.hexversion >= 0x030000F0: #First find which version and imports to import runningPython3 = True else: runningPython3 = False if runningPython3: import tkinter.filedialog as tk_FileDialog from tkinter import* from io import Stringl0 #This is …

Member Avatar for flebber
0
149
Member Avatar for EnergeticJet

**Expert** PyEditor1.0 from Tkinter import* import tkDialog as tk_Dialog from Stringl0 import Stringl0 import os recents = [] class PyEditor: def doNew(self): self.text.delete(0.0,END) def doUndo(self): self.text.edit_undo() def doSaveAs(self): file = tk_FileDialog.asksavefile(mode='w') textoutput = self.text.get(0.0,END) file.write(textoutput.rstrip()) file.write('\n') def doOpen(self): file = tk_FileDialog(mode='r') fileContets = file.read() recents.append(file) self.text.delete(0.0,END) self.text.insert(0.0,fileContents) def doRun(self): file …

Member Avatar for DragonMastur
0
374
Member Avatar for mark103

Make sure to import on this one! from msvcrt import getch keypress = 0 stopDown = 0 def keys(TargetKey): while keypress = 0: key = getch() if key == TagetKey: stopDown = 1 keypress = 1 keys(delete) if stopDown == 1: pass #code to stop the download

Member Avatar for DragonMastur
0
399