15,185 Topics

Member Avatar for
Member Avatar for Matt Tacular

[php] import random availableCountries = [0, 1, 2, 3, 4, 5, 6, 7] firstTurnsCountries = [] secondTurnsCountries = [] def countryDivider(countryNum): counter = 0 while True: if counter == 8: break num = 7 if num > 0: countryToAdd = random.randint(0,num) if num == 0: countryToAdd = 0 if counter …

Member Avatar for Matt Tacular
0
110
Member Avatar for sneekula

I like to create a database of common chemicals with Python. How would I go about that? Any help welcome!

Member Avatar for Ene Uran
0
115
Member Avatar for sneekula

This came up on Chris99's bus ticket program thread. Would like to see any simple examples on how to pass variables between classes without using global variables.

Member Avatar for vegaseat
0
19K
Member Avatar for chupacabra

python 2.4.1 mySQLdb 1.2.0 kernel 2.6.12 Hi, How can I make the following statement so I can search for any string? Right now I need to input at runtime %whatever I'm looking for% between % signs to get all records matching that query. I want to have this statement set …

Member Avatar for locosway
0
134
Member Avatar for mruane

I am horribly (obssesed?) with writing a visually appealing game (simple) in python. My text adventures didn't appeal to my aufience (family), so I was looking at a tut on making a pac man clone, supposed to be line by line, it seemes choppy. Any ways, here is the code. …

Member Avatar for vegaseat
0
629
Member Avatar for mruane

I was wondering, if I wanted to attempt an ANSII dos game in Python, what would be the best way to do it? I would like to know how I would run it, i.e., would it run in the Python Interactive shell or could a make it run in dos? …

Member Avatar for mruane
0
257
Member Avatar for mattyd

I have been working on a GUI-based program using Tkinter; it is coming along nicely and I am very pleased with the results. I am at a point where I am trying to attempt a graphic manipulation of the GUI canvas. I have researched this but I am unsure what …

Member Avatar for jrcagle
0
2K
Member Avatar for sneekula

As you can see, I am playing around with the Tkinter GUI toolkit. How can I keep a number of widgets fixed in a location even when the user expands the window?

Member Avatar for sneekula
0
190
Member Avatar for sneekula

I am writing a small Python program for the use in our departments stockroom. This is what I have come up with (just starting): [php]# table of chemicals in stockroom # order --> stock number, chemical name, quantity (grams) # short version of the table table = [ ['ud-99137', 'm-chlorobenzoic …

Member Avatar for sneekula
0
152
Member Avatar for coder_gus

Hello! I am working nowadays at a little script that reads mail (gmail).Nothing fancy here.The only problem is that i want to check if pop is enabled and if not to enable it from my python script. Do you know some way[s] to do that?I've tried googling but all i …

Member Avatar for coder_gus
0
73
Member Avatar for mattyd

**[I]Note: This may not be the correct forum for this post; I posted here as I thought it may be related in at least an indirect way. Please move if necessary.[/I] I have never knowingly worked on any projects where I had to attempt to extend a language. I hear …

Member Avatar for Narue
0
124
Member Avatar for linux

