15,175 Topics
| |
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 … | |
*Hello. I am not new to the wonderful site - Just lost login credentials* I am resuming work via Python and must make some installs into my Lib. I am having trouble with this - I have not used Python in 2-3 years. Many syntax errors. This is from install … | |
Server #!/usr/bin/python3 import socket from time import ctime HOST = '' PORT = 21567 BUFSIZ = 1024 ADDR = (HOST, PORT) udpSerSock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) udpSerSock.bind(ADDR) while(True): print('waiting for message...') data, addr = udpSerSock.recvfrom(BUFSIZ) udpSerSock.sendto(data, addr) print('...received from and returned to:', addr) udpSerSock.close() #END# Client #!/usr/bin/python3 import socket HOST = … | |
building my first cgi website, here is my problem. The code below works but when the condition is met it outputs both pages on the same screen however when the condition is not met it only outputs the Else: statement like its supposed too. I can't figure out why it … | |
| Is there some place where I can get a list of the "named" colors (i.e., goldenrod) available in wxpython? I'm using osx 10.6.8. Thank you. |
from visual import * sec = arrow(color = color.cyan, pos = vector(0,0,0), axis = vector(0,3,0)) minu = arrow(color = color.red, pos = vector(0,0,0), axis = vector(0,2,0)) hr = arrow(color = color.magenta, pos = vector(0,0,0), axis = vector(1,0,0)) angle = 0 angle2 = 0 while True: rate(1000) angle = angle - … | |
| I am trying to learn wxpython, but having trouble laying out two buttons that I want to be centered in a horizontal panel. I can get the buttons on the panel, but they are not centered. What I'm trying to do is create a Frame that contains an upper panel … |
The End.