851 Posted Topics

Member Avatar for Tcll
Member Avatar for james.lu.75491856
Member Avatar for HiHe

In my experience this error is not the fault of Python 3.3.0 but the fault of your IDE. I have run into a similar problem (prime number function) with the EDITRA IDE, any other IDE like IDLE, PyScripter or ConTEXT does not have a problem.

Member Avatar for vegaseat
0
338
Member Avatar for Lardmeister

When I run: [code]dec = 255 print hex(dec) [/code]I get 0xff, but I like to get just 'ff'

Member Avatar for bumsfeld
0
5K
Member Avatar for wolf_one

You need to let folks know more about the module Pdf and where you got it from. Google doesn't bring it up.

Member Avatar for chriswelborn
-1
273
Member Avatar for rude_god
Member Avatar for Lardmeister
0
4K
Member Avatar for RockJake28

Another option, using Python27 or higher: names = ["Jake", "Ben", "Rob"] surnames = ["Cowton", "Fielding", "Spenceley Jones"] for ix, first in enumerate(names): print("{} {}".format(first, surnames[ix])) ''' output >>> Jake Cowton Ben Fielding Rob Spenceley Jones ''' Using zip() is more elegant and takes care of lists with different length.

Member Avatar for Lardmeister
0
328
Member Avatar for Lardmeister

This code shows how to use a minimum Windows Gui program to display the results of a bubble sort of an integer array.

Member Avatar for kplcjl
0
1K
Member Avatar for entropic3105

Layout manager grid() will give the same problem that pack() will. Use grid() after you assigned the entry object to a variable name or it will be **None**. Do not use: `enter1 = tk.Entry(root, bg='yellow').grid()` but: enter1 = tk.Entry(root, bg='yellow') `enter1.grid()`

Member Avatar for bumsfeld
0
317
Member Avatar for rwe0
Member Avatar for vegaseat
0
847
Member Avatar for Subomi

You can follow the progress with a test-print: a = [10, 5, 20, 7, 2] print(a) print('-'*44) # start with an empty list b = [] for i in range(len(a)): # take the minimum value of list a and append it to list b b.append(min(a)) # take the value you …

Member Avatar for vegaseat
0
294
Member Avatar for bogc
Member Avatar for tony75

I would keep the namespace alive for re.split() since Python has a build-in split()

Member Avatar for tony75
0
199
Member Avatar for krystosan

Why should the newlist get updated? It's now a totally different object.

Member Avatar for Lardmeister
0
210
Member Avatar for dirtydit27

Interesting homework, list() and list-comprehension with step=-1 and slicing [ix:] will get you there easily.

Member Avatar for Lucaci Andrew
0
297
Member Avatar for ytq_

Notice that the second tuple is a tuple and has a trailing comma, so lst = [('Meat', 'Milk'), ('Cake - Cookie'**,**), ('Apple', 'Orange')]

Member Avatar for Lucaci Andrew
0
9K
Member Avatar for kindergeek
Member Avatar for JesW9
Member Avatar for welshly_2010

Just a sample: ''' tk_LabelFrame_grid_layout1.py grid layout of frames ''' try: # Python2 import Tkinter as tk except ImportError: # Python3 import tkinter as tk root = tk.Tk() root.geometry("320x400") frame1 = tk.LabelFrame(root, text="frame1", width=300, height=130, bd=5) frame2 = tk.LabelFrame(root, text="frame2", width=150, height=130, bd=5) frame3 = tk.LabelFrame(root, text="frame3", width=140, height=100, bd=5) …

Member Avatar for vegaseat
0
7K
Member Avatar for keitaurin

