15,181 Topics

Member Avatar for
Member Avatar for letlet_pogs

Hello guys. I just want to ask how to convert this code to python. I am just a beginner in this code. [CODE] String output = "The number is: "; int num= 12; output+=num; System.out.println(output); [/CODE] in my python code, i try to do this: [CODE] output = "The number …

Member Avatar for sneekula
0
111
Member Avatar for lewashby

In the following code, I don't understand the line , [COLOR="Red"]print tank_name, tanks[tank_name].[/COLOR] What I'M having trouble with is it seems a little redundant, print thank_name, then thanks(the name of the dictionary), then tank_name again. And why is the second tank_name in "[]" like a list? I can't remember, is …

Member Avatar for sneekula
0
104
Member Avatar for yoni0505

I'm trying to learn how to send forms using python 3.1 and it doesn't go well. I've made a simple site with a POST form. it got user and pass fields, and it will save the data into a text file. (for debugging) The site is working, I can type …

Member Avatar for sneekula
0
221
Member Avatar for lewashby

In the following program, what is the "values" function? [CODE]for tank in tanks.values(): if tank.alive: print tank.name, "is the winnter!" break[/CODE] I looked it up using Wing IDE and this is what I found. [CODE]def values(self, arg): """ D.values() -> list of D's values """ return [][/CODE] Thanks for any …

Member Avatar for sneekula
0
71
Member Avatar for Kruptein

I have a base template which is called every time a template is loaded with the [icode]{% extend 'base.html' %}[/icode] tag In that base file I have a navigation bar with a link to your inbox I want to show after the link a number with how many unread messages …

Member Avatar for Kruptein
0
87
Member Avatar for mbox_96

Hi, I'm trying to communicate to a GSM using AT commands and I found xebec module from 'http://sourceforge.net/projects/xebec/' use to communicate to cellphone and GSM, can anybody help me create simple script using this module , like sending "AT" and returns the "OK". Thanks, mbox_96

Member Avatar for Stefano Mtangoo
0
65
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
206
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

The End.