4,305 Posted Topics

Member Avatar for torholt

The Geek's Lounge may not be the proper forum for this. You can expect questions like: What kind of repair did damage your file?

Member Avatar for vegaseat
0
7
Member Avatar for Stefano Mtangoo

I know that AddSeparator() works with AddSimpleTool(). Why are you using AddLabelTool()?

Member Avatar for Stefano Mtangoo
0
136
Member Avatar for Stefano Mtangoo
Member Avatar for Stefano Mtangoo
0
118
Member Avatar for nunos

You could update to Python 3.1 where '/' is the floatingpoint division and '//' is the integer division. Actually, with Python2 versions, 4./5 would be simpler to type then 4.0/5 or float(4)/5 :)

Member Avatar for nunos
0
186
Member Avatar for Syllabus

If you simply don't want to show the Tkinter window title and border, you can use this ... [code=python]from Tkinter import * root = Tk() #root.wm_attributes('-alpha', 0.0) root.overrideredirect(1) photo = PhotoImage(file="image.gif") w = Label(root, image=photo).pack() root.mainloop() [/code]Now you have to provide a way to exit, like binding a double-click on …

Member Avatar for vegaseat
0
1K
Member Avatar for Missy_poo

As little as I can remember 1 mile is about 1.6 km, so 1 km is 1/1.6 miles.

Member Avatar for Stefano Mtangoo
0
104
Member Avatar for Spartan697
Member Avatar for shadwickman
0
77
Member Avatar for catcit

You can print out all builtin Python 'functions' in sorted order this way ... [code=python] print( '\n'.join(sorted(dir(__builtins__), key=str.lower))) [/code]Avoid using any of those names for your variables, or you will get conflicts.

Member Avatar for vegaseat
0
113
Member Avatar for b_bayaraa_d

This is probably the most common plugin: [url]http://pydev.sourceforge.net/[/url]

Member Avatar for vegaseat
0
86
Member Avatar for fleem
Member Avatar for vegaseat
0
129
Member Avatar for WoBinator

[QUOTE=Bench;295160]Yup, i forgot to clear the state earlier.. The only other alternative to cin.ignore etc.. would be[CODE=CPP]std::cin.clear(); std::cin.sync(); std::cin.get(); [/CODE][/QUOTE] Just a note, cin.sync() is not considered to be very reliable for removing vagabond '\n' characters. No wonder the poor chap through in the C++ towel.

Member Avatar for Zacadx15
0
501
Member Avatar for funfullson

All Python GUI toolkits are usefull, 'better' depends on your application, your version of Python, your OS and your skill level. Tkinter: comes with all versions of Python and all Operating Systems. Based on TCL language. It is the best toolkit for the beginner to experiment with, and has lots …

Member Avatar for funfullson
0
142
Member Avatar for Ancient Dragon

Yes, he was a thriller! [QUOTE]It's close to midnight and something evil's lurking in the dark Under the moonlight, you see a sight that almost stops your heart You try to scream but terror takes the sound before you make it You start to freeze as horror looks you right …

Member Avatar for GrimJack
0
297
Member Avatar for tlaloc58

Python24, Python 25 and Python26 releases each have added a few new functions that Python23 did not have, but the basic functions are all there. Python3 however did change the language syntax somewhat to modernize the language, enough to be a pain. However, there is a conversion utility you can …

Member Avatar for vegaseat
0
102
Member Avatar for bumsfeld

This works with Windows only ... [code=python]# acts like double-clicking the filename in Windows file manager # starts the associated program and loads the file import os # default file path is the current directory os.startfile("test2.htm")[/code]

Member Avatar for you2
0
216
Member Avatar for The Dude
Member Avatar for ithelp
Member Avatar for ayoungpretender
0
104
Member Avatar for pymatio

pymatio, your code would be easier to read if you would stick with the 4 space indentation that every else uses. Yes, you have managed to mix up tabs and spaces according to my editor.

