15,175 Topics

Member Avatar for
Member Avatar for pigmalion

Hi everyone, I'd like to create a child class to the date class in the datetime module and, apart from adding some new methods to it, I'd like my child class to be initializable through different argument arrangements. For example, beyond the (year, month, day) initialization arguments of the parent, …

Member Avatar for pigmalion
0
84
Member Avatar for SoulMazer

Hi, I'm trying to add an icon to my Tkinter GUI window and have had no luck. After some searching, I came up with the same piece of code which does not work. Here is a snippet of my code: [code=python]from Tkinter import * root = Tk() root.minsize(290, 700) root.title("My …

Member Avatar for SoulMazer
0
23K
Member Avatar for johnyboy82

Hi I am having problems using [B]subprocess.Popen.[/B] Here is a small script I have written [CODE]from subprocess import Popen import os global p def executeProcess(): cmd = "ls -l /home" global p p = Popen(cmd) #os.system (cmd)[/CODE] This works only once in a while. I keep getting the error [CODE]Traceback …

Member Avatar for woooee
0
129
Member Avatar for leegeorg07

Hi, I am trying to make a sublime text plugin that will compile some C code, but it uses python for these plugins. I already have a method of using g++ for single files, but I was wondering if anyone knows how to do it for a make file, here …

Member Avatar for leegeorg07
0
149
Member Avatar for leegeorg07

Hi, I'm trying to find an open source project to strect myself with, I have looked on bitbucket and couldnt find anything, any suggestions? Thanks in advance.

Member Avatar for leegeorg07
0
112
Member Avatar for mahela007

How can I make windows execute a python script when a flash drive is plugged into the computer? Is there a way to do this with python or do I have to use windows?

Member Avatar for mahela007
0
11K
Member Avatar for mordicaii

I can't load an image with Pygame, I've called pygame.image.get_extended and it returns false, is there any way I can fix this? What's even stranger, is that it was working earlier today. I don't remember doing anything to Python, Pygame, or OS X.

Member Avatar for vegaseat
0
173
Member Avatar for rehber344

hi everyone ı am a new begıner . why and when do we have to use "None" for example if x. is None: or at the definatıons def lookfor(a, b=None): return a, b why and where are we usıng None.whats the aım to use that and my other questıon ıs …

Member Avatar for hondros
0
121
Member Avatar for SoulMazer

I'm trying to bind a Tkinter widget to a method in another file. I'm not quite sure how to do this, but let me show you what I have so far. [code=python]#!/usr/bin/python # File1.py from Tkinter import * import File2 class MyFile: def __init__(self): master = Tk() obj = File2.DoStuff(master) …

0
68
Member Avatar for emir_gradacac

Hi, I would like to ask is it possible for pygame to respond on a key press immediately? I am trying to make a drumming simulation and the response comes after 1-2 seconds. The code is: [CODE]import pygame, sys from pygame import * pygame.mixer.init() pygame.init() #Loading sounds... snare = pygame.mixer.Sound('Snare.wav') …

Member Avatar for Lardmeister
0
419
Member Avatar for tigrum

