15,179 Topics
| |
Hello everyone, I am making my thesis in the university using Python as programming language and Django as framework, I have doubts about choose data from de models class, for example I have the class Tribunal, and I am able to generate an Excel with all the objects of that … | |
I have been thinking about order operations and generalized * in Python recently. I want to share some of my thinking here, even the topic is quite theoretical, considering the beauty and orthogonality of the language. [B]Point one[/B] You can do comparison with tuples of numbers in Python [CODE]>>> (0,0)<(1,1)<(2,2) … | |
I am trying to sort a file by a quick sort comparison. The problem lies in parsing the string and comparing fields. I use the following to break up a line: records = [line.split(spl) for line in file(filename)] and the following to sort: records.sort( lambda a,b: cmp(a[fieldNo],b[fieldNo]) ) This works … | |
I'm testing to get my python script to still run if the smtp server it uses went down. I have a local mail server im testing this with. The issue is when testing it, i get a large spew of text. It checks all its libraries and such, untill its … | |
I am beginning to write a tkinter program that will generate a DnD 3.5 Character Sheet. I haven't gotten very far. I'm using Python 3, and for some reason the sticky option of the .grid() method isn't working. When I run the code below, I get an error that says: … | |
Hello, pls can somebody have a look at my script and tell me why I can't get a value from d1? (print d1). Thank you for help. here is a script: [CODE]def subtract(): d1=file1(filename) dd2=file2(filename) res = dict() print d1 ## for key in d1: ## if key not in … | |
I suggest it's just a simlpe tiny thing that has to be done to solve this but I simply can't figure it out! I hope anyone can help me. Here's what I koppied from a learnbook for python. >>> secret = 1337 >>> guess = 0 >>> l = 0 … | |
Say I have a file structure that looks like this [CODE]root folder/ main.py -folder a -script.py -folder b -img.png[/CODE] How could I load the img.png file from script.py? Should I just have a function in main.py that gets the path of the root folder, and then tac the 'folder a' … | |
Hi all , I'm new here and new in Python for symbian ; I hope I'm asking in the right forum and the right section. What python provides to switch off mobile functions that consumes battery , How turn off BlueTooth , Wifi , GPRS , Vibration and Ringing ?? … | |
Do you know that there is clean way of doing what C-language ternary operator ? does in Python's recent versions. It is if with special twist. The syntax is: [CODE]'The value if true' if <condition> else 'Value when false'[/CODE] Values can be any type. You can put this structure to … | |
Hallo ... I am very new to Python programming & I have this Question ... I am asked to write a program to calculate the No. of words & the length of each (letters) in this sentence : (An Oligonucleotide is a short segment of RNA or DNA, typically with … | |
I have just started learning python, I am a Java programmer. I think python is more simple than java. What I wanted to ask is, where is python used? And if python does not follow the complete OOP concepts, then can it be used to design large / major applications? … | |
hi everyone, I have a tiny problem with a simple implementation: - i have a main window with a table in my central widget - i want to add stuff in the table gradually, and I allow only the 1st cell (index 0) of each row to be selectable. - … | |
I want to improve my programming skill and decided to build python wrappers over other library's. I've done this with the face recognition and think it would be real world code for me to work on. I want to code as a career and I want to code stuff programmers … | |
Hi, i'm new to Python and i'm currently following the "How to Think like a Computer Scientist" tutorials. I'm at Chapter 4: Conditionals and doing the last exercise where i need to create six colored houses on a black background. I've successfully created the house at the bottom left, but … | |
Alright i need help computing random dates and i have to use lists. this is what the program should do program must print out the following output: 1. The complete list of birthdays that you generated. 2. The birthday that was generated twice (printed separately from the list). 3. The … | |
Hi. I have a wxRichtextCtrl (although plain text is fine if I can find a way to do this), and I would like to return the last word typed while the user carries on. You know that way MS Word and OpenOffice etc, highlight a wrongly spelled word as soon … | |
Hi, The below code extracts the branch number and the test environment to deploy that particular branches build on from a txt file (branch_dest.txt). Then it parses HTML pages to reach a webpage which contains some checkboxes. I want to check the "Select/Deselect All" checkbox and then click the "Deploy" … | |
So, I'm not sure if this is possible, but I'm in a situation where I need to do such or something similar. I'm designing a multi-level game, where the game goes on to level 2 once the player comes into contact with the door at the end of level 1. … | |
I'm revisiting an old IR tracking project, and want to use it in a blender game. I would like to know if anyone could help optimize the parsing algorithm or tell me an easier way to track multiple points with code. "im" is an instance of an image I captured … | |
Ok if anyone knows how to do python programming please help, this is my last assignment and i cant figure out how i should start this here are the directions... You are to write a Python program that randomly generates birthdays – considering only the month and day. For example, … | |
I have created a program, and wanted some critique on it. There is a website that I go to in order to download roms, and I do not like clicking a ton of links and waiting 15 seconds to download it, so I created a program to fetch it for … | |
Okay, I am writing a script that might be impossible to fully explain in words. Therefore, I am going to come up with an example that shows the same problem, so please do not tell me to simply combine the scripts or anything, as I am unable to. Anyways, I … | |
| Hey All, I have 'Py-mailer' here.... here's how it is so far: [code='python'] import smtplib import wx window=wx.App() class pymailer(wx.Frame): def __init__(self): wx.Frame.__init__(self,None,-1,"Py-mailer",size=(900,700)) self.panel=wx.Panel(self,-1) menubar=wx.MenuBar() filem=wx.Menu() filem.Append(201,"Quit") self.Bind(wx.EVT_MENU,self.Quit,id=201) viewm=wx.Menu() viewm.Append(202,"About") self.Bind(wx.EVT_MENU,self.About,id=202) menubar.Append(filem,"File") menubar.Append(viewm,"Help") self.SetMenuBar(menubar) wx.StaticText(self.panel, -1, "Login ID:", pos=(10,10)) wx.StaticText(self.panel, -1, "Password:", pos=(10,40)) self.username=wx.TextCtrl(self.panel,101,"Login ID",pos=(100,10)) self.password=wx.TextCtrl(self.panel,102,"Password",style=(wx.TE_PASSWORD),pos=(100,40)) wx.StaticText(self.panel, -1, "@gmail.com", pos=(220,10)) … |
What's Up? OK, So I have a working python script that sends and receives text to and from the client and server python files, However if the Server and Client are on different computers, And therefore we need to connect over the internet, How would we do that? New to … | |
I've read in data from a file using a GET request through a browser data= open(path) data2= file.read() return data2 and returned it to the console just fine. how do I post this same data to the browser I used as a client for the GET request? socket.send(<htmlcode here>)? what … | |
I am trying to catalog mysql database items in a plone site using python. The function that catalogs the SQL query results takes 2 arguments. First is the item returned by the query (for example Select * from books would return many book objects) and second argument is the string … | |
Hello there, i've been searching the web and a few books for the last days with this (simple?) problem and only ended up fairly confused. the scenario: me and my friends are learning python while/by writing a little game together. My current problem is conserning getting the items (from classes) … | |
using graphics in python how am I able to contain a movable object within set bounds eg a ball with obstacles that it will not pass through. I can produce the ball and obstacles but the ball passes right through the obstacles :( | |
Hi guys:-) I have no experience in programming, and i realise that asking for someone to write an entire programme for me might be a stretch, but unfortunately i havent got any mates that are good at programming. I think the program i need is fairly simple once you know … |
The End.