14,945 Topics

Member Avatar for
Member Avatar for defience

I'm still new to python and need some help writing a program. I need to write one that runs a *.exe and then checks some timings in it. There are 3 numbers ranging from 0<1000 that are hidden in the *.exe(app.exe). If the script runs the app.exe and then runs …

Member Avatar for vegaseat
0
149
Member Avatar for defience

I'm new to Python and this was written and posted by someone else on another site as a tutorial for a word unscrambler. I thought it was well written and liked the explanations but I tried to use it but keep getting an error message: line 27, in <module> letters …

Member Avatar for defience
0
125
Member Avatar for Shark7

I need to calcualte the scalar product given two lists of numbers... [code]v1=input("Insert the first vector: ") v2=input("Insert the second vector: ") for i in range(len(v1)): v3=v1[i]*v2[i] print v3 [/code] this code will multiplie all the numbers in list v1 and the numbers in list v2 but the result doesn't …

Member Avatar for Shark7
0
351
Member Avatar for vivekr

Is it possible to merge together python and javascript.. I am looking forward to fetching the contents of a webpage, parse them and use them in a webpage from javascript. I am a beginner in javascript and i couldn't find any means to fetch the contents(The webpage's entire source code) …

Member Avatar for bumsfeld
0
66
Member Avatar for chris99

What am I doing wrong, I've done it before! [CODE]class Main: def __init__(self, master): self.master = master self.master.title('Role Playing Form V1.0') self.master.geometry('300x250+350+450') self.master.mainloop() self.cmdCreate = Button(self.master, text='Create Character', command=self.create) self.cmdCreate.grid(row=0) def create(self): pass root = Tk() main=Main(root)[/CODE] the button doesn't appear!

Member Avatar for bumsfeld
0
133
Member Avatar for fonzali

hi everybody , I am new to python and interested in graphics . I like somebody to walk me thru monthly calendar using tkinter . I have already printed 07 calendar using python but I am stuck when it comes to use it with tkinter . it is no homework …

Member Avatar for vegaseat
0
4K
Member Avatar for Jergosh

I'm working on an IM client in Python and my idea was to make it fully modular. It seemed to me that the obvious approach is to make all plugins derive from a Plugin class (with ProtocolPlugin, UIPlugin subclasses) and to be loaded on program startup by yet another object, …

Member Avatar for woooee
0
94
Member Avatar for bumsfeld

Decided to start my own thread rather than hijack thread "Sorting" I followed ghostdog74 advice and used module re to extract numeric strings: [php]import re data_raw = """[20] [ 35+ ] age = 40 (84) 100kg $245 """ # use regex module re to extract numeric string data_list = re.findall(r"\d+",data_raw) …

Member Avatar for bumsfeld
0
1K
Member Avatar for sneekula

I keep reading threads here, some use the Tkinter GUI toolkit and others use the wxPython GUI toolkit. Why would one use one or the other?

Member Avatar for sneekula
0
1K
Member Avatar for Matt Tacular

In python if I divide 6/3 I get 2, that's fine. But I divide 6/4 and get 1... Why aren't I getting a decimal? I would like to know because I want to make something that can detect wether or not a number is whole. (I need help with that …

Member Avatar for Matt Tacular
0
105
Member Avatar for wandie

I have a program that displays its results in this manner. I added the results in an array this is what I got. [code] [20] [35] [40] [84] [100] [245] [260] [300] [440] [521] [650] [/code] How can I put it in this way ['20','35','40'] i used append but it …

Member Avatar for ghostdog74
0
156
Member Avatar for MarkWalker84

Hi everyone! Im stuck... I'm currently writing a GUI program to control a piece of machinery. I am using wxPython along with a few other bits and bobs including USPP for serial access. My problem is that i need some way of 'pinging' the machine. ie I want to be …

Member Avatar for bumsfeld
0
79
Member Avatar for mattyd

Is there an option of some sort in the Dr. Python interpreter that would allow one to re-run the same output results after making adjustments to the code. Example: I run an example of source code and receive an output result. I make changes to the code. I now am …

Member Avatar for vegaseat
0
128
Member Avatar for sneekula

The department's computer has Python 2.4 and on my home computer (really my dad's computer) I installed Python 2.5. Is it possible to have Python 2.4 and Python 2.5 on the same computer?

Member Avatar for vegaseat
0
109
Member Avatar for sneekula

Since there is so much discussion on one of the threads on zipping/unzipping files and all the associated incompatibilities, is there a way to do this with Python and cut out the middleman?

Member Avatar for vegaseat
0
131
Member Avatar for jrcagle

This is part of a short script I wrote to find out whether students had submitted any corrections to work in December or January. [code=Python] import os, os.path months = ['Dec', 'Jan'] # actually a raw_input() files = get_all_files(root_dir) # actually a call to os.path.walk() dates = [] for i …

Member Avatar for jrcagle
0
136
Member Avatar for Matt Tacular

I know wxpython is supposed to be better than tkinter, but I can't find any easy to understand tutorials on how to begin using wxpython. But anyway. How can I get tkinter to load up a jpg?

Member Avatar for jrcagle
0
161
Member Avatar for danielfolsom

I'd like to set up something like this: a=0 class b: def__init__(self, foo): self.foo = foo def create(): global a a=a+1 a=b("FOO") Where the number 1 will define the instance (I'm not sure if define is the write word, whatever you put before the equals sign when your creating an …

Member Avatar for jrcagle
0
108
Member Avatar for sharma_vivek82

