15,181 Topics
| |
A basic program which writes the user name who has logged in the windows machine: ###################### # User info # ###################### import os import datetime from time import strftime def foo(): usr_log = os.environ ['USERNAME'] sys_log = os.environ ['USERPROFILE'] current_time = strftime("%a, %d %b %Y %H:%M:%S") dt_str = str (datetime.date.today()) … | |
I'm trying to implement image processing s/w that requires me to implement an image enhancement module that performs various operations like Color, Contrast, Brightness, Sharpness manipulation on the same image. I've implemented a module but it works on the same (original) image and changes done are not reflected. Please help. … | |
Located in the upper, left-hand corner of the GUI window is a small "[COLOR=red][B][I]Tk [/I][/B][/COLOR]"; is it possible to get rid of this entirely? It is only a small detail, but a detail none-the-less that I wish to have control over in regards to the final product. I would also … | |
Below is en2.py code- # The Python Imaging Library # $Id$ # this demo script creates four windows containing an image and a slider. # drag the slider to modify the image. # from Tkinter import * from PIL import Image, ImageTk, ImageEnhance import sys # enhancer widget class Enhance(Frame): … | |
Hi, I'm good at PHP and want to learn **Python 3**. Do you know any online pdf book for me to download so I can start? I'm asking to those who can say "this is good one". I found myself googling but I have no idea if they are good … | |
Hi, I was reading about Python and spotted "it has high signal-to-noise ratio" bit. In general, what does it really mean? I read some stuff about it but no particular explanation for programming. Tahnsk | |
################################# # Learning to make a game # ################################# # An attempt to make a game # Each room will be described by a class, whose base class will be Room # The user will be prompted to enter a number, each number will be assigned with a Room in … | |
Because of [C++ code snippets not dealing with multiple +-](http://www.daniweb.com/posts/jump/1829367) in sequence (or even negative number) in expressions, I post this, as it is so much easier for me than C/C++. EDIT: Fixed signs together with '(' issues and '+' at beginning removing without lstrip, removed separate now unused '(' … | |
This is bit funny code as you can first read from this excellent response: http://www.daniweb.com/software-development/python/threads/427341/custom-types-in-a-simple-way#post1828718 why should you not use it, even it maybe feels useful. Anyway I got curious to see how type signature could be implemented, even using it would generally just be stupid way of slowing down … | |
Hello, Can someone please help me with a little problem that I am having splitting strings? I am trying to remove everything more than 2 - digits to the right of a decimal point in a string. For some reason I am not realizing my desired results. If you could … | |
I want to print the histogram of an image in the same window. The given code works fine with viewing the histogram through Windows Image Viewer(default program) but fails to print the required histogram and image in a frame. # RGB Hitogram # This script will create a histogram image … | |
| Hi, everyone. I am making a tic - tac - toe game and I am having some trouble. As you can see I have made good progress: from os import system a = "1"; b = "2"; c = "3"; d = "4"; e = "5"; f = "6"; g … |
I want to modify the sky to be grey but i want to be time gap between the two...but i dont know how to do it # Import a library functions called 'pygame' import pygame # Initialize the game engine pygame.init() # Define some colors black = (0, 0, 0) … | |
# This program runs a test of knowledge #First get the questions #Later this will be modified to use file io def get_questions(): #Notice how the data is stored in a list of lists return [["What color is the daytime sky on a clear day? ", "blue"], ["What i the … | |
I'm building an image processing appilcation..the problem is I'm not able to import separate scripts in my main script..I want to use them for various functions..but it shows an error.. can anyone tell me the correct procedure to import script defined for various functions.. ` from Tkinter import * from … | |
I have a question about a better way to do this as what I've written seems clunky. I'm trying to generate 2 variables here that will be used as the date in a BETWEEN clause in MySQL. In order to get the proper construction (YYYYMMDD) I am converting to a … | |
| Ok, I'm confused, what is the difference between print "stuff" and print("stuff") They both have the same output! |
| This is a goofy sentence generator I have made in python; it took about 5 minutes to get the code to work - but its working now so if your curious try it out! |
Hi, I am trying to write a code that will calculate easter date within a year range.The problem i have is that no matter what date i put either within or outside the range i get the same output.Here is the code #A programme to calculate date of easter def … | |
I'm trying to write a program that needs to detect key presses, which I've already done using this code I found online: TERMIOS = termios def getkey(): fd = sys.stdin.fileno() old = termios.tcgetattr(fd) new = termios.tcgetattr(fd) new[3] = new[3] & ~TERMIOS.ICANON & ~TERMIOS.ECHO new[6][TERMIOS.VMIN] = 1 new[6][TERMIOS.VTIME] = 0 termios.tcsetattr(fd, … | |
I have some files, consisting of end of day stock data in the following format : Filename: NYSE_20120116.txt <ticker>,<date>,<open>,<high>,<low>,<close>,<vol> A,20120116,36.15,36.36,35.59,36.19,3327400 AA,20120116,10.73,10.78,10.53,10.64,20457600 How can I create files for every symbol? For example for the company A Filename : A.txt <ticker>,<date>,<open>,<high>,<low>,<close>,<vol> A,20120116,36.15,36.36,35.59,36.19,3327400 A,20120117,39.76,40.39,39.7,39.99,4157900 (I don't want A.txt to contain the first line … | |
Hello. I am a python noob asking a probably obvious question. I am making sort of a question game, although its still in the debugging stage. The problem is below. (Way below) #A simple game of common knowledge. #Dependecies import time start = "" lv1 = False lv2 = False … | |
I've got an XML file that looks like this: <routingTable> <router> <id>1</id> <ip>1.1.1.1</ip> <nexthop>1.1.1.2</nexthop> </router> <router> <id>2</id> <ip>2.2.2.1</ip> <nexthop>2.2.2.2</nexthop> </router> </routingTable> With possibly more than two router entries as time goes on. What I would like to do, is take each router instance and throw it into a dictionary. This … | |
Hi everybody, Explain me please what I'm doing wrong. So I'm trying to create a database and store data, that I get from django forms. Everything looks fine, and when I manually check database it shows that it recieved a new row, however my browser gives me this message and … | |
I have the following code where I have several small problems. I have included some comments as I can't seem to get my 'pop up menu' button to work in order to retrieve the number of columns requested by the user. I then need to be able to get the … | |
Hi guys! I start using Python few days ago, for a game server ( it'a an online game ). I made a server for that game, I start it on my pc, and for do this I need to start Server.py too, or, it wouldn't connect to the server. I … | |
Hello everybody, I'm trying to improve an application i found at this link [Click Here](http://www.alcrypto.co.uk/satmap/tkinter-video.py) which can load and play a video file .avi or .ogg. My problem is as follows: I'm unable to load another video file though i have access to the dialog box. In addition to that, … | |
I have a group of files (A.txt, AA.txt etc) in the form A.txt : A,45,56,78,98,11,23 A,98,90,33,76,30,40 AA.txt : AA,65,76,34,76,98,12 AA,12,76,33,76,33,89 How can I quickly remove the symbol column (A,AA) from all these files using Python? (I want to use python because the number of txt files is 3200) Thank you. | |
I am in course that uses Gaddis' Starting Out With Pyton 2nd Edition. There is a problem in the course that asks use to write a program that would capitalize sentences that a user inputs. I have come up with a reasonable solution, but I have two major problems. The … | |
Hi, I know how to get the current active window in Python using PyWin32 api's . However, whenever I get the name of a particular window, I need to log the keystrokes in that window. How would I go about doing this ? Thanks, Raja. |
The End.