14,951 Topics

Member Avatar for
Member Avatar for Robbert

Hi, I need some help on how I could add the following pie chart to a wxPanel. I just can't seem to get it to work without the pylab interface. [CODE]import wx from pylab import * class MyFrame(wx.Frame): """ Pie Chart Frame """ def __init__(self): wx.Frame.__init__(self,None,-1) self.panel=wx.Panel(self,-1) """ Start Pie …

Member Avatar for Robbert
0
192
Member Avatar for bunkus

Hi, I am trying to install Ming for Python 2.6 I have downloaded the windows setup from [url]http://sourceforge.net/projects/ming/files/Releases/Ming%200.4.3/ming-0.4.3.zip/download[/url] but I am running into problems since if I try to run the setup.py inside the directory py_ext like setup2.py build --compiler=mingw32 I get the following error message: running build running build_py …

Member Avatar for bunkus
0
213
Member Avatar for dbphydb

Hi, I am a tester and new to python. The code in bold should execute only if the webpage has the text 'BUILD COMPLETE'. This text is between the <th> tag and this is found using DataParser class. [CODE] URL = "http://11.12.13.27:8080/cruisecontrol" from urllib2 import urlopen from HTMLParser import HTMLParser …

Member Avatar for dbphydb
0
660
Member Avatar for dbphydb

Hi, After much research and help from forums, i have the following. Using HTMLParser to parse thru html pages and then finally reaching a webpage where i have to check all the checkboxes and then click the 'Deploy' button. Used ClientForm to do this. But i am getting some HTTP …

Member Avatar for dbphydb
0
168
Member Avatar for Kruptein

Well like the title says, everything was alined fine, untill I added the Shell, it's the shell I want to resize, but if I pass wx.Size(100,100) of self.console.SetSize((100,100)), it doesn't work :f What am I doing wrong? [code=python]class DEDITOR(wx.Frame): def __init__(self, *args, **kwds): # begin wxGlade: DEDITOR.__init__ kwds["style"] = wx.DEFAULT_FRAME_STYLE …

0
68
Member Avatar for CobRalf

Hello everybody! a few days ago, i read this post in the [URL="http://www.daniweb.com/forums/thread257510.html"]Advanced and Intermediate Projects[/URL]-Thread: [QUOTE]Create an operating system prototype/emulator in Python. You might research into various operating systems to get an idea for what to implement. Things you can implement: A login. A shell system. A explorer system …

Member Avatar for CobRalf
0
740
Member Avatar for albruno

Is anyone having success with applying CUDA or multi-GPU processing with python? if so, could someone share a simple sample?

Member Avatar for 0x69
0
135
Member Avatar for alabandit

i'm stumped... i get strange results from string[10:] to get the last 10 characters from a string? the code supposed to rename a batch of file sequentially and the number of numbers needs to be consistent eg. 00001 - 99999 thanks for the help [CODE]import os x=0 for file in …

Member Avatar for alabandit
0
252
Member Avatar for MJFiggs

I have just started Python recently and for some reason, I cannot import anything on my computer. I can do it on the computer at my school, but not my laptop. This is the message I received when I tried to import the program "cTurtle" [CODE]IDLE 2.6.1 >>> import cTurtle …

Member Avatar for ultimatebuster
0
159
Member Avatar for JohanY

Hi! I'm writing a software for solving and displaying plane stress problems using hte finite elt method. In this software the main window is (logicaly enough) called 'mainWindow' while the geometry is changed in another frame opened from the menu in 'mainWindow' called 'NodeWindow', below is just a piece of …

0
81
Member Avatar for TitusPE

Hi all I have a txt file. It has a maximum of 24 lines. E.g. Line 1 Line 2 Line 3 Line 4 Line 5 Line 6 ... Line 24 I would like to delete lines 2, 4, 6 ... 24. All the even numbered lines this is the code …

Member Avatar for TrustyTony
0
8K
Member Avatar for Kacoo

this is my code i was wondering if somone could help me find out how to put text in the new window created at the red line [CODE]from Tkinter import * import Tkinter as tk class Application(Frame): def __init__(self, master=None): Frame.__init__(self, master) self.grid() self.createsMenuButton() self.createsOptionsButton() self.createsHelpButton() self.createsUsernameWidget() self.createsUsernameEntryButton() self.createsLoginButton() #### …

Member Avatar for jcao219
0
175
Member Avatar for Aeronobe

I'm trying to find the linenumbers of a webdocument i load using urllib2. I'm trying to do this like this: [ICODE] document = urllib2.urlopen(url,'r') page = document.read() for index, line in enumerate(page): print index [/ICODE] This however, prints out the index of every 'character' instead of every 'line'. How could …

Member Avatar for Aeronobe
0
143
Member Avatar for kur3k

hey gues I search modules for console windows ( when program run ), i search few hours but for windows only find module Console .. I search module like for Urwid but for Windows, not Unix ( sorry, my english is not good )

