I wrote simple python program that rips, encodes, and gets song data from the cddb. I would like to give the user the option of customizing it to there taste. So I want to make a config file that I can store in /etc(linux fiel location). for example it would look like this config file [code] # if you would like to specify the location of you music directory uncomment the following #music_dir = '/home/shane/location/of/directory' # if you would like to permantey set the bitrate used please unmcooment the following #bit_rate = 192 [/code] is their a way to direct …

Member Avatar
Member Avatar
+0 forum 5

Ok new problem, I want to build off of a program I saw in a tutorial that has a "menu" and can calculate two different shapes. The two shapes are circle and rectangle. I've built it into a working order.(event bindings, buttons, area calculation programs) The program works all the way up to the done button(the button that begins calculation and prints it in a label) but when I click on the button it brings up a error message in the IDLE shell prompt that says that I can't do the following: This is a snippet of the script to …

Member Avatar
Member Avatar
+0 forum 9

Ok I've gotten py2exe because I have friends that want to test my programs, but they don't want to download the python program. Well I have tried to run the compiler out of MS-DOS and the Python version of MS-DOS. But every time I wind up with an error. I can't use the prompt for the life of me and I have no idea of any of the commands. :confused: A example or step by step would be [U]GREATLY[/U] appreciated. :cheesy: Running: Windows ME, Python 2.3

Member Avatar
Member Avatar
+0 forum 3

Hi all, Here's one that has me stumped. I'm trying to build a system shell with a Tkinter GUI in Python, and I can't figure out what to do with one of the widgets. Here's the program concept: I have two major widgets: a ScrolledText widget and an Entry widget. The purpose of the ScrolledText widget is to display the results (from STDOUT or STDERR) of what the user has typed. To that end, it is user-uneditable. The Entry widget contains both the prompt and the command line; when the application starts, this widget displays the prompt (which looks like …

Member Avatar
Member Avatar
+0 forum 4

Hey there, i have been writing python scripts for about 4 months now so i am still very new at programming. that said, i need to build a gui app to handle some data manipulation from a database, set points, etc... what i would like is the easiest to learn gui development method for python in linux. Dont need anything cross platform, just easy to learn but able to do things like plotting info on a graph. ok, so i have looked at Tkinter, glade2 and wxPython. i dont know, but i would like some opinions before i jump into …

Member Avatar
Member Avatar
+0 forum 4

Hey there, i have some python scripts that run with the cgi-module. all named whatever.py the thing is, firefox will open one that has a form on it, but not load the next one in line. it pops up a window that says what do you want me to do with this file? and i can open with, or download it. the other python programs work . i already did the chmod 755 on it, tried the chmod a+x, but just isn't doing anything. they work if rendered with IE - go figure. anyone ever see this ? thanks

Member Avatar
Member Avatar
+0 forum 2

Is their a python module that can get the dimensions of a video file?

Member Avatar
Member Avatar
+0 forum 4

I have been trying to make a class based on Tk(). My code is such a mess, I would be embaressed to show you what I came up with. Here is what I am trying to do [code] class Window(Tk): fill in the code here win = Window() win.mainloop() [/code] I can do this with out using classes, but as a single object I am having trouble I would like the window to be a certain dimension, and have a single button in it. I would greatly appreciate an example.

Member Avatar
Member Avatar
+0 forum 3

I have been messing around with some scripts, and would soon like to start making a few gui apps. I plan on using either tkinter, or possibly pygame, or pygtk. Are there modules already built that will allow you to browse graphically? for instance, choosing a file, or directory, using a gui button? It would be such a common feature, I would think this is already been done.

Member Avatar
Member Avatar
+0 forum 3

I am having a tough time understanding what is going on in this following code [code=python] class Player(object): """ A player in a shooter game. """ def blast(self, enemy): print "The player blasts an enemy.\n" enemy.die() class Alien(object): """ An alien in a shooter game. """ def die(self): print "The alien gasps and says, 'Oh, this is it. This is the big one. \n" \ "Yes, it's getting dark now. Tell my 1.6 million larvae that I loved them... \n" \ "Good-bye, cruel universe.'" # main print "\t\tDeath of an Alien\n" hero = Player() invader = Alien() hero.blast(invader) [/code] in …

Member Avatar
Member Avatar
+0 forum 9

Is there a way to get the day of the week when supplied with a date? Like November 11, 1911 may be a Monday?

Member Avatar
Member Avatar
+0 forum 2

Hello, I started coding a little app for exploring the mandelbrot fractal. Hopefully someone here is familiar with it, and perhaps tried coding it in python. My problem is, as you will see if you try running my code, is that the generated image is NOT the mandelbrot (although it is fractal and similar in a sense). And I just cant figure out why this is. So my hopes are that this is due to some oddity of python I am hitherto unaware of - I can't see any misstakes in the algorithm itself (although it might be there anyway …

Member Avatar
Member Avatar
+0 forum 1

I was wondering if anyone knows if any Python books that are availible,and where I might be able to purchase them?

Member Avatar
Member Avatar
+0 forum 8

I have looked through the forums for this and found several hits but none of them truly answered my question. How can I make a Python program an executable file that does not require my friends to have Python installed on their computers?

Member Avatar
Member Avatar
+0 forum 4

Is there any place where you can find a complete list of python commands? I have googled and skimed through the tutorial and I can't find any place where I can find a complete list of python commands and examples on how to use them? If there isn't one I suggest that we make one! We create a wiki where anyone can post a command and an example to go with it! For example: LIST OF COMMANDS IN PYTHON 1.) print Used to display text Example: print "hello world" Result: hello world Any ideas on how to do this? Comments? …

