15,175 Topics

Member Avatar for
Member Avatar for Maurice_3

Hi am a newbie in Python. I have this code for a game where a client types in e.g. as illustrated several cities and the code works out a combination to open a vault. It works well without a while loop but i want a loop where: 1. The first …

Member Avatar for Anima Templi
0
249
Member Avatar for Marcello_1

What I am trying to do is create a form that is automatically generated and then the values from that form are then used to proceed in the program. Currently to generate my form I am using this function `real_names=["Jason","Casandra"]` this portion of the code is not static it is …

0
168
Member Avatar for SumTingWong59

I am having difficulty with a program in my CS class right now and I am wondering if you guys could help. Basically, I need to find the length/width (should be equal) of the 4 corners(I'll call this variable 'x') of a piece of cardboard, to cut them out to …

Member Avatar for SumTingWong59
0
145
Member Avatar for Guillermo_1

import xlrd import re workbook=xlrd.open_workbook('planningSpreadSheet_20140120T124023_20140203-20140209.xls') sh=workbook.sheet_by_index(0) palabras=str(sh) for col in range(sh.ncols): for i in range(sh.nrows): caca=sh.row_values(i) print(caca) Hi , i try to do a seeker, read an xls file ,and find a word,(input()),and show all the content of the row

Member Avatar for BearofNH
0
183
Member Avatar for Tcll

so here's what I want to do: import module mvar = module() I've seen it done with the PyQt modules, but I don't feel like researching a complex code just to figure out a simple usage. :P anyone know how this works??

Member Avatar for Tcll
0
281
Member Avatar for zoro007

Hello, i want ask somthing about mysql in multi pages i hope someone help me and sorry about my English this code works good but there problem if i used it with this tybe sql = "SELECT * FROM emaillogs ORDER BY id DESC" cursor.execute(sql) results = cursor.fetchall() if page …

Member Avatar for zoro007
0
241
Member Avatar for Tcll

this is just as complicated as it sounds... but to try to simplify things, look at this image: http://lh4.ggpht.com/-_tyPL2KaJAQ/UIONlx4ZnBI/AAAAAAAAEJU/vU1429txSqk/s424/aglorithm.PNG I need the influence generation aglorithm's for both I1 and I2. here's what I currently have: http://lh5.ggpht.com/-_jX5pm2be18/UIMtH46GfoI/AAAAAAAAEIk/Btswj9Lw4iA/s640/DM%2520prg2.PNG please help I've been doing google searches for the bezier aglorithm, but havn't come …

Member Avatar for Tcll
0
124
Member Avatar for Tcll

so basically... what I want to do is identify the function calling the dynamically created/referenced class let's put this simple... I have 2 functions, both of which either create or reference the same class based on an input... this function then returns the class with specifically set parameters. (not an …

Member Avatar for Tcll
0
274
Member Avatar for Tcll

so basically... I have a dynamic memory sub-system that does this: d = bu32() # a value from dynamic memory (such as 2) print d print type(d) p = ref(d) # a pointer deref( p, bu16 ).set(10) # short *p = &d; *p = 10; //(not sure if correct) print …

Member Avatar for Tcll
0
244
Member Avatar for Tcll

first off, I hope it's not against the rules for me to request optimization... :x I've tried to write the code with my best understandings of python optimization (which isn't much). def ov( value, byte_size ): sign = False if value<0: value += 1; sign = True value = abs( …

Member Avatar for Tcll
0
176
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
744
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
801
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 james.lu.75491856

Web.py outputs 0.0.0.0:8080. On windows, localhost and 0.0.0.0 work. But on mavericks, localhost doesn't work! 0.0.0.0 works, though. Can someone explain what 0.0.0.0 is? Why does web.py say you can enter a ip and port in command line and it will run there? (You can't run on someone else's ip,can …

0
189
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
195
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
235
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
238
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
421
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
174
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
435
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

The End.