4,305 Posted Topics

Member Avatar for ArtemisFowl

As of this point in time, the only thing you can do is to use Python26 for the book. PIL sooner or later will appear for Python3. but don't hold your breath. When one third party module like cImage (which i think is just a rewrite of graphics.py with some …

Member Avatar for vegaseat
0
543
Member Avatar for vlady
Member Avatar for Ancient Dragon

An interesting thread. Does she have something to hide in her medical records? They are not disclosed yet!

Member Avatar for johnnybgood
0
450
Member Avatar for Gargen

Which of the 250 major computer languages are you learning? I need some idea so I can compare.

Member Avatar for Orion2k
0
528
Member Avatar for GrimJack

i am sure that any good breathing exercises (fresh air) would to you a lot better. :)

Member Avatar for maceman
0
161
Member Avatar for Pineapplesf

By default sort() sorts by the first item in each sublist ... [code]q = [[8, 9, 7], [1, 2, 3], [5, 4, 3], [4, 5, 6]] q.sort() print q # [[1, 2, 3], [4, 5, 6], [5, 4, 3], [8, 9, 7]] [/code]

Member Avatar for vegaseat
0
13K
Member Avatar for OurNation
Member Avatar for sneekula

Spent most of my day at the local VA hospital visiting friends.

Member Avatar for Biker920
0
86
Member Avatar for Pinchanzee

For starters take a look at: [url]http://www.daniweb.com/forums/thread20774.html[/url] Some online books ... Swaroop C.H. has rewritten his excellent beginning Python tutorial for Python3: [url]http://www.swaroopch.com/notes/Python_en:Table_of_Contents[/url] "Dive Into Python" Mark Pilgrim's Free online book, novice to pro, is updated constantly, and has been rewritten for Python3 (check appendix A for Py2-to-Py3 differences) [url]http://diveintopython3.org/[/url]

Member Avatar for Pinchanzee
0
96
Member Avatar for ic_m

[QUOTE=ic_m;1241656]Need help to code a program which: - validate user input, accept values that a user has entered (ex, a, b, c, d, e) - any other values other than these are to be treated invalid with a message and block it from processing. - Prompt the user to enter …

Member Avatar for baki100
0
185
Member Avatar for jwenting
Member Avatar for G_S

In your code the [COLOR="Red"][B]else[/B][/COLOR] pairs up with the [COLOR="Red"][B]if[/B][/COLOR] statement just before it. If you change that to [COLOR="Red"][B]elif[/B][/COLOR] it pairs up with the [COLOR="Red"][B]if[/B][/COLOR] before that. That's because all the conditional statements have the same indentation level.

Member Avatar for G_S
0
146
Member Avatar for SoulMazer
Member Avatar for vegaseat
0
148
Member Avatar for lewashby

[QUOTE](name, score) = line.split() scores[score] = name Why is the value "name" being placed into the variable [score]? It looks to me like it's just swapping places with name and score.[/QUOTE] Here scores is the name of the dictionary, score is the key and name is the value [B]mydict[key] = …

Member Avatar for vegaseat
0
98
Member Avatar for lewashby

The original code works fine with Python24 through Python31. The parenthesis, as tonyjv pointed out, are optional.

Member Avatar for snippsat
0
159
Member Avatar for wraph

William Gates' claim to the "Programmers Hall of Fame" is DOS, specifically MS-DOS for the the first IBM PC. I think that was written in assembler. It was a great achievement in those early PC days. This comes from a person who used some of the alternative disk operating systems. …

Member Avatar for jwenting
0
635
Member Avatar for pratz

thanks all. i need it ------------------------------- mini parts short sale listings Bullkaka signature spam! Stop it!

Member Avatar for snippsat
0
249
Member Avatar for Elthalion

My recommendation, don't work with an old ditty like module gasp. It is a wrapper for PyGame and doesn't work very well with newer versions of PyGame on Windows. I got it to go this way ... [code]# for Windows and Python26 dowmload and install gasp from: # http://edge.launchpad.net/gasp-core/0.1.x/0.2.0beta1/+download/python-gasp-0.2.0beta1.win32.exe # …

Member Avatar for Elthalion
0
187
Member Avatar for lsmurfl

What form do you want the birthdays in? Most like strings of form [B]mm/dd/yyyy[/B]

Member Avatar for vegaseat
0
108
Member Avatar for vaultdweller123
Member Avatar for keshav magge

[code]# naming a variable str str = "my string" # later calling function str() # will give # TypeError: 'str' object is not callable numeric = str(123) [/code]

Member Avatar for vegaseat
0
1K
Member Avatar for vegaseat

Just spent about an hour removing [B]Antispyware Soft[/B], a small miserable program that comes in on e-mail or certain church sponsored web sites. It deposits a random named executable in your Windows OS (XP through Windows7) and then takes over the registry to a point where you can not run …

0
93
Member Avatar for nezbo
Member Avatar for hittmann
Member Avatar for vegaseat
0
27
Member Avatar for cyon

For the sake of simplicity ... [code]def list_has_duplicate_items( mylist ): return len(mylist) > len(set(mylist)) def get_duplicate_items( mylist ): return [item for item in set(mylist) if mylist.count(item) > 1] mylist = [ 'oranges' , 'apples' , 'oranges' , 'grapes' ] print 'List: ' , mylist print 'Does list have duplicate item(s)? …

Member Avatar for TrustyTony
0
2K
Member Avatar for alexbadboys

I used to do quite a number of automation projects going through the serial port. Alas, I am finding out that just about all the newer machines have done away with the RS-232 serial port. How does the USB port fit in with all of this?

Member Avatar for Alexandra_Os
0
4K
Member Avatar for toadzky