Member Avatar
Member Avatar
+0 forum 3

Hello, I got my last issue resolved, working great thanks to you guys. I have a wide variety of date formats that I need to parse into this format: MM/DD/YYYY HH:MM:SS (a mysql DATETIME type value).. I have tried: [code]post_date = time.strftime("%Y-%m%d %H:%M:%S", i.issued)[/code] However, this gives me: [code] Traceback (most recent call last): File "./parse.py", line 34, in ? print time.strftime("%Y-%m-%d %H:%M:%S", i.issued) TypeError: argument must be sequence of length 9, not 20 [/code] i.issued is a variable, with this as an (example) value: (2005, 7, 24, 15, 32, 0, 6, 205, 0). I believe this is called a …

Member Avatar
Member Avatar
+0 forum 1

Hello, This is my first python script, so I could use a little bit of help here. :) I'm using the 'Universal Feed Parser' ([url]http://feedparser.org/)[/url], and I have a list of feed URLs in a database which I would like to pull out and go through each of them. I am also using the ADOdb database module, as I am familier with it (in PHP .. however, it is pretty similar ..) Here's what I have so far, the only thing this does is pulls the URLs out of the database, and prints them: [code] #!/usr/bin/env python import MySQLdb import …

Member Avatar
Member Avatar
+0 forum 6

I have just started getting into python and so far it's all been very interesting and the help good to, but now i have ran into a problem. I'm sure it's very easy to solve but i just can't seem to figure it out or find anything on the web. I have made a GUI and i want to make it so that when a button is pressed it will call my client script and run it, But i have no idea how to add this to the button i have. Any help would be fantastic.

Member Avatar
Member Avatar
+0 forum 8

Hi, I'm writing a client program that downloads data from an HTTP server via urllib, like so: [CODE]ufile = urllib.urlopen(urlstring) text = ufile.read() # Do stuff with text[/CODE] Nice and simple. Unfortunately, the server only accepts requests with a session ID embedded inside - and I don't know how to open sessions using urllib. I've tried looking in the forums here and elsewhere online, and all I got was very generic info on cookies - nothing specific to Python, really. Does anyone have experience doing this? Can you send me a link? [B]EDIT:[/B] I found out about cookielib; I'm seeing …

Member Avatar
Member Avatar
+0 forum 3

hi :) I need some help for this script I have -------------------- [CODE]cursor = conn.cursor() cursor.execute("select * from playlist limit 5") result = cursor.fetchall() # iterate through resultset playlist_txt = '' for record in result: mp3id = record[0] mp3_title = record[1] mp3_artist = record[2] playlist_txt += mp3id + mp3_title + mp3_artist #print mp3id , " - ", mp3_title , ' - ', mp3_artist , "<br />" cursor.close() conn.close()[/CODE] ------------------ #and want to print this out of "for record in result:" [CODE]print playlist_txt[/CODE] #but there is an error in [CODE]playlist_txt += mp3id + mp3_title + mp3_artist[/CODE] 10x in advance :)))

