15,181 Topics
| |
Few days ago I finished making my own (quite primitive) chat server with SocketServer. I haven't had any problems with it apart from the designing of the chat protocol: I made a very sketchy protocol for messaging. The client just sent unix-like commands to the server to do certain opperations: … | |
Hi, I am trying to generate a list of random numbers where each number in the list is a individual string. This is my code so far: [CODE]import random def make_secret(numdigits): a=[] secret = random.sample(range(0, 10), numdigits) for i in secret: a.append(str(secret)) return a[/CODE] An example of what i'm trying … | |
Okay i'm really sorry to have basically bombarded this forum but this is my last cry for help on this project I swear! I guess many of you are intimately familiar with what's happening so far, and thank you all so much for putting up with me =) I've got … | |
Yet another thread showing how awful I am at programming... I've got a list called week_pattern It contains a list of 52-character strings which represent whether something occurs in a certain week. The list is below: [CODE]['0000000000111111111100000000000000000000000000000000', '0000000001000000000000000000000000000000000000000000', '0000000000000000000000000011111111000011100000000000', '0000000000000101111100000000000000000000000000000000', '0000000001111111111100000000000000000000000000000000', '0000000000111111111100000000000000000000000000000000', '0000000000000000000000000001111111000001100000000000', '0000000000111000000000000000000000000000000000000000', '0000000001111111111100000000000000000000000000000000', '0000000000000000000000000011111111000011100000000000', '0000000000000000000000000011111111000011100000000000', '0000000000000111111100000000000000000000000000000000', '0000000000000000000000000000000000000000001000000000', '0000000000000000000000000001111111000001100000000000', … | |
Hello, I'm trying to install a python based program, the instructions call for this command. I have python 2.7 installed & have successfully installed virtualenv using easy_install CODE_DIR=`pwd`/program PYTHON_BIN=/opt/python-2.5/bin/python VIRTUALENV_BIN=`dirname $PYTHON_BIN`/virtualenv $VIRTUALENV_BIN $CODE_DIR cd $CODE_DIR source bin/activate I try to run just the first line and I get this: Traceback … | |
this error keeps plaguing me with the code: [code=python] option = input('What would you like to do? ') if option == 1: newExpence = addExpence(totalBudget) totalBudget = totalBudget - newExpence elif option == 2: removedExpence = removeExpence(totalBudget) totalBudget = totalBudget + removedExpence elif option == 3: newRevenue = getNewRevenue() totalBudget … | |
hi, i am trying to implement a proxy based on BaseHTTPServer built-in module. the GET & POST methods work fine, but i have some problems implementing the CONNECT (do_CONNECT) method, i understand how ssl tunneling works theoritically, i tried to implement it using httplib.HTTPSConnection, i write the headers and the … | |
Hi dears. I want to send a string as sms in gsm modem witch mixed from english and unicode word. for example: "hello in persian is 'سلام' in arabic is 'السلام'." now, how I can make a pdu format from this string and what change I have to make in … | |
Hello! I am trying to edit a csv file. This is my original csv file [CODE]"TINAMIFORMES",,,, ,"Tinamidae",,, ,,"Tinamus",, ,,,"tao","Grey Tinamou" ,,,"solitarius","Solitary Tinamou" ,,,"osgoodi","Black Tinamou" ,,,"major","Great Tinamou" ,,,"guttatus","White-throated Tinamou" ,,"Nothocercus",, ,,,"bonapartei","Highland Tinamou" ,,,"julius","Tawny-breasted Tinamou" ,,,"nigrocapillus","Hooded Tinamou" ,,"Crypturellus",, ,,,"berlepschi","Berlepsch's Tinamou" ,,,"cinereus","Cinereous Tinamou" ,,,"soui","Little Tinamou" ,,,"ptaritepui","Tepui Tinamou" ,,,"obsoletus","Brown Tinamou" ,,,"undulatus","Undulated Tinamou" ,,,"transfasciatus","Pale-browed Tinamou" … | |
Hi Folks, Windows/Python3.1.2 I'm totally at a loss with this one... The code is supposed to open a file (postscript with UNIX LF-only EOL characters), look for and change a line, then write the lines back. It works fine, except for the fact that I can't dissuade Python from writing … | |
We have implemented ConfigParser object to parse the log file and load tested the application, but it was failed after 50 records created due to memory error. we removed ConfigParser's code and re-tested then the transaction was completed successfully, finally we figured out that this object is creating more objects … | |
This one might be a challenge... Okay some of you might have an inkling what i'm trying to do already from the last thread (thanks for helping!) but I figured I should start a new topic for a new problem so that people can search solutions easier. I've got multiple … | |
Hello, What's the right way to open and close dialog windows multiple times? At the moment I instantiate a dialog window on a clicked button signal, then close it with self.close() but when I open it again Python crashes. So I can open the dialog only once. How can I … | |
Hello everyone, I am trying to process various texts by regex and NLTK of python -which is at [url]http://www.nltk.org/book-[/url]. I am trying to create a random text generator and I am having a slight problem. Firstly, here is my code flow: Step-1)Enter a sentence as input -this is called trigger … | |
What are some alternatives to writing [CODE]len(mylist3 & mylist4)[/CODE] within this code? [CODE] mylist1 = [1,2,3] mylist2 = [4,5,6] mylist3 = set(mylist1) mylist4 = set(mylist2) lenresult = len(mylist3 & mylist4) [/CODE] A module i'm importing is unable to use the count() that gets called with the ' & ' operator. | |
Hey all, I've been having some problem with python - i'm pretty awful at programming but have been soldiering on with this for some time now! What I need to do is take one list and compare it to another. Both lists are presented in rows, and I need to … | |
Why do people say isinstance is bad? If I have my own class, named Test, and if I want to check an variable to see if it is an instance of Test or Test's child classes, is using instance() bad? | |
Hi, im looking for any tips on how to make a program that can move the windows vista mouse icon to different spots + left and right click. So I can tell it to go to this spot and click. can anyone please help | |
| Hello all, I want to make a Python program which will go to a particular site, login with my credentials, and do a specific task, such as in this case: go to WordPress.com, login, navigate to the drafts section, and add a line to a draft. I believe most of … |
Hi everyone, I'm making some kind of game in Python and i need to save random number to text file but i cant. Please help me out. Here is the code: [code]def lvl(): x = random.randint(100,1000) tfile = open("text.txt", 'w') tfile.write(x) input("")[/code] Without x everything is good, but i need … | |
Hello! As a part of a database project, I need to find a way to send a MySQL table to wxpython and then select some of its records (using a Select/Remove button) to store them in another class of the database. Is there any kind of widget to do this? … | |
Hi, I have a content type with a selection field whose value I would like to set programmatically (ie, for all items in a folder). I know this is a vague question but can anyone point me towards something that might help me figure this out? Thanks in advance! Cheers, … | |
Hello! I am trying to update a MySQL table using a Python code but I am having some problems. I define the connection and the cursor in the Ornithobase (wx.Frame)class in the OnLof function as [CODE]self.db= MySQLdb.connect(host='localhost', user=self.Username , passwd=self.pwd, db='Ornithobase') self.cursor = self.db.cursor()[/CODE] Then, in the same class but … | |
Hello all, To begin, I am working with a MySQL database using python. In the database, I am working with 3 columns: REF_ENTRY_TIME, REF_EXIT_TIME, REF_ENTRY_VALUE. My goal is to graph the net value position against time. For the time portion, both REF_ENTRY_TIME and REF_EXIT_TIME are random various times between 9:00 … | |
Hi, all! I was wondering if there is any way to check from the server side whether the client has closed a socket connected to one on my side. client side [CODE]import socket s = socket.create_connection ((host, random_port)) s.close () [/CODE] server side [CODE] ... a = lstn.accept () [/CODE] … | |
When you think of Media player, you need beautiful look n feel. I know GIMP can do alot. But Skin in wxPthon? I don't think it is possible. So I thought and thought then I came with this Idea. Create panel with Image as background and then Load wxBitmaps and … | |
helo guys good day... i have a problem in python programming... im new to this langauage.. im having a bit problem on creating a program in python that would determine if the integer is divisible by 3 or not without using a modulus? im glad if you can help me … | |
Hello Everybody. I am Joeflims. I am currently teaching myself Python as my first language. After that I may move on to C,C++,JavaScript, or whatever I feel like. In addition to learning how to program, I am also an avid record collector,p lay the guitar, and make balloon animals. I … | |
Hi, We have a date input come in the format of YYYYMMDD, ex: if the date comes as 19980224, then its good else if the date comes as 19982402, then we need to raise exception we need to validate this date format. can you please guide me how to do … | |
I am trying to insert text to image, assignment only allows me to use load, save, getpixel, and putpixel. Details about letters, numbers, punctuation is given in Imageproc code which basically are dictionaries. But I am getting this error after running: pix[10+index, 15] = letters[value] SystemError: new style getargs format … |
The End.