15,185 Topics

Member Avatar for
Member Avatar for defience

I have a file named numbers.txt that looks something like this: 1243#74656453634#6356#56456456#565#1212121#78384 83#457#090#720347###24273#18712#478230478#57117 58125671#47464#74647#46474647#19192938#828##2583 5#2948284#6010203040# I need to replace all of the '#' symbols with '!'. Then I need to replace 3 of the'!' symbols to '@' but not knowing which ones. It could be the 2nd, 5th, 15th or …

Member Avatar for woooee
0
8K
Member Avatar for nure123

Hi all, Could anybody tell me what is wrong with the following sequence of statements with which I always get the error message: TypeError: only length-1 arrays can be converted to Python scalars. I have the Numeric imported and am using Python 2.4. x=array([1,2,3,4]) y=exp(x) Nure

Member Avatar for woooee
0
75
Member Avatar for nish88

hi ..... i'm making an animation but am having a problem Tkinter. the problem is that when i open the file with python 2.5 and execute the code then it works but by just double clicking on the file icon the program don't not work properly.its does not show the …

Member Avatar for sneekula
0
150
Member Avatar for mcsejung

I now have a new BLACKBERRY. Does anyone know of a package for PYTHON that will run on a BLACKBERRY? :)

Member Avatar for linux
0
50
Member Avatar for debangan.b

hi every body dis is debangan bhattacharyya 4th yr IT student of WBUT...we have project in our final sem...Currently working on a mobile communication based messaging framework for automating job/class/workflow information scheduling using an open standerd based technology I have to write code in python as my instructor has told...But …

Member Avatar for linux
0
120
Member Avatar for ftpvk

I need to write some code for making a double space between 1-2 words, triple space between 2-3, then double again followed by triple and so on. I came up with this code: a = 'one two three four' and I want to get this: "one two three four" print …

Member Avatar for sneekula
0
76
Member Avatar for knish

Hi, #!/usr/bin/python # panels.py import wx class Panels(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, id, title) hbox = wx.BoxSizer(wx.HORIZONTAL) splitter = wx.SplitterWindow(self, -1) vbox1 = wx.BoxSizer(wx.VERTICAL) panel1 = wx.Panel(splitter, -1) panel11 = wx.Panel(panel1, -1, size=(-1, 40)) panel11.SetBackgroundColour('#53728c') st1 = wx.StaticText(panel11, -1, 'Feeds', (5, 5)) st1.SetForegroundColour('WHITE') panel12 = wx.Panel(panel1, -1, …

Member Avatar for Lardmeister
0
222
Member Avatar for nish88

hi....i'm working on a tutorial and i need to use [code=python] from bwidget import * [/code] can anyone tel me where i can get this module....... thanks in advance

Member Avatar for Lardmeister
0
51
Member Avatar for MikP

Hi all, I'm a n00b at Python and am working on outputting html using pyhtmloo - I've checked the [URL="http://sourceforge.net/docman/index.php?group_id=89844"]pyhtmloo site[/URL] for guidance but no joy there. Hopefully I'll find guidance here... The python code below outputs an html page and what I'd like to do is set the refresh …

0
53
Member Avatar for katak_guy

How do i access the '\n' (newline) character in text widget? because I've a problem doing my project. I would like to ignore the character but ......... if (A2int[plain[i]]=='\n') do the trick. Any ideas? [B]KeyError: '\n'[/B]

Member Avatar for katharnakh
0
225
Member Avatar for RMartins

Can anybody tell me how can i avoid the overflow of this program? from math import sqrt f=lambda n: sum([int(i)*int(i) for i in str(n)]) L=[] for n in range(0,10**20): if sqrt(f(n))%1==0:# == float(int(sqrt(f(n)))): L.append(n) L.sort() print "NĂşmero de quadrados perfeitos na lista:",len(L) print L y= lambda L: reduce(lambda x,y: x+y,L) …

Member Avatar for G-Do
0
85
Member Avatar for jrcagle

Hi all, This is the beginning of a hopefully useful project: to create a Canvas widget for wxPython that will mimic or improve on the Tkinter Canvas widget. Those of you who have coded with both will probably know what I'm talking about. With Tkinter, you can plop items like …

Member Avatar for BJSH
1
538
Member Avatar for turnerca902

Hi folks, I believe this is a simple task, but I'm having problems getting things to work the way I would expect them to. What I have is a master file containing about 1000 lines. Each line looks like this: 2008_06_01 07:55 24.8 83.1 What I need to do is …

Member Avatar for turnerca902
0
111
Member Avatar for Jozin_z_Bazin

