225 Posted Topics

Member Avatar for acrocephalus

[QUOTE]format This parameter can be used instead of the fmt24hr and displaySeconds parameters, respectively; it provides a shorthand way to specify the time format you want. Accepted values are 'HHMMSS', 'HHMM', '24HHMMSS', and '24HHMM'. If the format is specified, the other two arguments will be ignored. fmt24hr If True, control …

Member Avatar for acrocephalus
-1
197
Member Avatar for funfullson

Well you need [URL="http://pypi.python.org/pypi/pyserial/2.5"]Pyserial[/URL] or [URL="http://pypi.python.org/pypi/USPP%20%28Universal%20Serial%20Port%20Python%29%20Library/1.0"]USPP[/URL] if you connect through the COM port. And from there on, more info is needed. Happy coding

Member Avatar for nazza
0
196
Member Avatar for sphynx_25

It does the work, but it's not regex. [CODE]words = ['cataaaaac', 'poolooo'] for word in words: rep = '' count = 0 i = 0 most = '' great = 0 index = 0 start = 0 for char in word: if char == rep: count += 1 if count …

Member Avatar for sphynx_25
0
2K
Member Avatar for D33wakar

OFF-TOPIC [CODE]nod = lambda(x): len(str(x)) print nod(125125)[/CODE] Cheers and Happy coding

Member Avatar for Beat_Slayer
0
144
Member Avatar for sphynx_25
Member Avatar for JLYK
Member Avatar for Beat_Slayer
0
203
Member Avatar for s0ur

Like this mate. [CODE]import time import subprocess ip = '127.0.0.1' def ping(ip): pinging = subprocess.Popen('ping -w 200 -n 1 ' + ip, stdout=subprocess.PIPE) if "0% loss" in pinging.stdout.read(): return True while 1: if ping(ip): subprocess.Popen('cmd') time.sleep(0.3) else: time.sleep(0.3)[/CODE] Be aware, if you run it like this it will open a …

Member Avatar for Beat_Slayer
0
301
Member Avatar for NewbieXcellence

How about all the clients read from the 'channel' they are associated, and post to the 'channel' socket. The server has only receive message, and associate to the proper channel. Cheers and Happy coding.

Member Avatar for NewbieXcellence
0
170
Member Avatar for pythonbegin

Work it, and post when you get stuck. [CODE]from random import choice first_list = [] second_list = [] for item in open('sampleconnection.txt').readlines(): first, second = item.split('\t') first_list.append(first) second_list.append(second.strip('\n')) for i in range(len(first_list)): choices_list = range(len(first_list) - 1) choices_list.remove(i) print first_list[i], second_list[choice(choices_list)][/CODE] Cheers and Happy coding

Member Avatar for pythonbegin
0
1K
Member Avatar for slingblade

Litle help... [CODE]for item in pl[section]: if item.has_key('dashboard-tile'): try: print '\t'.join((item['tile-data']['file-label'], item['tile-data']['file-data']['_CFURLString'], item['tile-data']['dashboard-tile'], section, plist_path))[/CODE] Cheers and Happy coding

Member Avatar for slingblade
0
161
Member Avatar for acrocephalus

[URL="http://docs.python.org/library/time.html"]Hint[/URL] Cheers and Happy coding

Member Avatar for vegaseat
-1
489
Member Avatar for patton228

Like this? [CODE]for item in fenceLines: print item or for i in range(len(fenceLines)): print fenceLines[i][/CODE] Cheers and Happy coding

Member Avatar for patton228
0
156
Member Avatar for smohrchi

Line 1 of your convert.py says 'on win32'? I guess that's not valid python code, and thats why the import is failing. Cheers and Happy coding

Member Avatar for smohrchi
0
152
Member Avatar for koveras vehcna

Your code is very messy, very distorted, but if you copy your line 18 to line 25 it will work. Anyway I recommend some clean up. Cheers and Happy coding

Member Avatar for koveras vehcna
0
322
Member Avatar for Beat_Slayer

Two litle functions to help on text slice and spliting. The code comments say it all. [CODE]# Slicer takes as arguments a tuple containing the string before, # the string after and the string to truncate. It returns the string # between the two given strings Slicer = lambda((b, a, …

Member Avatar for Beat_Slayer
1
570
Member Avatar for abhi_cvx

[URL="http://www.daniweb.com/forums/thread302912.html"]Similar task[/URL] Try something and we'll help you. Cheers and Happy coding

Member Avatar for Beat_Slayer
0
282
Member Avatar for pyaru

It's pretty to say, but... What types will be the sound files, what you define by instruments(midi, real) and a lot more... Cheers and Happy coding

