15,190 Topics

Member Avatar for
Member Avatar for roboguy

Hi everyone, Im a python beginner so please bare with me, i have done the first few project euler but thats it, Im trying to write a script that will search all txt, htm, html files recursively through multiple directorys for a string and will then write the whole line …

Member Avatar for TrustyTony
0
254
Member Avatar for JasonQiao

Could anyone instruct me about the Python code for magic square 3*3, I got some instructions but still made no dent in program. Could anybody send me the code? O(∩_∩)O Thanks! here's the instrctions: magic3 # In recreational mathematics, a magic square of order n # is an arrangement of …

Member Avatar for Gribouillis
0
91
Member Avatar for pixelss

I'm very new to programing, anyways, i was instructed to crate a program to calculate the are of rectangle, using the input from the user ( width, lenght ) using functions here is what i have, but i'm getting a error at the end [CODE] recWidth = input ('Please enter …

Member Avatar for pixelss
0
81
Member Avatar for xhaui

I am stuck on my python lab from this week. The lab deals with strings and being able to search them, slice them, etc. The part I'm stuck on is as follows: "You will implement in Python a function matchPat. It will take two arguments, a pattern string and a …

Member Avatar for TrustyTony
0
138
Member Avatar for memory

I am new to python and numpy. When I wrote: zeros((20000,20000),int), it returned "MemoryError". Does this mean that this array exceeds python's memory limit? Is there a way to define such big an array in python? Thanks.

Member Avatar for memory
0
111
Member Avatar for kannibalkiwi

okay, i'm stuck on an assignment! (first post btw, so tell me if i'm doing anything wrong please :) ) okay, my assignment is as follows : Write some efficient and commented python code to do the following: Accept an input value between 33 and 126 and convert it to …

Member Avatar for kannibalkiwi
0
94
Member Avatar for mandoza671

Hi, I'm new to programming so please excuse any obvious questions. I have a text file with the following entries: mydescription, myword yellow, mango yellow, banana orange, orange green, pineapple green, mango pink, mango What's important is that there is no order, both the 'mydescription' field and 'myword' change randomly. …

Member Avatar for mandoza671
0
155
Member Avatar for KrazyKitsune

Is it possible for the user to input a Python snippet and run it? Like this: [code=syntax]x = raw_input("Python snippet: ") #And then run the script typed in here[/code] Also, we know how errors happen all the time. Is it possible to make it so that when errors happen because …

Member Avatar for snippsat
0
105
Member Avatar for Sirovica

Hello everyone, My high school offers courses both in Python and Lua. I have done some research on both of the languages and they both seem to be fairly nice. But, which one do you think would be more practical to learn, I know Python is more popular but is …

Member Avatar for jcao219
0
70
Member Avatar for OlyDLG

Hi! Re: [url]http://www.daniweb.com/forums/post868247.html#post868247[/url], the example provided by sneekula is helpful, but I need to return the result of the ButtonRelease-1 to main; the only way I could figure out to do this was using a global; is there a better way? Thanks again!

Member Avatar for OlyDLG
0
313
Member Avatar for python_user