Member Avatar for kur3k
0
48
Member Avatar for Kruptein

somehow this does not work: [icode]self.list_box_1.SetForegroundColour(5,"red")[/icode] SetForegroundColour is though listed in [url="http://www.wxpython.org/docs/api/wx.ListBox-class.html"]the api reference[/url]

Member Avatar for HiHe
0
163
Member Avatar for Hawkeye Python

Is this possible with pyhton? If it is, how can you do it? [CODE]def raise(): raise = raw_input('Do you really want to raise? y/n') if raise == 'y': bet = bet+1 return # Should RETURN to play(), after raise() # Like "goto LABEL" else: return def play(): bet = 1 …

Member Avatar for lllllIllIlllI
0
83
Member Avatar for jv_05

First of all, excuse me for bad English, I speak Spanish... Well, my question is how do I implement sockets in my program? I'm working on a little game call "Battleship", I already have how to set your ships and the function to attack, but I need to connect 2 …

Member Avatar for lllllIllIlllI
0
174
Member Avatar for xxxchopsakexxx

Ok so if I wanted to do a simple while loop with a user inputting a number and a function doing some calculations, would it be possible to have it so that the user can type in 'quit' instead of a float if they want to quit? Thanks in advance.

Member Avatar for HiHe
0
334
Member Avatar for TrustyTony

Here is way to put easily editable layout for input fields with standard look and collect the text variables to list for use.

0
2K
Member Avatar for nsutton

So I got bored and made a blackjack game. This is probably be the last thing I code in python before I move to C#!!!(so excited to learn it) The game() function is the main fuction all the rest are pretty self explanatory if you understand blackjack. My issue is …

Member Avatar for nsutton
1
221
Member Avatar for vandalised

My task was to create a leapyear program. The following was created: [code] def LeapYear(year): if year % 400 == 0: return True elif year % 100 == 0: return False elif year % 4 == 0: return True else: return False print (LeapYear(400)) print (LeapYear(1000)) print (LeapYear(1012)) print (LeapYear(2000)) …

Member Avatar for griswolf
1
2K
Member Avatar for Aeronobe

I want to test if a value is a key from a dictionary, i do this like so: [ICODE] if value in dict: print "value found" else: print "value not found" [/ICODE] Now this doesn't work if value = "abcd" and the key in the dictionary is "Abcd"... How do …

Member Avatar for Aeronobe
0
108
Member Avatar for vandalised

Hi everyone. Basically i'm very new to python and i'm trying to learn it at a fairly fast pace. One of the books i am using is comparing for and while loops, showing how while loops are more flexible than for loops but more complicated. Anyway to the point.. In …

Member Avatar for HiHe
0
106
Member Avatar for vegaseat

The Python module 'tarfile' is more flexible then it's counterpart 'zipfile'. It allows you to simply archive files without compression, or use the gzip format of compression, or the super compression format bzip2. Here is code to show you the use of the module.

Member Avatar for vegaseat
3
1K
Member Avatar for aint

Hi, What I want to do is, to take multiple sentences, and create a bar representing the sentence length, and under that bars for words, or string of interest. And this process will be iterated over a text, so I can get many graphs on top of each other representing …

Member Avatar for TrustyTony
1
400
Member Avatar for netvigator

I am trying to post to this page and get the result: [url]https://writerep.house.gov/writerep/welcome.shtml[/url] I tried this: [code=python] import urllib import urllib2 sURL = 'https://writerep.house.gov/writerep/welcome.shtml' dInfo = { "state" : 'WAWashington', "zipcode" : '98103', "zipext" : '' } sSendData = urllib.urlencode( dInfo ) resp = urllib2.urlopen( sURL, sSendData ) [/code] I …

Member Avatar for Tech B
0
1K
Member Avatar for captain.don

i hv written 2 programs. "process.py" and "Reg_write_read.py". I have created the exe of both,"Reg_write_read.py" program writes a value in registry through which the process.exe(which is located in C:/) executes on computer restart. But when i Restart my computer. the "process.exe.log" error log generates that says : "Traceback (most recent …

Member Avatar for Tech B
0
192
Member Avatar for Ene Uran

This is my first experience with Python's Tkinter GUI. I want to write a program where the result of an interim calculation is displayed on a label. Later in the program I want to use this result in another calculation by simply clicking on the label. This is what I …

Member Avatar for vegaseat
0
3K
Member Avatar for afireinside

So maybe this is a pretty basic question, then again I am new to python so please bear with me... I have some code, and I have a tkInter checkbox. I figured out how to get the on/off value of the check box but I dont really understand why I …

Member Avatar for vegaseat
0
256
Member Avatar for Aeronobe

I'm wondering if i can make this shorter: [ICODE]if not link.startswith("javascript") and not link.startswith("mailto") and not link.endswith("pdf") and not link.endswith("ppt"): #do something[/ICODE] Cause this is getting VERY lengthy, very soon

Member Avatar for vegaseat
1
168

The End.