14,951 Topics

Member Avatar for
Member Avatar for franz.cheng.7

Hey all, I'm so confused about how to write a function about sine and cosine without using import math, can anyone help me about that?

Member Avatar for Gribouillis
0
299
Member Avatar for Zebibyte

I tried out one of the "Projects for the Beginner" ideas: the [URL="http://www.daniweb.com/forums/post223885-54.html"]change calculator[/URL]. Basically, you tell it how much the purchased item was, and how much the customer paid. Then it tells you the change due, and the most efficient combination of bills and coins to pay it. However, …

Member Avatar for newbieee
0
743
Member Avatar for Sagarnil

I have a difficult problem. I know there are so many 're' masters in python out there. So please help me. I have a huge log file. The format is something like this: [text hello world yadda lines lines lines exceptions] [something i'm not interested in] [text hello world yadda …

Member Avatar for Lucaci Andrew
0
786
Member Avatar for yudilegawa

Hello everyone, I have 1 raspberrypi and 1 windows server which already has mysql (phpmyadmin) inside it. I need to insert data by using a python script inside the raspberrypi (I work from the raspberrypi) but the data must go to the windows server (it doesn't work yet), the point …

Member Avatar for Lucaci Andrew
0
244
Member Avatar for tunisia

What's a better way to do this? I need to sift through this file and store the following values Cpl File name Content kind Package type Encryption status Container File size Duration Timed text/png Number of audio channels 2d/3d Fps 1) I'm not sure if I should just store these …

0
194
Member Avatar for tunisia

I'm trying to modify this code to take advantage of classes and some other oop features. However, I'm struggling with getting beyond the basics. This is the code that I started with which I am trying to change and make more class absed. import glob import os import sys print(os.getcwd()) …

0
199
Member Avatar for Ene Uran

Most commonly a dictionary of key:value pairs is searched by the unique key. Sometimes it becomes necessary to search for the key, or keys given a value. Special consideration has to be given to this case, because the value does not have to be unique and may return several keys …

Member Avatar for Lucaci Andrew
0
4K
Member Avatar for bunyonb

What must one do to increase the speed and efficiency at which one learns and develops prorams in python(or in any other language)?

Member Avatar for bunyonb
0
234
Member Avatar for krystosan

i am trying to recieve input from external text editor using python's `subprocess` but I am not sure why i am getting the error diff = subprocess.Popen('open(os.path.join(os.getcwd(), "foo.txt") "w")', stdout=subprocess.PIPE) pr = subprocess.Popen(sublime, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True, stdin=diff.stdout) pr.wait() if pr.returncode == 0: msg = pr.stdout.read() print msg er = pr.stderr.read() …

Member Avatar for krystosan
0
375
Member Avatar for krystosan

books = { 'Contact':['Carl Sagan', '2'], 'End of Faith':['Sam Harris', '7'], 'on Mars':['Patrick Moore', '1'], } based on dictionary above, how can i get Modales Qdialog box that should have 3 column containing like below DialogBox BookName_Label: BookAutor_Label : Quantity_QSpinBox BookName_Label: BookAutor_Label : Quantity_QSpinBox BookName_Label: BookAutor_Label : Quantity_QSpinBox Ok Cancel

Member Avatar for bnn678
0
272
Member Avatar for MarkS94

Uhm, I'll tell it as clear as possible. So, if you have few files and you put it into for example `.zip` archive. Files are included into one file and can be double clicked to be executed. If you change this `.zip` into `.xyz` file and trying opening this in …

Member Avatar for bnn678
0
236
Member Avatar for tirthajust4u

Hello gurus: I saw the discussion related on working with words with python which is: import win32com.client wordapp = win32com.client.Dispatch("Word.Application") # Create new Word Object wordapp.Visible = 0 # Word Application should`t be visible worddoc = wordapp.Documents.Add() # Create new Document Object worddoc.PageSetup.Orientation = 1 # Make some Setup to …

Member Avatar for bnn678
0
417
Member Avatar for 26bm

Hi, I have created a program that follows a line blitted on a surface called 'screen'. I have created a function in a different file to do so and have imported it into my main file like so: from Follow_Ground import Follow_Ground The code in the file 'Follow_Ground.py' looks like …

Member Avatar for bnn678
0
173
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
271
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
296
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
424
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
244
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
868
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
344
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 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
361
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
551
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
138
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

The End.