15,181 Topics

Member Avatar for
Member Avatar for victorkvarghese

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!!!! …

Member Avatar for slate
0
3K
Member Avatar for CodingCabbage

I wish to use parameters in a class to change what the class displays how would this be done?

Member Avatar for rrashkin
0
272
Member Avatar for CodingCabbage

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.

Member Avatar for CodingCabbage
0
305
Member Avatar for vunkas

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 …

Member Avatar for nosrac25
2
436
Member Avatar for rbyrd

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 …

Member Avatar for rbyrd
0
245
Member Avatar for stich

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?

Member Avatar for pritaeas
0
209
Member Avatar for Gribouillis

This python script prints all the columns of an sqlite database which path is given as argument.

4
872
Member Avatar for maurice.waka

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 …

Member Avatar for Gribouillis
0
345
Member Avatar for maurice.waka

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 …

Member Avatar for Lucaci Andrew
1
226
Member Avatar for MasterHacker110

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 …

Member Avatar for masterjiraya
0
249
Member Avatar for maurice.waka

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 …

Member Avatar for maurice.waka
0
251
Member Avatar for dsushmareddy

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.

Member Avatar for vegaseat
0
365
Member Avatar for rbyrd

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?

Member Avatar for vegaseat
0
553
Member Avatar for eplymale3043

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 …

Member Avatar for vegaseat
0
2K
Member Avatar for oh.m.song.1

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. …

Member Avatar for slate
0
141
Member Avatar for itsnauman

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 …

Member Avatar for snippsat
0
385
Member Avatar for james.lu.75491856

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') …

Member Avatar for james.lu.75491856
0
2K
Member Avatar for ram619

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 …

Member Avatar for Ewald Horn
0
2K
Member Avatar for Rebecca_2

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 …

Member Avatar for slate
0
258
Member Avatar for Vish0203

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 …

Member Avatar for wshane796
0
294
Member Avatar for joseph_7

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 …

Member Avatar for TrustyTony
0
236
Member Avatar for joseph_7

anyone good at python please can you email me Josephawino@hotmail.co.uk

Member Avatar for Dani
0
68
Member Avatar for flebber

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 …

Member Avatar for dashing.adamhughes
0
129
Member Avatar for Ryan_8

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 …

Member Avatar for snippsat
0
158
Member Avatar for RikTelner

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 …

Member Avatar for Coloradojaguar
0
354
Member Avatar for MFS NCCCC

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 …

Member Avatar for bryann
0
192
Member Avatar for reuben_1

can i have some advice for making a basic program, and can someone help me through python plz thx

Member Avatar for vegaseat
0
176
Member Avatar for rbyrd

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.

Member Avatar for dashing.adamhughes
0
158
Member Avatar for ShobanaV

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 …

Member Avatar for dashing.adamhughes
0
241
Member Avatar for flebber

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 …

Member Avatar for flebber
0
427

The End.