Hi I was create a form in Qt Designer and saved as UR.ui (main title of this forms is "MainWindow") next write in terminal: pyqt4 UR.ui > UR.py and open created file UR.py and write: import sys from PyQt4 import QtCore, QtGui from UR import Ui_MainWindow class StartQT4(QtGui.QMainWindow): def __init__(self, …

Member Avatar for nish88
0
138
Member Avatar for nish88

hi everybody..... i'm using an array to make a program but i'm not able to find the size (length) of the array.can anyone tell me how to do this?

Member Avatar for nish88
0
242
Member Avatar for alexgv14

I have a .txt log file and must of it is crap. But there are parts that display when a user logs in, and at what time the logged in. Below is a portion of the log file. For example, "user1" is a user logging in and "user2" is another …

Member Avatar for jrcagle
0
116
Member Avatar for h0bbit51

So, here's the deal. I am making a pretty simple program, but I seem to have a major problem. I have a loop in the code that is supposed to keep executing a command until the user presses a button. The problem is, I cannot figure out what I should …

Member Avatar for h0bbit51
0
71
Member Avatar for what_is_that???
Member Avatar for Ene Uran
0
41
Member Avatar for mlattanzi

Dear all, this is my first post on the Forum, so hello everybody! :) I am newby with Python (I have only 4 days experience), I have started to leanr because I will need to develop some software to the company I working in. Currently I am developing a code …

Member Avatar for Ene Uran
0
167
Member Avatar for mjsinpl

Hey guys. I have to create an alarm clock in python. i really really need some help in creating this thing.. seeing that i have absolutely no clue what i am doing. I have found some basic code that supposedly makes a clock which updates but the bleeeding thing just …

Member Avatar for Ene Uran
0
681
Member Avatar for nish88

hi everyone....... i am writing a program where i have 2 ovals and i want my first oval to appear then after 2 seconds the second one...but am failing in doing this. can anyone help me to do this please. thank you in advance here is my code [ICODE] from …

Member Avatar for nish88
0
170
Member Avatar for Impact4ever

Hi guys, I have a friend at school and she's taken Unix 2. She gave me a copy of her work assignment so that I could improve my scripting skills (Still a begginner at python and programming). This is the assignment: Write a script that will prompt the user to …

Member Avatar for Impact4ever
0
74
Member Avatar for nikoasumi

Hi, I am new to python and new to this forum. So how are you all? What I am trying to do is create a script editor, with syntax highlight and unicdoe support. It doesnt need to link to ANY compiler, it simply have to display my script with highlights, …

Member Avatar for nikoasumi
0
219
Member Avatar for Carlo Gambino

I am working to increment lists in such a way that each item in the list is incremented incrementally, it sounds confusing but its not: If the user inputs: [CODE]list = [1, 2, 3, 4] [/CODE] I want the output to be: [CODE]2, 4, 6, 8[/CODE] in essence, the first …

Member Avatar for jrcagle
0
141
Member Avatar for RMartins

does anybody knows why this function doesn´t work very well: f=lambda n: reduce(lambda x,y:x**2+y**2, map(int,str(n))) I want that this function add the square of the digits of a number an example of what i want: f(442)=4**2+4**2+2**2=36 and it's giving me f(442)=1028!!!:S However fou numbers with 2 digits the function works!

Member Avatar for Ene Uran
0
167
Member Avatar for implor

I have a string that loks like "u'mystring'". i'm wondering if ther is a easy way to remove the u'' part of the string?

Member Avatar for jrcagle
0
16K
Member Avatar for nish88

[B] Have someone ever implement game of life without using cell??? just using a plain interface like tkinter and rectangle. [/B]

Member Avatar for jrcagle
0
38
Member Avatar for StepIre

Hi Guys, I have a nested dictionary that i would like to be populated from a file at the start of my prog and put back into the file at the end of the prog. Could anyone direct me to somewhere where i could get info on how to do …

Member Avatar for StepIre
0
129
Member Avatar for petr2008

Hi, I am using Python 2.4.4 and: from numpy import * from MA import * I am using masked data in arrays and functions: average, min and max. When the last item of an array is masked, I am getting "masked" results for min and max functions, even if there …

Member Avatar for petr2008
0
63
Member Avatar for nirmalarasu

Hi All, Currently Iam writing python ftp script to upload a file to FTP Server. The server where iam going to download a file expects the upload command in this format "put <filename> flash" I dont know how to send this same command in ftp session after login. I have …

Member Avatar for nirmalarasu
0
482

The End.