Hello, I am currenty using MySQL 5.1 community server and trying to import the data of the comma delimited text file into the table using python 2.6 scripts. I have installed Mysqldb 1.2.2. follwoing is my script: [CODE] import MySQLdb, csv, sys conn = MySQLdb.connect (host = "localhost",user = "usr", …

Member Avatar for octav1
0
4K
Member Avatar for SoulMazer

Okay, well I have to say I am completely stumped where to go from here. I am writing a media player and I am currently working on song indexing. I have figured out how to extract the song name and its complete path using os.walk(); however, I have no idea …

Member Avatar for SoulMazer
0
109
Member Avatar for Ash_Pokemaster

Hello pals. We're having a project to make a Backup and Restore program in Python. As we think that making a GUI is of course very important, we started using Tkinter after initially trying wxPython which was kind of difficult given the time we had. Either way, we made a …

Member Avatar for Ash_Pokemaster
0
2K
Member Avatar for punter999

i want to create an editor GUI in wxpython with all the menu bar options and other things.kindly let me know if something similar has already been done or not if yes please let me know some of the dummy example so i can get an idea how to start …

Member Avatar for vegaseat
0
123
Member Avatar for deonis

Hello ! I'm trying to create the dictionary which would handle Latin characters like (Å), µ and so on. Apparently I'm require some sort of encoding to Unicode. Is there a way to handle this problem? see code bellow [CODE] wordDic = { '_chemical_formula_moiety': 'chemical formula ', '_chemical_formula_weight': 'Fw ', …

Member Avatar for deonis
0
205
Member Avatar for flatree

I am fairly new to Python and I am trying to understand how list comprehension works. I start with a list of nested lists (lis1), make a copy using list comprehension to give lis2 (in the function scan()). I use a for loop on lis2, to change the first item …

Member Avatar for snippsat
0
81
Member Avatar for sapi

Hey I'm trying to implement click-and-drag functionality on a frame (or, in this example, an image - but same difference). I need this because I want to run the app with wx.BORDER_NONE, which means no neat titlebar to drag. The code I'm using at the moment is this: (ignore the …

0
60
Member Avatar for fferrandini

Hi great ones, i have a form that i save employees photos to server and URIs to DB. Doing some tests yet. I can save in the server without no problem. the javascript callback function aint being fired .. dont know why; below is the code.. i appreciate any help …

Member Avatar for fferrandini
0
118
Member Avatar for mehdi0016

hi i want to create menu with icon beside it, but i don't know how and with which gui lib is it possible? please help me.

Member Avatar for mehdi0016
0
101
Member Avatar for fferrandini

Hi folks, I dont need any code snippet, but at least i need somebody to lead me to a solution. I got an app form that will have personal info from employees, and i need to let them pick a photo from filesystem to attach to this form. what i …

Member Avatar for vegaseat
0
164
Member Avatar for vlady

Hi everybody, Pls give me sb. a hint. I do this following exercise but I struggle with reading another lines of txt. Here is the text: Exercise 9.1 Write a program that reads words.txt and prints only the words with more than 20 characters (not counting whitespace). here is my …

Member Avatar for vlady
0
4K
Member Avatar for eva yang
Member Avatar for eva yang
0
95
Member Avatar for GihanFernando

Hello all, I would really appreciate help with this seemingly basic problem. Here is my code; [code]import wx import FloatSpin as FS class DesignConditions(wx.Frame): def __init__(self,parent,id): wx.Frame.__init__(self,parent,id,'Design Conditions',size=(1000,700)) panel = wx.Panel(self) wx.StaticText(panel,-1,'Atmospheric Temperature (K): ', (25,150)) wx.StaticText(panel,-1,'Atmospheric Pressure (kPa): ', (25,200)) wx.StaticText(panel,-1,'Mach Number: ', (25,250)) wx.StaticText(panel,-1,'Ratio of Specific Heat Capacities …

Member Avatar for vegaseat
0
106
Member Avatar for mahela007

I was using the datetime module for the first time today. When I typed [CODE]now = datetime.date.today() now [/CODE] I got the output [CODE] datetime.date(2009, 12, 27) [/CODE] Now, I found out that [CODE]datetime.date[/CODE] is a class and that[CODE] datetime.date.today[/CODE] is a method. But I can't figure out what the …

Member Avatar for snippsat
0
1K
Member Avatar for xvalentinex

Okay python gurus, this one has me stumped. Is it possible to introspect and obtain the instance of a class that assigned a class? I have a simple sample that demonstrates what I'm looking for, but doesn't make any sense why you would do it. [code=python] class One(object): def print_parent_hw(self): …

Member Avatar for xvalentinex
0
87
Member Avatar for Stefano Mtangoo

Hi, Iam now using Mandriva from external HDD and want to install my development tools. I need to install wxPython, Matplotlib, and some other packages. How to do that in Mandriva?

Member Avatar for Stefano Mtangoo
0
146
Member Avatar for vegaseat

This is an update of an earlier version. In this version the string containing the approximated pi value is created directly from the iteration of the generator. This way the program is simplified and can be used with Python2 and Python3 ...

1
560
Member Avatar for deonis

I am trying to develop a function for my application which would use already opened file (fin) and read certain line from it. Each line in the text starting from given keywords (pos1). Finally this function should return a print of all line containing the keywords pos1. But apparently "linecache" …

Member Avatar for deonis
0
270
Member Avatar for hdk

Hi All, I am very new to python Gui programming and am trying to create a simple Gui which will get a set of results from an sql query which goes into Oracle and display these results in the text box below. If u can also help me get the …

Member Avatar for Stefano Mtangoo
0
349
Member Avatar for lewashby

In the following program, why do I need to use the name "player" rather than a regular counter like "i"? I ran the program this way and it prints out the last element in players for how ever many player elements are in players. I want to know what's going …

Member Avatar for jcao219
0
108

The End.