Member Avatar for Beat_Slayer
0
55
Member Avatar for debuitls

Because dictionaries have hashable values as keys. And so the keys are ordered by their hash. Cheers and Happy coding

Member Avatar for TrustyTony
0
86
Member Avatar for bomko

I don't get it???? Whats the question? You create a picture image object RGB 600 by 600, but you write no data to it. And you do something with a ImageDraw object but I can't see what also. Cheers and Happy coding

Member Avatar for bomko
0
2K
Member Avatar for James0l9l

[CODE]list1 = [] for y in range(50): for x in range(50): list1.append((x, y)) print list1[/CODE] Cheers and Happy coding

Member Avatar for peter_budo
0
177
Member Avatar for pwnmercury

[QUOTE]An if ... elif ... elif ... sequence is a substitute for the switch or case statements found in other languages.[/QUOTE] [URL="http://docs.python.org/tutorial/controlflow.html"]Source[/URL] Cheers and Happy coding

Member Avatar for vegaseat
0
236
Member Avatar for waki

You can catch event with pygame. [URL="http://www.pygame.org/wiki/tut_design"]Here[/URL] Cheers and Happy coding

Member Avatar for Beat_Slayer
0
189
Member Avatar for acrocephalus

[URL="http://www.wxpython.org/docs/api/wx.calendar-module.html"]Hint[/URL] Cheers and Happy coding

Member Avatar for acrocephalus
-1
81
Member Avatar for lewashby

??? A guess... :) [CODE]class foobar(): def __init__(self, foo, bar): # constructor self.foo = foo self.bar = bar[/CODE] Cheers and Happy coding

Member Avatar for vegaseat
0
124
Member Avatar for James0l9l

I would do like this for your example, it shows the 'mean' when you just press enter with no input. [CODE]def getlist(): lst = [] x = None while x != '': x = raw_input('Your number:') if x: lst.append(int(x)) return lst def mean(l): return float(sum(l))/len(l) a = mean(getlist()) print a[/CODE] …

Member Avatar for TrustyTony
0
123
Member Avatar for n.utiu

It depends a lot of the application, and all of that. But maybe a simple http server or json server in a peer to peer configuration should serve the task pretty good. I''ve never tried xmlrpc servers, since I never felt the need to. Cheers and Happy coding

Member Avatar for n.utiu
0
115
Member Avatar for Xzarik