Hello! In Visual Basic, there is a piece of code that can be used to see if a command starts with a certain text. For example, if I had a textbox, and I wanted to see if the user had started it with an "A" then I would use (not …

Member Avatar for vegaseat
0
207
Member Avatar for sneekula

Is there a way to make a Tkinter GUI window that the user can not change the size of?

Member Avatar for sneekula
0
159
Member Avatar for Haze

when i say basic i mean basic it doesnt store the encrypted string in a file or anything it just prints out what it would be and all i intend it to do is swap a for b, b for c and so on then turn the string round backwards …

Member Avatar for jrcagle
0
2K
Member Avatar for mattyd

Concerning Python Indentation Syntax: I have researched this and read some reasoning behind indentation-level enforcement. My question is: does this exist simply to ensure consistency when dealing with nested statements, a precaution against sloppy composition of code? I am not complaining about this, and actually I somewhat like this, but …

Member Avatar for jrcagle
0
239
Member Avatar for mattyd

I have been working on a somewhat small Python GUI for a few weeks now primarily focusing on the GUI and not giving much in-depth thought to the logic of what is to be a simple card game. I assumed the logic to be in my head and in general …

Member Avatar for jrcagle
0
298
Member Avatar for chris99

So the Text Adventure is lost. ;-;. I am working on a GUI to take a starting point and a destination input by the user, and scan a file to find a match for both. If it finds a match for Variable A + B then it will assign variable …

Member Avatar for Ene Uran
0
137
Member Avatar for shr2408

I am writing a small tkinter-app involving user keyboard-input, and want to control the range of acceptable input-characters. I'm currently using an Entry-widget, but haven't been able to access the individual characters AS THEY ARE ENTERED. What I (think I:confused:) need is somthing like the 'command=' option (as in the …

Member Avatar for shr2408
0
1K
Member Avatar for mattyd

I am trying code a single button that will fire two commands, that is, it will open two image files with one button selection. I have researched this and have not found much directly related to this question; what I found was to use a def within a def, thus …

Member Avatar for Mouche
0
4K
Member Avatar for William Connery

Hi, I have a small python program with e-mail capabilities that I have pieced together from code snippets found on the internet. The program uses the smtplib module to successfully send an e-mail with an attachment. I want to give users an indication of the percentage of the e-mail that …

Member Avatar for William Connery
0
183
Member Avatar for vegaseat

sharky_machine Offline Posting Whiz in Training Join Date: Oct 2006 Location: New York City Posts: 253 Rep Power: Re: Starting Python Today, 1:41 pm | Add to sharky_machine's Reputation | Add Infraction | Flag Bad Post | IP | #86 -------------------------------------------------------------------------------- Vegaseat: I have been reviewing this code you had …

Member Avatar for mattyd
0
303
Member Avatar for manukumar05

hi friends, help me in regarding , making a "setup " using py2exe, actually my project contains ( dlls,libs,and icons,sip file) so how can i wirte a steup for the project for example my pj name is : " manukumar " it cotains : m1.py,m2.py,m3.py etc files and it contains:: …

Member Avatar for Ene Uran
0
100
Member Avatar for DarkFlash

hey guys, I'm almost done with my newest project (PythonCMS) pretty much a simple, personal, python-based version of dreamweaver;) anyway, I can build webpages with it upload images, media, updates, anything like that. but what I"m trying to get to work now is something that will resize an image to …

Member Avatar for Ene Uran
0
82
Member Avatar for mattyd

I am interested in learning if it is indeed possible to sort a Python dict. What I have researched tonight points to that it is [B]not[/B] possible, although snippets were posted inferring that you can sort a dict; I tried some of this code and it did not seem to …

Member Avatar for jrcagle
0
79
Member Avatar for Matt Tacular

I would post this in my other thread, but I marked that as solved so I think less people would look at it. I want to say this: [code]if list1 is empty: do this elif list1 has any value in it: do this[/code] How do I word that in python?

Member Avatar for Matt Tacular
0
80
Member Avatar for nnobakht

hi guys, I have an assignment that is due on december first and i cant seem to get a wrap around it and was wondering if someone could help. I have been given a Robot module with 17 testboards and some predefined functions such as sensor, move, currentPosition, boardSize and …

Member Avatar for nnobakht
0
105
Member Avatar for cambrian

Hi, I tried to run following script of drawing a sin/cos curve using python 2.4 , there is error: [B][COLOR=red]Traceback (most recent call last): File "", line 6, in ? File "C:\Python24\Lib\lib-tk\Tkinter.py", line 1564, in __init__ baseName = os.path.basename(sys.argv[0]) AttributeError: 'module' object has no attribute 'argv'[/COLOR][/B] [B][COLOR=blue]Can anybody tell me …

Member Avatar for vegaseat
0
1K
Member Avatar for Matt Tacular

When coding in Tkinter, you can make a button, then when the button is pressed, it refers to something that you defined, or whatever its called when you use the def statement. What I'm wondering, is if there is a way to do this in non Tkinter programing. I am …

Member Avatar for Matt Tacular
0
204
Member Avatar for mattyd

Hello: I am trying to use the Python Sleep Function via [I]import time;[/I] I get results but not the results I am looking for. What I am trying to do is rather simple and only for visual effect in a Python GUI: [B]Display GIF --> Sleep (pause) 5-seconds --> Display …

Member Avatar for mattyd
0
413
Member Avatar for mattyd

Last night I took the advice of a DaniWeb member and looked at some posted Python code; this code was based around a card-type game and involved creating a GIF deck, shuffling, then displaying it. My original question had to do with using a Python dict for my GIF images. …

Member Avatar for Ene Uran
0
6K

The End.