904 Posted Topics
Re: Do yous have a sample of your code? What have yous tried? | |
Re: Windows adds '\n\r' combo to the input() and Python 3.2 only removed the '\n', retaining the '\r' character. This bothersome bug is fixed in Python 3.2.1 | |
Re: Judging from the many folks that buy organic food, composting has become rather important. | |
Re: Something like this should work: [code]# check for password entry, close application if not correct import wx class MyClass(wx.Frame): def __init__(self, parent=None, id=-1): wx.Frame.__init__(self, parent, id, 'Password Program', size=(300,300)) panel = wx.Panel(self) box = wx.TextEntryDialog(None, 'Please type your password:','Password') if box.ShowModal() == wx.ID_OK: answer = box.GetValue() # check password, you … | |
Re: [code]s = 'abcdefg' print(s[-2:]) print(s[:-2]) print(s[::-2]) [/code] | |
Re: Looks like you are really lacking the fundamentals of Python. | |
Re: I would recommend Python 2.7 for you to learn. It does have elements of Python 3 in it as options. | |
Re: I think I remember you. | |
Re: Sure, God talked out of a burning bush to the writers of the Bible. They had His guidance. ![]() | |
Re: Sports car is something you drive, it doesn't drive you like most of the old US heavy clunkers did. | |
Re: Theme: Power of the Office AUSTIN, TX (Dec. 12, 1999) - Attorneys for Texas Governor George W. Bush filed suit in federal court today, seeking to prevent Santa Claus from making his list then checking it twice. The complaint seeks an immediate injunction against the beloved Christmas icon, asking the … | |
Re: Road Runner vs Wile E. Coyote [url]http://www.youtube.com/watch?v=hz65AOjabtM[/url] | |
Re: Could you add some comments to your code and tell us what you are doing? | |
Re: Hint ... [code]str_list = ['1','2.4','-5.3','7'] # use list comprehension num_list = [float(item) for item in str_list] print(num_list) # [1.0, 2.4, -5.3, 7.0] [/code] | |
Re: Interesting project! I am working myself though the code. I have never written anyhing like that. | |
Re: [code]# test PySide widgets # get widget's size from PySide.QtCore import * from PySide.QtGui import * app = QApplication([]) # ----- start your widget test code ---- label = 'x'*20 button = QPushButton(label) width = button.sizeHint().width() height = button.sizeHint().height() button.show() print("button width=%d height=%d (in pixels)" % (width, height)) # ---- … | |
Re: This might help: [url]http://download.oracle.com/javase/tutorial/uiswing/TOC.html[/url] | |
Re: They sold hair dye that caused cancer, die from dye, ironic! | |
Re: I think woooee's approach is clearer. The extra close() may be too easy to miss. | |
Re: Show us one code example you have tried. For typical class inheritance see: [url]http://www.daniweb.com/software-development/python/threads/20774/273770#post273770[/url] | |
Re: [code]# the Tkinter filedialog for saving file # tkfd.asksaveasfile(**options) returns file handle to save to try: # Python2 import Tkinter as tk import tkFileDialog as tkfd except ImportError: # Python3 import tkinter as tk import tkinter.filedialog as tkfd mask = [ ("Text files","*.txt"), ("Python files","*.py *.pyw"), ("All files","*.*")] # if … | |
Re: Here is a typical example that might work for you: [code]# using Tkinter's Optionmenu() as a combobox # allows one item to be selected # use trace() and globalgetvar(name) to show selected choice try: # Python2 import Tkinter as tk except ImportError: # Python3 import tkinter as tk def show_choice(name, … | |
Re: [B]Tomorrow[/B] is the [B]busiest[/B] day of the week | |
Re: You can expand on that: [code]# safe numeric input function # all() needs Python25 or higher def input_num(prompt="Enter number: "): """ prompt the user for numeric input prompt again if the input is not numeric return integer or float """ while True: # coded for Python3, Python2 uses raw_input() # … | |
Re: Wit this: [code]import math print(math.cos((2*math.pi)/3)) # -0.5 print(0.5 + math.cos((2*math.pi)/3)) # 2.22044604925e-16 print(-0.5 + math.cos((2*math.pi)/3)) # -1.0 x = math.cos((2*math.pi)/3) print(x) # -0.5 print([x]) # [-0.4999999999999998] print([-0.5 + x]) # [-0.9999999999999998] [/code]Strange? | |
Re: A extraordinarily strong solar wind could strip the Earth's atmosphere, this way only life forms that don't use oxygen will survive. | |
This Python snippet shows you how to take typical beginner's example of prime number function and work on improving its speed. The decorator function for timing is ideal tool to follow your progress you make. The improvements are commented and you are encouraged to make further improvements. Python is fun! | |
Re: I am glad that our sun is as small at it is or it would have burned out long ago! In the universe small is okay! After all, the singularity that was at the origin of the big bang was so small it couldn't be measured. | |
Re: Face it, meat resources are dwindling with the ever increasing population. | |
Re: Men are simple things. They can survive a whole weekend with only three things: beer, boxer shorts and batteries for the remote control. Courtesy of Diana Jordan | |
| |
Re: Not much damage done compared to world leaders that don't know anything about the world. | |
Re: Here is one short example how this sort of thing might be done: [code]# copy files with given file extensions from source to destination # shutil.copy2() retains the last access time and modification time # use shutil.move(src, dst) to move the file import os import shutil # assume you have … | |
Re: Also check: [url]http://www.lammertbies.nl/comm/cable/parallel.html[/url] | |
Re: You could add screen as one more argument to function question(q, a, b, c, d, screen). | |
The 45th annual edition of the Super Bowl in American football will be played on Sunday February 6, 2011, at the Cowboys Stadium in Arlington, Texas. It will pit the AFC champion Pittsburgh Steelers against the NFC champion Green Bay Packers to decide the NFL champion for the 2010 season. … ![]() | |
Re: see [url]http://adorio-research.org/wordpress/?p=6539[/url] | |
Re: Make sure all your () match. | |
Re: Pythia, commonly known as the Oracle of Delphi, was the priestess at the Temple of Apollo at Delphi. Her site was on the slopes of Mount Parnassus in Greece. | |
Re: It is my understanding the xpath is more for XML document searches. | |
Re: [QUOTE=Ancient Dragon;1460721]And many new ones have cell phones pre-installed and ready to go any time day or night.[/QUOTE]Are you talking about wife or girlfriend? | |
Just curious how you got started. For me it was science class that used Python as the main tool. | |
Re: I don't like l as variable name (looks too much like number one), so I changed it a little: [code]import os import fnmatch for fn in os.listdir("C:/Bilder"): print fn # test if fnmatch.fnmatch(fn, 'IMG*'): fn = fn.replace(fn, "HH") print fn """my result --> IMG100_0015.jpg HH """ [/code] | |
| |
Re: Here is typical example of the PyQt QTabWidget() tested with Python27 and PyQT4.8.2 [code]# explore the PyQt QTabWidget() from PyQt4.QtCore import * from PyQt4.QtGui import * class MainWindow(QWidget): def __init__(self): QWidget.__init__(self) # setGeometry(x_pos, y_pos, width, height) self.setGeometry(250, 150, 400, 300) self.setWindowTitle("explore QTabWidget()") tab_widget = QTabWidget() tab1 = QWidget() tab2 = … | |
Re: It is the Earth's magnetic field that protects its atmosphere from being blown away by solar winds. However the magnetic field has declined by 6% in the last 100 years. | |
Re: Another way is to use the event: [code]# Tkinter, show the button that has been clicked # using the bind event import Tkinter as tk def click(event): """ event.widget.cget("text") gets the label of the button clicked """ s = "clicked: " + event.widget.cget("text") root.title(s) root = tk.Tk() root.geometry("300x50+30+30") b1 = … |
The End.