Member Avatar
Member Avatar
+0 forum 4

I have been reading through the "python library reference" with no luck finding the module needed to copy a file. Any help would be appreciated.

Member Avatar
Member Avatar
+0 forum 3

I need root privledges to do some stuff in my python script. I am currently using this technique [php] current_user = os.geteuid() if current_user != 0: print "you need to be root to run this script" sys.exit()[/php] this will at least polietly end the script so i am able to log in as root. then start the script as root user. Is it a very involved process to have the script prompt me for my root password and switch users?

Member Avatar
Member Avatar
+0 forum 1

Hello Everyone! My question is simple, where are any half decent tutorials out there? I mean, all of the ones I've tried have only skimmed the surface(print, name = raw_input yah know things like that)- or were way to complicated. I've only been doing this for something like a week

Member Avatar
Member Avatar
+0 forum 2

Hello, I am relatively new with Python and Pygame, however, I am an experienced PHPer, so programming isn't something new to me. My problem is this: I got Python 2.4 installed and Pygame 1.6 for Python 2.4 installed. I know Pygame works because I can make calls to the Pygame modules. My problem is, when I try to open a window through Pygame using [code]screen = pygame.display.set_mode((468, 60))[/code] it opens a window, but then lags, and finally crashes and I have to use the oh-so-lovable Crtl-Alt-Del to kill it. I can't figure this out. If I use Tkinter to open …

Member Avatar
Member Avatar
+0 forum 3

I just want to say that I am very disappointed with Guido van Rossum's latest tutorial. I like to follow along typing in the examples and seeing how they run. I seem to catch on to things better that way. But this tutorial's examples haven't been throughly checked because some of them are just not good. Yes, things are free, and yes I like Python and yes, thanks to Guido for allowing the world to use his work without charge. I will give a couple of examples: Section 4.4 looking for prime numbers. Section 4.7.1 default arguments. I stopped at …

Member Avatar
Member Avatar
+0 forum 3

I have been working on some python code with a friend and for some reason i keep getting this message when i try to run his code, if ar[2]!="client": IndexError: list index out of range I can't see whats wrong and i have never had this message come up before??

Member Avatar
Member Avatar
+0 forum 4

Hello all! Ok here's my problem: I have a Hello World type program that I want to run in steps, and each step is in a new window. When a "next" button is pressed the old window terminates and a new one is created. Now I don't know much about the command = whatever thingy so I was wondering if you could give me some info on it? Oh and I mostly work with .bind so if so can you give me the example in that form? Help appreciated.

Member Avatar
Member Avatar
+0 forum 1

Ok, I've only been working with Python for something like 4 days now and I'm stuck trying to do a certain thing in Tkinter. Now, just to get you into the situation here. I've created a little program that has an entry bar and a go button. It says for you to enter in your name in the entry box and click the go button. What should happen is after the person enters in his/hers name and clicks the go button it should print something like Hello, "name" [U]inside the window as a label or in a separate window as …

Member Avatar
Member Avatar
+0 forum 4

I have heard that it is possible to compile python so that people reciving the script don't need to worry about going to the python website and downloading it. One more thing if you tell me to run something from the prompt I can't for the life of me run a python script from the prompt, I've typed in the path and everything but it comes up with bad command or filename. Help appreciated. Oh and i have no idea on how to get it to compile or create the setup script or what to put at the beggining of …

Member Avatar
Member Avatar
+0 forum 1

python -------------------------------------------------------------- [url]www.python302.tk[/url] [email]python302@gmail.com[/email] -------------------------------------------------------------- ALL FOR YOU SPIDY -------------------------------------------------------------- Disclaimer: This paper is not to be copied, or used on any website without my permission, consequences will occur if it has been found on ANY website. Only time it is allowed to be used on a website is with my permission, and proper credit must be given. -------------------------------------------------------------- 1.the question comes what exactly is python? well my answer is it is a object oriented,scalable, platform independant,quick and easy to use programming language. last but not the least it is a open source software well supported by the G.N.U.i love …

Member Avatar
+1 forum 0

The End.