15,181 Topics
| |
Hii, Can anyone provide me the python code for finding a number that is stored in a file . The file contains 1 lakh numbers!! And i want a python code that searches the file and find the desired element!!!! Both linear search and binary search!! i'm a python beginner!!!! … | |
I wish to use parameters in a class to change what the class displays how would this be done? | |
I have these few lines in a class in my program but it doesnt appear. No errors are shown and when i "print(menubar)" and address "0.4.." or "4..." appears menubar = Menu(master = self.mainGUI) fileMenu = Menu(menubar) fileMenu.add_command(label="Exit", command= destroyMethod) menubar.add_cascade(label="File", menu=fileMenu) destroy method does work and is existing. | |
Here's a small piece of code in python that may be helpful to those who like to play with substitution ciphers..... Say we have a text that is ciphered with simple [substitution cipher](http://en.wikipedia.org/wiki/Substitution_cipher), and say we know that the original text contained a certain phrase...but all we have now is … | |
| The listing below draws a dot wherever the mouse is clicked on the panel, but it seems to work only if *both* lines self.panel.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown) wx.EVT_LEFT_DOWN(self.panel, self.OnLeftDown) are included. If one or the other is omitted the dot doesn't appear until the next mouse click (so the locations of the … |
Hi, i'm a beginner to computer programming and I feel like I didn't learn anything in college. I got my associates in science and I don't know from where to start orwhat language to choose. Does everybody go through this stage before they become good programmers? | |
This python script prints all the columns of an sqlite database which path is given as argument. | |
Is there a pythonistic way available to search all the tables and columns of an Sqlite3 database? The only inputs would be the name of the sqlite DB file or a raw input. I am trying to write a forensics tool and want to search sqlite files for a specific … | |
listname = ['bartian', 'lenana', 'kilimanjaro', 'uhuru', 'elgon', 'everest'] while True: if listname[:-1] == everest: print(listname[:-1]+=) I need a way to loop over this list and print the items in the list. I dont know whether this is pythonic since am having trouble printing the items. I want it to print … | |
I am thinking about making my own social network recently. Now I have a few questions... Q1: I have used php and asp.net before and liked them both, never really used python for web development. I am thinking about making a smallish social network but also want to expand it … | |
from Simhash import Simhash from teamque1.referrences.definitions import define from teamque1.referrences.definitions import teamscore from teamque1.referrences.definitions import teamplayers from teamque1.referrences.definitions import teamtable from teamque1.referrences.definitions import teamposition from teamque1.referrences.definitions import teamsgame import re import sys import difflib name = input def search_soccerteams(): """Searches through the system finding the team stuff e.g. if you … | |
Gtk-CRITICAL **: IA__gtk_range_set_range: assertion `min < max' failed I am getting this error when running my code wriiten using wxpython. Can anyone please explain what this error is. | |
| How can I capture a mouse click on a wx.Panel so that a circle is drawn wherever the mouse is clicked on the panel? |
Write a program that can read the students records from the file “scores.dat”. This program will find the maximum and the minimum student scores. The first line in the file is a header. Each line (starting from the second line) contains the records of one student separated by spaces. These … | |
How to do this? :Write a program to draw a face of a clock that looks as close to the below as possible. (Note that the clock tick-marks are thicker than your usual lines!) Include comments to explain to the reader what you’re doing. Would appreciate very much thank you. … | |
Hey, I have previously programmed in C, PHP & Javascript and I have recently started out with Python but the syntax of the functions is quite different and confusing? Like if we call `len(abc)` we enter the param inside the function unlike the function `abc.upper()` where we use enter the … | |
import web,re,traceback urls=( "/","displaythreads" "/viewthread","displaythreads", "/viewthread/(.*)","displaythread", "/viewthread/(.*)/Vote/(Up|Down)","vote", "/newthread/(.*)","newthread", "/newthread","newthread" ) entries={}###{entryname:{property:value}} entrylength=0 class displaythreads: pass class newthread: template=web.template.frender("newthread.html") default=template("DEFAULT",0) def initialize(): pass def GET(): return default def POST(): data = web.input() try: username,threadname = data.username,data.threadname except: return template(mode) if threadname in entries: return template("Exists") entries[threadname]={"creator":username,"points":0,"totvotes":0} class displaythread: template=web.template.frender('Thread Viewer Template.html') … | |
Hi, I have a device connected to the USB port of the laptop. This device pumps data to the port which is read by the python script. As per the baudrate of the board I use folowing configuration to open the port. Serial(options.port,921600,timeout=0.2,xonxoff=0,rtscts=1) But when I analyse the collected LOG … | |
| Hi, I have an output file (.txt) from a computational chemistry program. At some point in this file, following an unknown number of iterative steps, the following table will be found: Comparison of initial and final structures : -------------------------------------------------------------------------------- Parameter Initial value Final value Difference Units Percent -------------------------------------------------------------------------------- Volume a … |
odd mountain is a list of odd numbers going up from 1 and then back to 1. e.g. odd_mountain of size 5 is [1,3,5,3,1] odd_mountain of size 4 is [1,3,3,1] Hint: use the list functions and a builtin function. Can anyone help me in this? all my tries are going … | |
am trying to create a python code that counts words,vowels,consonats,upperand lower case letter,and the frequency which has the option like Do you want to enter the text via the keyboard? Do you want to read in the text from a file? here is how i got but idont if am … | |
| |
What is the best way to implement a reusable usr confirmation? Basically so that I can embed it in other functions, so that the user will get to confirm if output is ok or whether they want to recall function or quit. So it seems it should be like. def … | |
I appologize if this has been answered elsewhere but the terms I search for do not turn up a good fit. I am new to everything I am trying to do here and need some direction to solve this problem. I have a string that is 'variable1=5&varible2=3&variable3=27&varible4=1' I need to … | |
Is software hackable no matter how perfect it is written? Let's say I will create simple OS, I will spend like 30 years on encrypting every single variable, every code string and insert quadrillions of hacking preventions. Let's say, that there are absolutely no leakings in code, variables, passwords. Is … | |
I need a python code that collects all even numbers separately, odd numbers separately and displaying into two separate totals. The range of numbers is 1-20 I am new to this language and I keep getting syntax errors, invalid statement errors etc.. So it would be great if you can … | |
can i have some advice for making a basic program, and can someone help me through python plz thx | |
| Does anyone know where I can download Python source code for Graham's convex hull algorithm? C and C++ code seems to abound, but I need Python code, and specifically for Graham's method (not Jarvis or others). Thanks in advance. |
I am trying to make a local python application communicate with the python application in cloud(GAE). I am able to send a string from local appn to cloud appn, which invokes the post method in cloud appn and writes some message to the screen. I want to access the string … | |
What I am trying to do is delete the key value pairs out of a dictionary if the value is = 0. I seem not to be acheiving that so far. Python 2.7.5+ (default, Sep 19 2013, 13:48:49) [GCC 4.8.1] on linux2 Type "help", "copyright", "credits" or "license" for more … |
The End.