15,190 Topics
![]() | |
I've always loved games and decided to pick up dev as a new hobby. I'm aiming to do something like Johnny Lee and track head position for a VR display. I've heard it called frustum correction or the "portal effect". [URL="http://www.youtube.com/watch?v=Jd3-eiid-Uw"]Here is a link to see what I'm talking about.[/URL] … | |
I was looking for a StringBuilder type of thing to use in Python (I've been working in PHP, at work, recently, and cStringIO had momentarily slipped my mind), and found StringIO and cStringIO, but in doing so, I found a post that claimed that they both performed very poorly in … | |
Hi, I develop dynamic in-line assembler for python. Its very easy to use it from python and know you can optimize some routine in assembly language and use it directly from python. Its support both windows and Linux. If you are interest you can take look on web-page, [url]http://www.tahir007.com[/url] If … | |
like for a regular menu it would be: [CODE]def menu(list, question): for entry in list: print 1 + list.index(entry), print ") " + entry return input(question) - 1 items = ["bookcase", "sleeping dog", "couch", "closet", "rug", "door"][/CODE] [COLOR="Red"]How to create a menu to where when you entered 1 for bookcase … | |
![]() | Simple functions for binary-to-decimal and decimal-to-binary conversion :) |
I am trying (first python attempt) to pull information from a web page and store is for further use. Here is the code that opens the page and gets the information. [CODE] # -*- coding: utf-8 -*- #python from urllib import urlopen myfile = urlopen('http://192.168.0.1/stlui/user/allowance_request.html%20target=%22allowance%22').read() print myfile [/CODE] The following … | |
Hi, I'm trying to make a frontend for the compile module in python. Everything works just right, except when the file has mistakes in the code that lead to a syntax error. It does raise the invalid syntax error in the terminal, but instead of executing the block inside the … | |
Hi all, in a python script file, I am having a open statement and then i write a "50000" to that file. And then within the script i am writing a scp command that transfers the file to a remote machine. In the local machine if i check the file … | |
![]() | hello everybody! I have a main app, which imports another python file and uses its functions. my problem is now, that the external file itself needs some functions defined in the main app... if i copy the external files code and paste it into the main application, everything works fine, … |
Hi I writing a Python program to track and calculate the amount of money each of 8 customers spends on 12 grocery items. The code below works fine but The program also must congratulate the customer who spends the most money and offer that customer a $50 shopping spree.How can … | |
hi all, i need to get all the data in the list (which is posted in the form) and store it, separating each list item with comma's. Its really clear in the code...this is what ive tried so far..it doesnt compile and it seems to complain about this line of … | |
I would like to be able to create a list of all instances of a class. [URL="http://www.daniweb.com/forums/thread131805.html"]Another post[/URL] here described how to do it by appending to a list during the __init__ routine but since I am a real Python newbie (and even more of a newbie to classes) I … | |
Let Python do the work for you and figure out the roman numerals for a given integer. I have to ask you to keep the integer values somewhat reasonably low (from 1 to 4999), since roman numerals from 5000 on use characters with an overline and most PCs don't have … | |
I am calling: c = Counter() ...exactly as in the collections example code here: [url]http://docs.python.org/py3k/library/collections.html?highlight=collections#collections.Counter[/url] but it gives me this error: NameError: name 'Counter' is not defined Anyone know why? Note that I have 3.1.2 and yes I include "import collections". Thanks | |
[I]Now, I may have bitten off a bit more than I can chew with this promised program for my pops, but I am confident, with time, I can puzzle out a solution with some help! Background Info: My father is a doctor responsible for monthly schedules, usually penciled painstakingly on … | |
Hi, I have a very simple problem yet I can't find out how to do it for the life of me. I am creating a simple CGI script with Python and part of it needs a HTML form. This is what I have so far (excludes imports, etc): [code=python]font_size = … | |
Thus far, installing and getting Python 2.6 running properly on x64 Windows 7 has managed to be a fat pain in the butt. Latest in my saga of silliness, is that the PyDoc server doesn't run properly. Initially, I was getting "pydoc is not recognized as an internal or blah … | |
I have a series of files similar to that 1A2B_A.txt, 1A2B_2C.txt, 1A2B_DF.txt, 1B23_D.txt, 1B23_B.txt, 1B23_25.txt, and many more I want to combine each three files starting with the same four code before the "_" Thanks in advance | |
I am working on the folowing code, which basically counts every letter in a given text. I want to store the numbers in letter names: A=1 B=3 and so on... I guess it stores the number underthe name 'letter', but not under the corresponding letter 'A'. It would be great … | |
Hi guys ! I am willing to ask you if you could think of a py script that loads a text file and just joins the data contained in there following this example This could be an input: ssms smsmsms sksksskkks ppppplkl ndndndnd kdkdkdkdkppp And this an ouput: ssmssmsmsms sksksskkksppppplkl … | |
Hallo everyone at DaniWeb :) A made a mail script, that i need to somehow break, to close the connection to the gmail server securely. Can someone give me a hint, what to do for that. [CODE] import smtplib import urllib2 import time def sendIP(): # fetch pub ip pub_ip … | |
How do you make Python distinguish from files and folders if they are dragged and dropped into the program's window? [CODE] import os import string newDrag = raw_input("Drag and drop the file or folder you want to add.\n") newStrip = newDrag.strip('"') #Removes the quotes Windows randomly adds for some reason … | |
What's Up? OK, So I've been scripting (Some what) my first Python project, Host.py & Guest.py: Host.py listens for sockets connections on your computer, While Guest.py connects to Host.py and sends some text. Now yesterday a light bulb appeared above my head & I instantly got a thought ''What If … | |
Hi, i was wondering if someone could help me out here. from the below code i get the following error "TclError: couldn't open "H:\SDD12\Images oses.gif": no such file or directory" but i dont understand why the r is vanishing from the filename... [CODE] root = tk.Tk() root.title('background image') # pick … | |
Hi all , I got two questions : How to convert the time of a message from "127558161.23" to 03/06/2010 12:42pm ? When I receive a message and I want to know the number of the sender so I can resend him a message it returns me his name - … | |
hi I have a problem with the following code ... [B][COLOR="Blue"]>>> j = win32pipe.popen('c:\\disk\\plink jnitin@10.94.101.178 -pw mat123 df -g','r') >>> for i in j: print i >>>[/COLOR][/B] As you can see the file object 'j' does not have anything in it... But if I type [COLOR="Purple"]'c:\disk\plink jnitin@10.94.101.178 -pw ibm123 df … | |
i want to use input validation so that the user can only input decimal numbers. can someone help [CODE] while int_x != : #this is where im having the problem print "the number entered must be a decimal number" int_x = input("Enter a decimal number:") [/CODE] | |
Hello! I am trying to display a FITS image, if your not familiar with the extension its fine (gtk.Image.new_from_file() isn't either). I can get my image data to a numpy array (2D (256x256 to be exact)) I am having the most difficult time getting this into a grayscale image. I've … | |
Hey all, I've been experimenting with a basic chat server/client from my Python textbook, in efforts to keep the code clean and simple I think some optional code was omitted and it's made the books example a little buggy. I've been having troubles with the line: [CODE]transmission = self.request.recv(1024)[/CODE] This … | |
Here is solution number one for one word anagrams, I gave in discussion thread, response time in my humble Athlon PC under 70 ms. List of words is from original posting of the discussion thread. [url]http://www.daniweb.com/forums/post1206616.html#post1206616[/url] This version does not give we'd for input dew. Next time I give final … |
The End.