Member Avatar for Clueless86
0
182
Member Avatar for aot

wxPython has a wx.CURSOR_BLANK, but I don't think Tkinter has anything like it. The cursor='draft_small' is about the smallest cursor I have used with Tkinter.

Member Avatar for Fistroman
0
162
Member Avatar for kalyan mohan

For an example of the FileBrowseButton see: [url]http://www.daniweb.com/forums/post930327-114.html[/url]

Member Avatar for kalyan mohan
0
105
Member Avatar for sravan953

You are getting into recursion (can get screwy), a while loop will serve you better ... [code=python]def reduce_digits(s): while True: if int(s) < 10: break p = 0 for i in s: p += int(i) #print i, p # test s = str(p) return p #s = raw_input("Enter a number …

Member Avatar for bumsfeld
0
132
Member Avatar for dinilkarun
Member Avatar for meyer7

Normally you can find _tkinter.pyd in Windows folder C:\Python25\DLLs. See if you have a similar Python26 folder on your Linux machine. Not quite sure what a DLL is called on Linux or if a .pyd file exists for it. Might need to do a file search for _tkinter.*

Member Avatar for woooee
0
147
Member Avatar for Stefano Mtangoo

Module pickle will do it faster and easier. XML format would be used if you want to exchange your data/text with other computer languages. XML looks a lot like HTML, but has more options.

Member Avatar for Stefano Mtangoo
0
87
Member Avatar for foosion

On Windows the version installed last will be the default version. Just in case you double click on a Python script file. Some IDE editors like Editra allow you to quickly select the Python version you want to apply to your code (use the Launch plugin).

Member Avatar for foosion
0
180
Member Avatar for Aiban

To make a short story long, 'quit' will quit the tcl interpreter of Tkinter! Replace 'quit' with 'destroy' to destroy a particular window in a multiwindow program.

Member Avatar for vegaseat
0
277
Member Avatar for abhigyan91

[QUOTE=sravan953;930290]BTW, I am not able to edit my first post in this thread, anyone know why? o.O[/QUOTE]You can only edit within 30 minutes after posting.

Member Avatar for shadwickman
0
143
Member Avatar for Alex!

Here is an example for how to use a Tkinter canvas for a background image ... [code=python]# use Tkinter canvas create_image for background # put some buttons on it for testing try: # for Python2 import Tkinter as tk except ImportError: # for Python3 import tkinter as tk root = …

Member Avatar for vegaseat
0
117
Member Avatar for dezza
Member Avatar for vegaseat

I just read that the Microsoft Windows 7 OS may appear on PCs by October 22 this year. That is seemingly good news for those of us who are sitting on aging XP desktop PCs in the hope of skipping the dreadful Vista OS. The hope is also for the …

Member Avatar for kaninelupus
0
637
Member Avatar for The Dude

Ever wonder how much a suitcase stuffed with hundred Dollar bills would be worth?

Member Avatar for The Dude
0
130
Member Avatar for scru
Member Avatar for ~s.o.s~
1
527
Member Avatar for flipjoebanana

One thing you can do, is to make the password dots less visible from a distance and clear after entry ... [code=python]# testing wxPython's # wx.TextCtrl(parent, id, value, pos, size, style) # for password entry and masking import wx class MyFrame(wx.Frame): def __init__(self, parent, mytitle, mysize): wx.Frame.__init__(self, parent, -1, mytitle, …

Member Avatar for vegaseat
0
154
Member Avatar for The Dude

Ever wondered if you would be presented with a Jello mold of a naked person, which part you would eat first?

Member Avatar for MosaicFuneral
0
97
Member Avatar for Stefano Mtangoo

There is a little trick to this, you have to assign the dialog's entry instance to the parent, see this example: [url]http://www.daniweb.com/forums/showpost.php?p=921519&postcount=113[/url]

Member Avatar for Stefano Mtangoo
0
68
Member Avatar for princessotes