[QUOTE=ultimatebuster;1234283]You cannot distribute Qt software on Windows without a license.[/QUOTE]Really meant for commercial software only.

Member Avatar for vegaseat
0
216
Member Avatar for vello

To go from string [B]"+2x-1y+3x+2"[/B] to string [B]"5x-y+2"[/B] would have to be done by a specialized string parser following rules you set. Quite an interesting problem.

Member Avatar for vello
-3
141
Member Avatar for sarosh

The nice thing about using [B]raise SystemExit[/B] to exit your program is that you don't have to import anything extra.

Member Avatar for vegaseat
0
128
Member Avatar for vegaseat

Starting with version 2.6 Python has introduced a new container called the named tuple. You can use it similar to a class based record structure, but it has the memory efficiency of a tuple.

1
2K
Member Avatar for qqabb

A linear search goes through a sequence of items one item at a time from the start of the sequence until the item is found ... [code]sequence = 'abcdefghijklmnopqrstuvwxyz' search = 'z' for c in sequence: if c == search: print("found search item") break [/code]As you can see, if you …

Member Avatar for TrustyTony
0
1K
Member Avatar for newbrobo

Hmm, maybe designing fashionable clothes for robots could be a new career?

Member Avatar for vegaseat
0
187
Member Avatar for funfullson

Go ahead and test it! If you can't live with the amount of protection given, use C++.

Member Avatar for jcao219
0
265
Member Avatar for GrimJack

There wouldn't be enough space inside any bus to post all the things that are prohibited. It would be much easier to post all the things that are allowed. :)

Member Avatar for Biker920
0
129
Member Avatar for macca21

Since this looks a lot like homework, please show us at least some coding effort on your part!

Member Avatar for vegaseat
0
139
Member Avatar for macca21

I have seen this somewhere else ... [code]# use module pickle to dump and load complete objects # like dictionaries # modified to work with Python2 and Python3 versions import pickle catalog = { 1:["Bread", 1.50, 10 ], 2:["Cheese", 5.00, 5], 3:["Apple", 2.50,12] } # pickle dump the dictionary fh_out …

Member Avatar for vegaseat
0
60
Member Avatar for docesam

Well, your mind seems to be made up, if you dislike Python, there isn't much I will do about it! Python is a tool, just like any other computer language. If you can't figure out any advantages, don't use that tool. Computer languages are tools that allow you to write …

Member Avatar for TrustyTony
-4
329
Member Avatar for prashanth s j

What you are creating is not an array, but an object called a string ... [code]my_array = 'a' for i in range(10): my_array = my_array + 'b' print my_array # abbbbbbbbbb print type(my_array) # <type 'str'> [/code]

Member Avatar for prashanth s j
0
238
Member Avatar for jib

Code Snippets do not have questions associated. They are finished, working code.

Member Avatar for jib
1
4K
Member Avatar for zenith_96

This shows you were to place random.shuffle() ... [code]""" knockknock.txt for testing: comback1,punchline1 comback2,punchline2 comback3,punchline3 comback4,punchline4 """ import random def main(): k = open("knockknock.txt", "r") line_list = k.readlines() print line_list # for testing only random.shuffle(line_list) print line_list # for testing only n = 0 while len(line_list)!=0: line = line_list[n] # …

Member Avatar for zenith_96
0
201
Member Avatar for Steven.T

[QUOTE=Steven.T;1225633]Write a spell checking tool that will identify all misspelled word in a text file using a provided dictionary. The program will accept either one or two command line parameters. 1. The first command line parameter is the name of the text file that will be checked. 2. The optional …

Member Avatar for TrustyTony
0
1K
Member Avatar for camdaddy09

I am glad we brought this all out in the open! I like WaltP's RESPECT rules.

Member Avatar for vegaseat
1
198
Member Avatar for xcristi

[QUOTE]Weird thing is that if I put a GetLabel right after SetLabel I see the new value![/QUOTE] The combination most likely function as a Refresh(). I would just go with the combo since wx.Dialog() does not show a Refresh() method in the manual. You might have discovered a nice little …

Member Avatar for xcristi
1
1K
Member Avatar for haydensewell

Another way you could approach this ... [code]matrix = [[0 for x in range(5)] for y in range(3)] for sublist in matrix: s = str(sublist) s = s.replace('[', '|').replace(']', '|').replace(',', "") print s print '+-'*5 + '+' [/code]

Member Avatar for vegaseat
0
2K
Member Avatar for BestJewSinceJC
Member Avatar for avatar103
0
657
Member Avatar for jephthah
Member Avatar for vegaseat
4
189
Member Avatar for Ancient Dragon
Member Avatar for MJFiggs

[code]# show the system path (aka. PYTHONPATH), a list of directories # that Python by default would look into # item at index 0 would be the working directory import sys print( sys.path ) """possible output --> [ 'D:\\Python26\\Atest26\\aatest26', 'C:\\WINDOWS\\system32\\python26.zip', 'D:\\Python26\\DLLs', 'D:\\Python26\\lib', 'D:\\Python26\\lib\\plat-win', 'D:\\Python26\\lib\\lib-tk', 'D:\\Python26', 'D:\\Python26\\lib\\site-packages', 'D:\\Python26\\lib\\site-packages\\PIL', 'D:\\Python26\\lib\\site-packages\\wx-2.8-msw-unicode' ] """ …

Member Avatar for ultimatebuster
0
165
Member Avatar for Rashakil Fol
Member Avatar for Diamonddrake
1
323
Member Avatar for nsutton

Also [B]if hit=="Y" or "y":[/B] is just plain old wrong! Good luck with the exciting C# language.

Member Avatar for nsutton
1
228

The End.