904 Posted Topics
Re: [B][COLOR="Red"]If you know a good project, please post it here. If you have questions, start your own thread and don't clutter the sticky.[/COLOR][/B] | |
Re: Please use code tags with your code to preserve the indentations. Otherwise the code is very difficult to read and not too many folks will help. [noparse][code][/noparse] your Python code here [noparse][/code][/noparse] | |
Re: Try to write your code files and run them from the IDE that comes with the Python installation (called IDLE). The IDE will connect the working directory (where your code file is located) with Python.exe See [url]http://www.daniweb.com/forums/thread20774.html[/url] | |
Re: Something like this? [code]# plot of log line from tkinter import * import math def particleCount(decay, p0, time): p = (p0*math.e)**(-(decay*time)) return (p) # define root window root = Tk() root.title("Radioactive Decay Graph") # create frame to put control buttons onto frame = Frame(root, bg='grey', width=400, height=40) frame.pack(fill='x') button1 = … | |
Re: Use matplot from: [url]http://sourceforge.net/projects/matplotlib/files/matplotlib/[/url] You can modify the example from: [url]http://matplotlib.sourceforge.net/examples/api/barchart_demo.html[/url] | |
Re: Polymorphism --- Behavior of an "object" is determined at run-time and depends on what kind/type of object it is: [code] # for instance x * y x = 2; y = 3; print x * y # 6 # but ... x = 'A'; y = 3; print x * … | |
Re: Which version of Windows are you using? PyQT 4.8 seems to work better with Windows7 than Windows XP | |
Re: You can also do string slicing: [code]s = 'hello' print(s[:1]) # h # more print(s[:2]) # he print(s[:4]) # hell [/code] | |
Re: Lardmeister: very smart, very young Ancient Dragon: very smart, very old | |
Re: You can design rather simple calculator using the Python function eval(): [code]# simple calculator using Python function eval() # improvements: # safeguard eval(), error check math expression # loop for more calculations and so on # # importing math functions allows you to enter sin(1.6), pi etc. from math import … | |
| |
Re: [LIST] [*]Politics Geek [*]Hate-Tatoos Geek [*]Food Geek [/LIST] | |
Re: Cheney was a professional draft dodger. [url]http://en.wikipedia.org/wiki/Dick_Cheney[/url] Bush's dad got GW into the Texas National Guard Airforce. I understand he didn't even show up for the required physicals. However, he did fly around in the US. | |
Re: Thanks G-do for informing us over the interesting medical work you are doing! Orange sounds like Python based data mining module, things that should be explored. Slovenia is just like Austria, very nice with much history and great people. | |
Re: I just love "Frazier", particularly Eddie the dog, Daphne Moon and Niles. | |
Re: What happens if you run this test code: [code=python]#!/usr/bin/env python # example frame.py # http://www.pygtk.org/pygtk2tutorial/sec-Frames.html import pygtk pygtk.require('2.0') import gtk class FrameExample: def __init__(self): # create new window window = gtk.Window(gtk.WINDOW_TOPLEVEL) window.set_title("Frame Example") # connect "destroy" event to signal handler window.connect("destroy", lambda w: gtk.main_quit()) window.set_size_request(300, 300) # set border width … | |
Re: I always learn that the use of global variables is to be discouraged. Is this the only way to copy static variable behaviour in Python? | |
Re: Now I see, you want to avoid flood of email from DaniWeb. You can: 1 Follow jlm699 advice 2 Try your Python skills and write small program to UNsubscribe you. :) | |
Re: There is Boa Constructor (similar to Delphi) that uses wxPython as the GUI toolkit (you need wxPython isstalled first), free download from: [url]http://downloads.sourceforge.net/boa-constructor/boa-constructor-0.4.4.win32.exe[/url] There is also wxGlade, just frame builder/designer, also using wxPython: [url]http://wxglade.sourceforge.net/[/url] | |
Re: Let's hope the file _cpyHook.pyd was compiled with the proper MS C version to match the Python2.6 exe file. | |
Re: Thank you stoned, nehe.gamedev.net seems to be a great site! | |
Re: Interesting code. Corrected a few errors, now it works. However fact(14) is less then fact(13). | |
Re: [QUOTE]Dear Dad, $chool i$ really great. I am making lot$ of friend$ and $tudying very hard. With all my $tuff, I $imply can`t think of anything I need. $o if you would like, you can ju$t $end me a card, a$ I would love to hear from you. Love, Your … | |
Re: Check remove_tree( directory[verbose=0, dry_run=0]) in module distutils.dir_util | |
Re: I am using SPE, it's okay, it incorporates wxGlade (GUI builder) and the excellent WinPdb (debugger), but it does not have some features like code completion. I use mostly PyScripter, it is written with Delphi, and has the features I want. It's a standalone .exe file that works on Windows. … | |
Re: The Open Graphics Library (OGL) is now well integrated with wxPython, but to go from there to something that works like VPython you need lots of work: [code=python]import wx import wx.lib.ogl as ogl class MyFrame(wx.Frame): def __init__(self): wx.Frame.__init__( self, None, wx.ID_ANY, title="explore wx.lib.ogl", size=(400,300)) canvas = ogl.ShapeCanvas(self) canvas.SetBackgroundColour("yellow") diagram = … | |
Re: [B]I make mistakes faster than humans![/B] | |
Re: As performance is concerned, the file read from disk will be the slowest part by far! | |
![]() | Re: If you are curious, also check this out: [url]http://www.daniweb.com/code/snippet216539.html[/url] |
Re: Could be different level of XP upgrade. Early version of Window XP quite buggy! | |
Re: Bush is poor excuse for President, but yet 20% of voters still support him. Probably the same 20% that will support Sara Palin, fraud or not. No sense to argue any further. | |
Re: The only example I could find was this one ... [code]''' Python31 includes the Tkinter Tile extension Ttk. Ttk comes with 17 widgets, 11 of which already exist in Tkinter: Button, Checkbutton, Entry, Frame, Label, LabelFrame, Menubutton, PanedWindow, Radiobutton, Scale and Scrollbar The 6 new widget classes are: Combobox, Notebook, … | |
Re: You can use the class instance as key: [code]class RedKey(pygame.sprite.Sprite): image = None count = 0 def __init__(self, location): pygame.sprite.Sprite.__init__(self) if self.image is None: self.image = pygame.image.load("red_key.png").convert_alpha() if self.count > 0: self.rect = self.image.get_rect() self.rect.topleft = location # more of your code here ... location = ... # pick your … | |
Re: Can you show some code you have written by now? | |
| |
Re: Here I thought that cow tipping was stepping on a cow's output and tipping in the process. | |
Re: [QUOTE=Dave Sinkula;532558][url=http://www.redstate.com/files/obama-che.jpg]Obama campaign HQ in Texas[/url][/QUOTE]This Fox News fake has Karl written all over it. He is working for them now. I guess Obama should have had this picture on the wall: | |
Re: Need gadget that makes the sun shine at night when we would need the light. | |
Re: Pretty wild coding with a little bit of Ruby thrown in! Here is just one small hint using actual Python code: [code]def get_vowels(word): number_vowels = 0 for c in word: if c in 'aeiouy': number_vowels += 1 return number_vowels def get_consonants(word): number_consonants = 0 for c in word: if c … | |
Re: Very romantic find! Only the Dude can come up with great stuff like that! | |
Re: In Python3 input() will give you string. You can use eval(input()) to get numbers, but I would make sure that the string you are using with eval() does not contain any nasty commands. | |
Re: [QUOTE=ioiinc;1198251]I would like to know if anyone knows the date that asselin.com was aquired by Hover. Also, who started asselin.com and where would I go to find out this information. Thanks, Jerry W. IOI, Inc.[/QUOTE]Are you looking for work? | |
Re: At least your posts contain substance. Got this error when I posted the above: Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 4864 bytes) in /home/daniweb/httpdocs/forums/includes/class_bbcode.php(172) : eval()'d code on line 66 | |
Re: If you have a Windows machine and Python26, simply download and install: PIL-1.1.7.win32-py2.6.exe | |
| |
Re: Here you go: [code]# tested with Python 3.1.1 import fractions a = 10 b = 25 cd = fractions.gcd(a, b) sf = "the greatest common divisor of the integers %d and %d is %d" print( sf % (a, b, cd) ) """my result the greatest common divisor of the integers … | |
Re: So, what is the effort on your part? See: [url]http://www.daniweb.com/forums/announcement114-2.html[/url] |
The End.