Hello i have a situation where i am using Pmw.MenuBar and i am adding node as shown below [CODE]menuBar.addmenu("Select ..., 'Click to add attribute type')[/CODE] Can somebody please tell me how to dispaly the text (Select...) in some color Thankyou

Member Avatar for woooee
0
62
Member Avatar for TrustyTony

I have this 'code' which I wrote as new kind of art form, both as story and code. As program it is little stupid in way of expressing things, because it is writen thinking of human who reads the code. It is supposed to be impressive in that it is …

0
329
Member Avatar for Smed

I want to print only a specified column of a 2D array. For example I can print a row [4,5,6] by doing: [icode] A=[[1,2,3],[4,5,6],[7,8,9]] Print A[1] [/icode] But I want to print the column [2,5,8] by doing something like: [icode] A=[[1,2,3],[4,5,6],[7,8,9]] Print A[][1] [/icode] Is there a way of doing …

Member Avatar for Gribouillis
0
80
Member Avatar for techie929
Member Avatar for Gribouillis
0
57
Member Avatar for KrazyKitsune

Is there a way to hide functions and such when they happen? Example: [code=syntax]print func(x, y)[/code] from showing up when you run it? I want it still printing, just not visible. I want it to print.

Member Avatar for griswolf
0
106
Member Avatar for Ultralisk

Here is my code, what I'm having problems with is taking values from a 10 field file (scores.dat) and putting them into a list. How would i go about this? [CODE]def main(): fileIn = open( "scores.dat", "r") lineIn = fileIn.readline() while len(lineIn) != 0: print lineIn lineIn = fileIn.readline() parse(lineIn) …

Member Avatar for TrustyTony
0
128
Member Avatar for nkinar

I have a string in Python that is comprised of code in C/C++ syntax. I would like to use regular expressions to search through this string and replace an expression of the form 'pow(a,b)' with 'a^b' I've attempted to do this, but my code does not seem to be working. …

Member Avatar for ptmcg
0
556
Member Avatar for c2q

Hi, Im currently taking an introductory course in python and i need help with some stuff. Basically for an assignment the first function we have is supposed to get an an average red value of all the pixels in the image. red being the R in (RGB). So basically the …

Member Avatar for woooee
0
175
Member Avatar for gatehrdy

[B]Hello, I am new to programming. I am trying to make a dice game called 10,000. Here is the outline or pseudo code. it kind of works. It will roll and keep score, but sometimes it will roll multiple times. [/B] pick a player player one or player two player …

Member Avatar for griswolf
0
960
Member Avatar for sixhobbits

Hi, I recently upgraded from python 2.6 to python 3.1 as I am writing some simple code which makes use of German special characters (äÄöÖüÜß). The special characters are in a dictionary. They are printed, but also input by the user. The program works fine now when run in Python …

0
32
Member Avatar for Macooper26

I just downloaded Python 2.7 and 3.2 and it just looks like DOS. I'm using Windows, so I don't know if that's the problem--because I saw someone using a MAC and it looked like they didn't have the same problems that I'm having--because I can't save and I have no …

Member Avatar for griswolf
0
83
Member Avatar for funfullson

hi dears. I have an unicode data in a file.it is a persian text. I want to read it and after some change write it in another file. but when I read it, I face to some hexadecimal characters. what I have to do with them? Thanks.

Member Avatar for griswolf
0
157
Member Avatar for mezz80

Assignment 1: Prompt the user to enter a number. After reading the user's input, print a 0 if the number is even or a 1 if the number is odd Assignment 2: Prompt the user to enter a number of seconds between 1 to 86,400. After reading the user's input …

Member Avatar for mjhurdle
-3
301
Member Avatar for novice20

hi all.. am working with python 2.4.1 n have pysnmp 4.1.14a installed.. the statement from pysnmp.entity.rfc3413.oneliner import cmdgen gives me the following error: ImportError: No module named pysnmp.entity.rfc3413.oneliner can anyone pls give me the reason? eagerly awaiting any response. Thanx in advance

Member Avatar for TrustyTony
0
2K
Member Avatar for danholding

[CODE]Traceback (most recent call last): File "C:\Documents and Settings\Administrator\My Documents\textprocessing\test files\keep 6 latest file.py", line 37, in <module> shutil.move(file_name, dst_file) File "C:\Python31\lib\shutil.py", line 278, in move copy2(src, real_dst) File "C:\Python31\lib\shutil.py", line 113, in copy2 copyfile(src, dst) File "C:\Python31\lib\shutil.py", line 66, in copyfile fsrc = open(src, 'rb') IOError: [Errno 2] No …

Member Avatar for danholding
0
418
Member Avatar for _neo_

Hi. I want to run some shell commands on linux machine with python Popen, for ex. "ping". How I can terminate the process, if it isn't finished normally in a given time? I've tried write some code, can anybody improve it or give some better idea? Any suggestions appreciated. Thanx. …

Member Avatar for Gribouillis
0
1K
Member Avatar for acrocephalus

Hello, I am trying to use icons on my "File" menu using this code [CODE]fileMenu = wx.Menu() log = wx.MenuItem(fileMenu, ID_LOG, '&Login\tCtrl+L') fileMenu.AppendItem(log) self.Bind(wx.EVT_MENU, self.OnLog, id=ID_LOG) NewUser = wx.MenuItem(fileMenu, ID_NEWUSER, '&New User\tCtrl+N') self.Bind(wx.EVT_MENU, self.NewUserDlg, id=ID_NEWUSER) fileMenu.AppendItem(NewUser) quitIcon = wx.ArtProvider.GetBitmap(wx.ART_QUIT, wx.ART_MENU, (16, 16)) quit = wx.MenuItem(fileMenu, 1, '&Quit\tCtrl+Q') quit.SetBitmap(quitIcon) fileMenu.AppendItem(quit) self.Bind(wx.EVT_MENU, …

Member Avatar for acrocephalus
0
107
Member Avatar for acrocephalus

Hello! I have a problem which I don't know if it is related to MySQL or Python. I am writing a database using wx.Python and MySQLdb. My problem is that when I want to send some string which contains accents to the MySQL database (for instance, 'Empordà') it is inserted …

Member Avatar for acrocephalus
0
171
Member Avatar for acrocephalus

Hello! I have a problem which I think it is related to Python, however I may be wrong. I am writing a database using wx.Python and MySQLdb. My problem is that when I want to send some string which contains accents to the MySQL database (for instance, 'Empordà') it is …

Member Avatar for acrocephalus
0
415
Member Avatar for acrocephalus

Hello! I am trying to set up a masked combobox using wx.lib.masked.combobox.BaseMaskedComboBox with autocompletion. However, I've found a couple of problems. On one hand, if I run the code as I provide it (code at the end of the post), I get an error caused by the 'Antigua and Bermuda' …

Member Avatar for acrocephalus
0
165

The End.