[CODE]relevant_weeks = [['[11', " '05/10/2009'", " '06/10/2009'", " '07/10/2009'", " '08/10/2009'", " '09/10/2009']", ''], ['[10', " '28/09/2009'", " '29/09/2009'", " '30/09/2009'", " '01/10/2009'", " '02/10/2009']", ''], ['[27', " '25/01/2010'", " '26/01/2010'", " '27/01/2010'", " '28/01/2010'", " '29/01/2010']", '']] relevant_days = ['TUES', 'TUES', 'THURS', 'WED', 'THURS', 'MON', 'WED', 'THURS', 'WED', 'TUES', …

Member Avatar for TrustyTony
0
137
Member Avatar for Xzarik

Seems fun but I don't understand. Can you explain? Cheers and Happy coding

Member Avatar for Xzarik
0
115
Member Avatar for personx1212

[URL="http://docs.python.org/library/ssl.html"]SSL wrapper for socket objects[/URL] Cheers and Happy coding

Member Avatar for personx1212
0
73
Member Avatar for funfullson

Maybe [URL="http://www.dreamfabric.com/sms/"]this[/URL] will help you. Cheers and Happy coding

Member Avatar for funfullson
-2
427
Member Avatar for acrocephalus

[CODE]f_in = open('mixorder.csv') fields = [] for line in f_in.readlines(): fields.append([item.strip('\n') for item in line.split(',')]) f_in.close() f_out = open('order.csv', 'w') for i in range(len(fields)): if fields[i][0] != '': f_out.write('ORDRE ' + fields[i][0] + ',,\n') elif fields[i][1] != '': f_out.write('Family ' + fields[i][1] + ',,\n') elif fields[i][2] != '': pre = …

Member Avatar for acrocephalus
0
5K
Member Avatar for Xzarik

Like this mate: [CODE]list1 = ['a', 'b', 'c'] for i in range(len(list1)): open('file%s.txt' % i, 'w').write(list1[i])[/CODE] Cheers and Happy coding

Member Avatar for Xzarik
0
8K
Member Avatar for Xzarik

Hint: [CODE]list1 = [4, 3, 1, 3, 2, 1] list2 = [[0, '0800', 'MON'], [1, '0830', 'MON'], [2, '0900', 'MON'], [3, '0930', 'MON'], [4, '1000', 'MON']] for i in range(len(list1)): for item in list2: if item[0] == list1[i]: print item[/CODE] Cheers and Happy coding

Member Avatar for Xzarik
0
157
Member Avatar for sravan953

You should check [URL="http://www.crummy.com/software/BeautifulSoup/"]Beatiful Soup[/URL], and [URL="http://docs.python.org/library/urllib.html"]urllib[/URL]. Cheers and Happy coding

Member Avatar for ultimatebuster
0
174
Member Avatar for KnifeDarky

The error message you receive helps who is trying to help you. Try to post it next time. But, since your error is easy, here it goes: [CODE]def lvl(): x = random.randint(100,1000) tfile = open("text.txt", 'w') tfile.write(str(x)) input("")[/CODE] Cheers and Happy coding.

Member Avatar for snippsat
0
118
Member Avatar for donnyv

Sorry but with such a question I can only think of [URL="www.google.com"]www.google.com[/URL]. Cheers and Happy coding.

Member Avatar for Beat_Slayer
0
64
Member Avatar for n.utiu

??? Something is wrong here. Can you show code to what you do? You can't receive or send data through a socket if you properly closed it. Cheers and Happy coding

Member Avatar for n.utiu
0
5K
Member Avatar for Stefano Mtangoo
Member Avatar for Beat_Slayer
0
457
Member Avatar for kuchi

One hint. [CODE]import time date = 19980224 print time.strptime(date, '%Y%m%d') date = 19982402 print time.strptime(date, '%Y%m%d')[/CODE] Cheers and Happy coding

Member Avatar for kuchi
0
130
Member Avatar for acejhon
Member Avatar for TrustyTony
-2
285
Member Avatar for rmsagar

Like this? [CODE]f_in = open('ids.txt') for line in f_in.readlines(): print line pos = 0 for run in range(line.count('ID=')): pos = line.index('ID=', pos) + 3 print line[pos:pos + 4][/CODE] Cheers and Happy coding

Member Avatar for rmsagar
0
99
Member Avatar for acrocephalus

The connection is available till you do a db.close() I believe, but I never used MySQL.

Member Avatar for acrocephalus
0
193
Member Avatar for Aneeshia

I,ve found [URL="http://www.cs.cmu.edu/~tmalisie/sword_allocation/ctm.pdf"]this[/URL] for you. Cheers and Happy coding.

Member Avatar for Beat_Slayer
0
59
Member Avatar for fingerpainting

Why not? [CODE]top10 = [ [[u'abcde', u'fghij'], [1]], [[u'abcde', u'fghij'], [2]], [[u'abcde', u'fghij'], [3]], [[u'abcde', u'fghij'], [4]], [[u'abcde', u'fghij'], [5]]] top10 = [[[str(a), str(b)], x] for [a, b], x in top10] for item in top10: print item[/CODE] [CODE]Output: [['abcde', 'fghij'], [1]] [['abcde', 'fghij'], [2]] [['abcde', 'fghij'], [3]] [['abcde', 'fghij'], [4]] …

Member Avatar for fingerpainting
0
254
Member Avatar for acrocephalus

I would like to help, but I'm not understanding now mate. Cheers and Happy coding

Member Avatar for acrocephalus
0
75
Member Avatar for Archenemie

Has nothing to do with putting 'self.' on front of everything, but at least being coinsistent on the variables. Look here: [CODE]def onAction(self, event): disc_value = self.discountinput.GetValue().strip() if all(x in "0123456789.+-" for x in disc_value): value = round(float(disc_value), 2) else: discountinput.ChangeValue("number only") [/CODE] Is it discountinput, or the discountinput from …

Member Avatar for Archenemie
0
101
Member Avatar for nezbo

I guess your setup.py is messed up. But as I can't see it, it's only a guess.

Member Avatar for snippsat
0
124
Member Avatar for Tech B

I think you may use the diff data with the use 'load' to alter the pixels like a array of pixels. Nice project. Cheers and Happy coding

Member Avatar for Beat_Slayer
0
123
Member Avatar for acrocephalus

Like this mate? [CODE]def DelUserDlg(self, event): dlg = wx.MessageDialog(None, 'Are you sure you want to delete your user?', 'Question', wx.OK | wx.CANCEL | wx.NO_DEFAULT | wx.ICON_QUESTION) result = dlg.ShowModal() dlg.destroy() if result == wx.ID_OK: self.delete_user_function()[/CODE] Cheers and Happy coding

Member Avatar for Beat_Slayer
0
90
Member Avatar for PythonNewbie2
Member Avatar for D33wakar
0
3K

The End.