code: you can change this code as you like [code] import wx import os from wxPython.wx import * import wx.html class MyHtmlFrame(wx.Frame): def __init__(self, parent, title): wx.Frame.__init__(self, parent, -1, title) html = wx.html.HtmlWindow(self) html.SetPage( "This is test implementation of Simple <b>Notepad</b> using <font color=\"red\">wxPython</font> !!!! " "<br>View is created using …

Member Avatar for pty
0
408
Member Avatar for sharma_vivek82

[code]#Auther : vivek sharma #date : 06-11-2006 #Description : This script is used to get the list of week in given year, user have to input the year , def WeekFinderFromYear(year): """ will return all the week from selected year """ import datetime WEEK = {'MONDAY':0,'TUESDAY':1,'WEDNESDAY':2,'THURSDAY':3,'FRIDAY':4,'SATURDAY':5,'SUNDAY':6} MONTH = {'JANUARY':1,'FEBRUARY':2,'MARCH':3,'APRIL':4,'MAY':5,'JUNE':6,'JULY':7,'AUGUST':8,'SEPTEMBER':9,'OCTOBER':10,'NOVEMBER':11,'DECEMBER':12} year=int(year) …

Member Avatar for mawe
0
2K
Member Avatar for incitatus

can anybody help me by writing a code for opening my web connection. it locks itself after some time as it is password protected and i have to open it again.The thing is that i actually leave my computer on to download stuff and when i come back it locks …

Member Avatar for incitatus
0
112
Member Avatar for dams

Hello, I am new to Python and find it really nice. But I can not launch an executable file using only its name. I have to give its whole path. I expected that the PATH environment variable is known by Python and that it could retrieve the full path itself... …

Member Avatar for dams
0
126
Member Avatar for mattyd

I am in the end part of a Python Gui game build; it is going quite well but I am finding that I underestimated one area of the logic, incorrectly coding it: The game is blackjack. One area that, although it seemed simple on the surface (and in fact it …

Member Avatar for woooee
0
99
Member Avatar for goms

Hi, I am a newbie to python. I was trying to import an execl application to python. To startwith i'm trying to open a excel file using python script. In some of the sample scripts that are available on internet has the following contents. -------------------------------------------------------------------------------- import win32API.client import pythoncom app …

Member Avatar for vegaseat
0
213
Member Avatar for sharma_vivek82

import wx import os from wxPython.wx import * import wx.html class MyHtmlFrame(wx.Frame): def __init__(self, parent, title): wx.Frame.__init__(self, parent, -1, title) html = wx.html.HtmlWindow(self) html.SetPage( "This is test implementation of Simple <b>Notepad</b> using <font color=\"red\">wxPython</font> !!!! " "<br>View is created using <font color=\"red\">wxGlade</font>") class MyFrame(wx.Frame): def __init__(self, *args, **kwds): # begin …

Member Avatar for vegaseat
0
445
Member Avatar for sharma_vivek82

def WeekFinderFromYear(year): """ will return all the week from selected year """ import datetime WEEK = {'MONDAY':0,'TUESDAY':1,'WEDNESDAY':2,'THURSDAY':3,'FRIDAY':4,'SATURDAY':5,'SUNDAY':6} MONTH = {'JANUARY':1,'FEBRUARY':2,'MARCH':3,'APRIL':4,'MAY':5,'JUNE':6,'JULY':7,'AUGUST':8,'SEPTEMBER':9,'OCTOBER':10,'NOVEMBER':11,'DECEMBER':12} year=int(year) month= MONTH['JANUARY'] day=WEEK['MONDAY'] dt = datetime.date(year,month,1) dow_lst = [] while dt.weekday() != day: dt = dt + datetime.timedelta(days=1) lst_month = MONTH.values() lst_month.sort() for mont in lst_month: while dt.month == …

Member Avatar for vegaseat
0
116
Member Avatar for sharma_vivek82

result=[] list = int(raw_input("enter the length of list:")) size_of_batch=int(raw_input("enter the size of batch:")) def createBatch(lst): lenLst = len(lst) if lenLst > size_of_batch: no_of_batch=lenLst/size_of_batch last_entry_batch=lenLst%size_of_batch first_index=0 last_index=size_of_batch else: no_of_batch=0 first_index=0 last_entry_batch=lenLst newList = lst[0:last_entry_batch] runChangeState(result,newList) return while no_of_batch != 0: newList = lst[first_index:last_index] runChangeState(result,newList) first_index=first_index+size_of_batch last_index=last_index+size_of_batch no_of_batch = no_of_batch-1 if no_of_batch==0: …

Member Avatar for vegaseat
0
120
Member Avatar for Matt Tacular

Is there any way to get the python interpreter installed on a thumb drive? So that I can edit some programs while at my work, where I'm never on the same computer twice, so installing on each machine isn't as pratical as the thumb drive. Just anything that would let …

Member Avatar for vegaseat
0
128
Member Avatar for Extremist

Hi there, I am sitting here and thinking. The best way to learn a new language is to play in it, but I have a little problem: I don't know where to start , how about a few ideas

Member Avatar for jrcagle
0
323
Member Avatar for punithap

hai, This is punitha.Iam having some doubts regarding python (python extending with c).In our application python is used as a glue language.It is used to call c funcions(which is in the form of dlls).Once a c function is called,Pyhton variable receives the return value and it passes that value to …

Member Avatar for vegaseat
0
109

The End.