Gribouillis' second method would be my chioce: s = "hello from outer space" print('_'.join(s.split())) ''' hello_from_outer_space '''

Member Avatar for Lardmeister
0
185
Member Avatar for Lardmeister

Anybody out there that used Python on an Android system? Something like the subset on http://pygame.renpy.org/

Member Avatar for M.S.
0
220
Member Avatar for johans22

There isn't much room to the left, but this will work: from pylab import * axes([0.1, 0.1, 0.71, 0.8]) plot([0,1], [0,1], 'r-', label="line 1") plot([0,1], [1,0.5], 'b-', label="line 2") # legend(loc=(x, y)) legend(loc=(-0.22, 0.45)) title("legend outside the plot area") show() You can also use module threading to keep your program …

Member Avatar for Lardmeister
0
141
Member Avatar for clouds_n_things

As long as you can make the program function the way you want. You learn a lot more that way.

Member Avatar for clouds_n_things
0
177
Member Avatar for The Dude

Posted in the window of a secondhand shop: [QUOTE]We exchange everything - bicycles, washing machies, toys, tools etc. Why not bring your wife along and pick up a wonderful bargain.[/QUOTE]

Member Avatar for Ene Uran
9
4K
Member Avatar for <M/>
Member Avatar for Lucaci Andrew
0
418
Member Avatar for vegaseat
Member Avatar for diafol

No lady has ever been offended when I held the door open for her. However, I have never carried one across a mud puddle.

Member Avatar for Reverend Jim
2
1K
Member Avatar for donkatsu
Member Avatar for longtomjr

It should be possible, but would anybody trust the program after a while? I can see a dictionary with lambda functions, that can be pickled to save it.

Member Avatar for ZZucker
0
216
Member Avatar for Lardmeister

In a blind taste test, judges compared the flavor, consistency, and appearance of ten types of canned beer commonly available in the US. Listed from highest to lowest score achieved, they are: Coors Light, Amstel Light, Bud Light, Natural Light, Tecate, Heineken, Miller Lite, Pabst Blue Ribbon, Miller, Budweiser. Source: …

Member Avatar for vegaseat
0
192
Member Avatar for <M/>
Member Avatar for m_ishwar

You are calling for the calculation before there are any values for f1 and f2. Also self.ord_lbl should not be created everytime you do the calculation. Study this updated code: #Calculating coefficients of a digital filter #Ishwar 03-02-2013 from Tkinter import * pi=3.1416 #create root window class Application(Frame): """A GUI …

Member Avatar for m_ishwar
0
196
Member Avatar for <M/>

I keep switching back and forth between my IPad and my Toshiba Notebook. Now there are smudges on my notebook (does not have a touch screen).

Member Avatar for Ancient Dragon
0
79
Member Avatar for nivert

You should really use a list of entry boxes. Something like this: ''' tk_entry_loop2.py exploring Tkinter multiple labeled entry widgets and using a for loop to create the widgets ''' from functools import partial try: # Python2 import Tkinter as tk except ImportError: # Python3 import tkinter as tk class …

Member Avatar for Lardmeister
0
10K
Member Avatar for jinjin05
Member Avatar for adelaalan
Member Avatar for BigPaw

Find the latest release at: http://sourceforge.net/projects/numpy/files/NumPy/1.7.0rc1/

Member Avatar for Lardmeister
0
699
Member Avatar for mccrimmonmd
Member Avatar for RockJake28
Member Avatar for sudipta.mml
Member Avatar for nitin1

Read on DaniWeb: "Oh my giddy aunt, computer language is more baffling than bloomin French!!"

Member Avatar for <M/>
0
204
Member Avatar for vegaseat

The above snippet was a little dated so I modified it to run on Python27 and Python32: # experimenting with Python's list # tested with Python23 vegaseat 21feb2005 # modified via 2to3.py utility to work with Python3 # case insensitive sort has been updated # import module os for method …

Member Avatar for vegaseat
3
414
Member Avatar for ndeniche
Member Avatar for ricepicker417

Hint, your matrix will be a list of 3 sublists, each sublist has 4 elements. matrix34 = [ [2.5, 3.0, 4.0, 1.5], [1.5, 4.0, 2.0, 7.5], [3.5, 1.0, 1.0, 2.5] ] Each sublist forms a row and each column has matching index number elements from each sublist. The index is …

Member Avatar for vegaseat
0
2K
Member Avatar for Frensi

What version of PyGame are you using? I tried the changes and they work with PyGame version 1.9.2 You can black out the old screen with screen.fill((0,0,0))

Member Avatar for Lardmeister
0
237
Member Avatar for Echo89
Member Avatar for shanew21

Wow snippsat, what does sum() do here? I thought it would just add up numbers in a list.

Member Avatar for snippsat
0
195
Member Avatar for Lardmeister

The other evening I was visiting my great grandpapa in the old folks home. The TV was running, and we both got captivated by a program on the History channel. It talked about the Mayan calendar and that it abruptly ends in 2012. The winter solstice to be exact. That …

Member Avatar for sneekula
2
2K
Member Avatar for krystosan

If you don't put a space around the equal signs, code is hard to read. QMainWindows has its own layout management, read up on it!

Member Avatar for vegaseat
0
201
Member Avatar for heavy.is.happy
Member Avatar for Lardmeister
-1
2K

The End.