The Python functions xrange() and range() only take integer values. For floating point values you have to roll your own function. I called mine frange() ... [code=python]def frange(start=0, stop=0, step=1.0): """similar to xrange, but handles floating point numbers""" if step <= 0: while start > stop: yield start start += …

Member Avatar for vegaseat
0
138
Member Avatar for Morika

In your first code you are removing all the letters that are in sub (all the 'i' and 's') from the string strng. The challenging part of learning Python is to get to know all the great functions and modules. Actually strings have a function called replace(old, new) that you …

Member Avatar for woooee
0
106
Member Avatar for jayrodau

The obituaries for Tkinter are premature. Tkinter has been spruced up quite a bit with version 8.5. Also, Python3.1 ships with the extented widget set ttk that includes a treeview widget. Ttk comes with 17 widgets, 11 of which already exist in Tkinter, but are improved: Button, Checkbutton, Entry, Frame, …

Member Avatar for vegaseat
0
1K
Member Avatar for scru

You neeed to read "Why We Suck" by Dr. Denis Leary, a feel good guide to staying fat, loud, lazy and stupid.

Member Avatar for ddanbe
0
108
Member Avatar for Davide Davin

This line of code ... def __init__(self, parent, id,content,content,size = wx.DefaultSize): will give an error, since you are passing variable content twice. Also I would replace 'Main.View.Template' with 'Main_View_Template'.

Member Avatar for Davide Davin
0
183
Member Avatar for The Dude

Well, you found another interesting web site! Looks like getting in and out of all those sweaters messes up her hair a little.

Member Avatar for MosaicFuneral
0
53
Member Avatar for Morika

For a sequence with a finite length like you have in str(n), the for loop is ideal. Welcome to DaniWeb! Hope you have fun with Python programming!

Member Avatar for vegaseat
0
91
Member Avatar for Zetlin

Save the first script as myhello.py and dont use string since that is a module in Python ... [code=python]# save this module as myhello.py message = "Hello World!" [/code]Nor write your code to test the module ... [code=python]# module myhello.py was saved in the working folder import myhello def output(message): …

Member Avatar for Zetlin
0
86
Member Avatar for Ene Uran

During the Cold War days the Bulgarians used to have a cyber unit in their military that wrote a lot of virus code.

Member Avatar for MosaicFuneral
0
174
Member Avatar for SpiritGeek

Using tabs for indentation makes your code look so ugly. Can't you just use 4 spaces like most other people? Also, by convention only class names start with a capital letter.

Member Avatar for jlm699
0
2K
Member Avatar for joananon

No need to use global since lists are mutable objects and are passed by reference to a function. Here is an example ... [code=python]def remove_item(list1, list2, item): """lists are passed by reference so items are removed in place""" if item in list1: list1.remove(item) if item in list2: list2.remove(item) q1 = …

Member Avatar for joananon
0
138
Member Avatar for Menster

Let's hope that it'll be a worthy rival to Windows, particularly if it is as secure as planned.

Member Avatar for rishabhv
0
297
Member Avatar for joe82

Actually, the empty lines in your data do not contain any spaces. Change the code a little to reflect this ... [code=python]# your data file read() ... data_str = """\ >9|102396631|genome..... CCACTTTCTCTCCGCGCTGGGTTGAACATGGTACATCAGACTCCCTGAATCTGTCAGATC TCTTGGTTGCTGTTGACAACTAAGACTTCGGAGCCTGGAG_GATTTGTTGAGGGGGAGCA GTTCTGGGTGTCCTCTGCTGTGACTGGGCTCCCGGCCTCTTGATAATGCGCAACAGCTGC GGTAGAACATCTCATTCCCAG >9|102362951|ENSRNOS.... """ # create a list of lines # or get the list directly with …

Member Avatar for joe82
0
12K
Member Avatar for Tony1

A bundle of cash is still the best way to a politician's heart and soul. Don't see how the government would ever want to get rid of it.

Member Avatar for GrimJack
0
322
Member Avatar for ihatehippies

The End.