- Strength to Increase Rep
- +7
- Strength to Decrease Rep
- -1
- Upvotes Received
- 11
- Posts with Upvotes
- 7
- Upvoting Members
- 6
- Downvotes Received
- 2
- Posts with Downvotes
- 2
- Downvoting Members
- 2
Hey, Just a simple question really, i was looking through the documentation for python and i couldn't find anything that did basic cd drive things, like ejecting it and stuff. The one module i did find 'cd' was only compatible on IRIX systems. After failing miserably on google i was … | |
Re: I program for a hobby, not a job (yet) so i have a severe hunger for ideas, this thread is great and i would like to contribute, Here are some ideas that might give someone in my situation something to do: This is an extract from a song by pink … | |
Re: I personally always use the root.destroy() method, it seems to work best and I've never had any problems with it. | |
Re: what do you mean when you ask how to make the program show the paths to the selected folder and file. Do you want to show the file's contents, show an explorer window of the file's location or some sort of tree view of the file? | |
Re: [url]http://bembry.org/technology/python/index.php[/url] Has a whole quick tutorial and it has notes on all the main topics it covers, so you can read it, or use it as a reference, i found the Tkinter section wickedly useful as a starter into gui stuff, it also has some exercises. | |
Re: try GUI2exe, it's a gui wrapper for py2exe. [url]http://xoomer.alice.it/infinity77/main/GUI2Exe.html[/url] | |
Re: Yea but Micko has a point. it does suck when you want to take a simple short and sweet program you made with python to school or an internet cafe or any other place where you are not allowed to install stuff, i mean py2exe is good but whenever i … | |
Re: I'm not sure if I'm reading your question correctly, but if you want to open a file that's in the SAME place as your .py script that opens the file, you don't need to set any form of path name. You just type in the name of the file on … | |
Hi, all you daniwebber's!!! Simple (ish) question, AI seems to be a really cool subject, the one problem for me is that i havn't a clue at all what it is and how it works (more to the point, how i could learn to implement it) So i'm just wondering, … | |
Hi, I was wondering how someone would go about making a scrolling ticker or marquee using Tkinter in such a way that allows you to easily add on text and remove.. kinda like a news scroller on the bottom of the tv? thanks all a1eio | |
Re: school rules concerning computers suck. I have never met a schoo technician who is GOOD at his/her job, They always impose ridiculous restrictions for example at my school you can't even check the time on the windows startbar?? wtf?? In my opinion it provokes students to "mess" with the system … | |
For more information on threading read this [B]excellent[/B] 4 page tutorial: [URL="http://www.devshed.com/c/a/Python/Basic-Threading-in-Python/"]http://www.devshed.com/c/a/Python/Basic-Threading-in-Python/[/URL] | |
Re: don't hijack eggowaffles thread ramakrishnakota, if you need help and it's not related to this guy start a new thread | |
i've made a little animation using python and the pygame module, I'm just wondering if it's possible to turn that into a screensaver? is there a format i have to save it to? If anyone knows i would be grateful for the solution thanks, a1eio | |
Re: [code=python] encode = lambda txt: ".".join([str(ord(letter)-96) for letter in txt if ord(letter) in range(97,123)]) decode = lambda txt: "".join([chr(int(char)+96) for char in txt.split(".") if int(char) in range(1, 27)]) [/code] Output >>> [code] >>> encode('this is a message!!!') # anything not lowercase a-z gets silently ignored '20.8.9.19.9.19.1.13.5.19.19.1.7.5' >>> decode('20.8.9.19.9.19.1.13.5.19.19.1.7.5') 'thisisamessage' # … | |
Re: Google have this thing called the Google App Engine. [quote] Google App Engine lets you run your web applications on Google's infrastructure. ... Google App Engine applications are implemented using the Python programming language. The runtime environment includes the full Python language and most of the Python standard library. [/quote] … | |
Re: when you create a socket, you need to bind it with a port, address so other sockets have something to connect to. [code=python] sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.bind((address, port)) [/code] | |
Re: Hmm.. Well strangely enough it works on my machine (XP) From idle and from cmd. Not sure what the problem is, but if you need to get the address of a messege sender then just do that in the thread (if it's sockets it will be safe) | |
Re: python has a keyword function [icode]in[/icode] that would be useful in your example. [code=python] if password in pass_list1: # do something [/code] | |
Re: can you post the traceback? and what module's are you using? | |
Re: there must be something else going on. When you make a copy of a list [icode]list2 = list1[:][/icode] it fills list2 with list1's values, but when you change either list1 or list2, the change isn't mirrored so list1 would stay the same if list2 was changed. Are you sure your … | |
Re: You should definitely use tkinters .after() function, it enters a local event loop which means it doesn't block your program. [code=python] def blink(self): if not self.stop: # check self.stop is false before proceeding print 'looping',self.stop self.label.configure(bg=choice(COLORS)) self.label.update_idletasks() self.after(100, self.blink) # after 100 ms, call function self.blink [/code] choice is a … | |
Re: Well you could just use a Thread object to do the counting for you and then in your main program everytime the user enters a key, you just call a function of the Thread object counting that returns it's current value. The example below might help. [code=python] # counterTest.py, a1eio … | |
Re: [code=python] n = float(2) m = float(3) print n/m [/code] Or [code] n = 2.0 m = 3.0 print n/m [/code] Hope that helps. | |
Re: well as far as i can see, whatever resides within [icode]self[filename][/icode] is clearly not a valid filepath. There was a sort of hint to what it might contain in the second error. [quote] [IOError] of [Errno 36] File name too long: 'ProjCat,RefNum,ProjTitle,MemberName,ProjDeadline,ProjGrade\nI,0001,"Medical Research in XXX Field,2007","Gary,Susan",20.05.07,80\nR,0023,Grid Computing in today era,"Henry … | |
Re: [code=python] def function(*args): print type(args) print args function('arg1', 'arg2', 'arg3') [/code] output [code] <type 'tuple'> ('arg1', 'arg2', 'arg3') [/code] If you need a list: [icode]args = list(args)[/icode] | |
Re: hmm.. what module is this 'call' function from? because it's not a builtin / keyword function | |
Re: [code=python] >>> string = "A simple example string." >>> if 'example' in string: print 'the word '%s' is in: "%s"' % ('example', string) the word 'example' is in: "A simple example string." >>> [/code] | |
Re: Well if your running your tkinter gui by calling: root.mainloop() or something similiar then you should change that to: [code=python] while 1: root.update() #repeat code here [/code] You do everything as normal but then when you get to the displaying part, you enter a loop which updates the gui and … | |
Re: [code=python] >>> exec("print 2") 2 >>> exec("print 2+2") 4 >>> exec("vars = (var1, var2, var3, var4) = 'a', (1,'2',3.0), 44, 0.7\nfor v in vars:\n print v, '=', type(v)") a = <type 'str'> (1, '2', 3.0) = <type 'tuple'> 44 = <type 'int'> 0.7 = <type 'float'> [/code] |