15,406 Topics

Member Avatar for
Member Avatar for StrikerX

Hi, I was wondering, how to use python in Visual Studio.NET or Sharp Develop ?? free software i hope :) Writting GUI is great when it's just drag & drop . Thanks in advance.

Member Avatar for Ene Uran
0
127
Member Avatar for Zorbie

Okay, I'll be honest right up front, I'm in a first year Python class and this is a question I'm supposed to write a program for. Here's the question: "Write a program that continually reads in numbers from the user and adds them together until the sum reaches 100." Here's …

Member Avatar for jrcagle
0
273
Member Avatar for Mouche

I know printing primes isn't anything new, but (like always) I'd love to hear some feedback on how I can make my code more efficient and other constructive criticism. [php] def print_primes(r=10): primes = [ ] for i in range(2,r+1): prime = 1 for divisor in range(2,i): if i % …

Member Avatar for arsham
0
141
Member Avatar for fredzik

Hi, The last time I posted I think I asked too many questions and the main reason that I posted got lost somewhere amongst other side issues. The main reason I posted last time is the following: # The following code is not a game, it is configured just to …

Member Avatar for fredzik
0
126
Member Avatar for Matt Tacular

[code]str1 = 'c:\documents and settings\user\desktop' str2 = 'starcraft.exe' print str1[/code] I would like to know how it would be possible to add str2 to the end of str1 with a "\" inbetween the two strings. so that I end up with "c:\documents and settings\user\desktop\starcraft.exe". Thanks

Member Avatar for ghostdog74
0
184
Member Avatar for Matt Tacular

[code]############################################################################ # # # This program seeks out every copy of "starcraft.exe" in the computer # # and deletes them. # # Created by Matt in Python 2.5 May 2007. # # # ############################################################################ import os def file_find(folder): """search for a filename fname starting in folder""" for root, dirs, files …

Member Avatar for jrcagle
0
111
Member Avatar for time4biking

I am writing a program to ssh into another computer on our network. However with the commands ssh, scp etc... terminal requests the password and os.system() seems to open a new terminal window each time it is called. This makes it difficult to enter the password. I have been looking …

Member Avatar for BearofNH
0
127
Member Avatar for Blujacker

Hi, this is my code: [code] # -*- coding: cp1250 -*- import wx class Okno: def __init__(self,parent=None,id=wx.ID_ANY,title="Graf"): self.okno=wx.MDIChildFrame(parent,title="Graf",id=-1) self.okno.Maximize() self.okno.SetAutoLayout(True) self.okno.SetBackgroundColour("#FCFCFE") self.sizer = wx.FlexGridSizer(2,2,0,0) self.canvas = wx.ScrolledWindow(self.okno, id=wx.ID_ANY) self.canvas.EnableScrolling(True, True) self.canvas.SetScrollbars(20, 20, 1000/20, 1000/20) self.sizer.Add(self.canvas, 1, wx.EXPAND) self.sizer.AddGrowableRow(0, 1) self.sizer.AddGrowableCol(0, 1) self.okno.SetSizer(self.sizer) self.canvas.Bind(wx.EVT_PAINT, self.OnPaint) def OnPaint(self, event): pass if __name__ …

Member Avatar for Blujacker
0
197
Member Avatar for pyarticles

Hi all I created [URL]http://pyarticles.blogspot.com[/URL] for Python knowledge. Let's check it out please

Member Avatar for vegaseat
0
64
Member Avatar for bumsfeld
Member Avatar for vegaseat
0
2K
Member Avatar for Banter

I decided to sign up because I want to learn python and possibly other programming languages. This forum seemed appropriate. have a good one!

Member Avatar for Banter
1
49
Member Avatar for wandie

I was wondering if you could help me out. I have a list box that has seltext and every time i want to select another item in the list it adds on. for example i select "/hello" then it appears as "/hello" but then i select something else it will …

Member Avatar for LouLouLou
0
166
Member Avatar for StrikerX

hi guyz, i'm a Python user (not so long) , anyway i've read some stuff about lua . i've written function like this [code]def pair(dic = {} ): return dic.keys(), dic.values()[/code] a dictionary is a parameter to the pair function . to use it like this : [code]dic = {1 …

Member Avatar for StrikerX
0
152
Member Avatar for trihaitran

Hi, I'm writing a dictionary program with Turbogears that involves using Chinese text. There is an HTML form that has a dropdown menu, a text field and a button. The input from the form (in this case a Chinese character) is passed to one of my methods. The thing is …

0
61
Member Avatar for 7even

I have a problem with tree control and i don't know how to solve it, maybe someone can help me. What i'm trying to do is display widgets in a staticbox plus a help text when i select different items in a tree. For example when i select item1 in …

Member Avatar for vegaseat
0
223
Member Avatar for lineman60

so when i run this in python interpiter it works [CODE] >>> import os >>> b= os.path.getsize("/path/isa_005.mp3") >>> b 2071611L >>> [/CODE] but when i run it in a script [CODE] b= os.path.getsize("/path/isa_005.mp3") FILE.writelines(b) [/CODE] i get an error. any one know how i can get it to print the …

Member Avatar for mawe
1
558
Member Avatar for Gumster

Well im having a little problem with some tuples or more so about defining which tuple [CODE=python] #Start of my tuples Rock = ("Scissors","Fire","Snake","Human","Wolf","Sponge","Tree") Fire = ("Scissors","Paper","Snake","Human","Tree","Wolf","Sponge") Scissors = ("Air","Tree","Paper","Snake","Human","Wolf","Sponge") Snake = ("Human","Wolf", "Sponge", "Tree","Paper","Air","Water") Human = ("Tree","Wolf","Sponge","Paper","Air","Water","Dragon") Tree = ("Wolf","Dragon","Sponge","Paper","Air","Water","Devil") Wolf = ("Sponge","Paper","Air","Water","Dragon","Lightning","Devil") Sponge = ("Paper","Air","Water","Devil","Dragon","Gun","Lightning") Paper = ("Air","Rock", …

Member Avatar for jrcagle
0
104
Member Avatar for trihaitran

Hi I'm trying to start learning how to use Turbogears but I can't figure out how to install sqlite on my computer. I'm running Mac OS 10.4 and there are no precompiled binaries on the sqlite [URL="http://www.sqlite.org/download.html"]download[/URL] page for the Mac. They do list a cross-platform binaries that is stated …

0
74
Member Avatar for Lapinbriac

My problem may be very simple. I want to use a Tkinter window to show informations to the user, so that he could enter his answers to the Python Shell. The problem is that when the Tkinter Window appears, the Python Shell will no longer receive any command before I …

Member Avatar for aot
0
189
Member Avatar for Lapinbriac

Hello, I would like to save the drawings I have made on a Canvas with the Tkinter Module. Is it possible to make a .jpg or .gif or .bmp from a Tkinter window ? Thank you!

Member Avatar for vegaseat
0
164
Member Avatar for fredzik

G'day, Back again, this time with three problems. The code below contains a white entry box that I'm trying to get rid of. The main reason I'm trying to get rid of it is that the game I'm working on has a scrollable GUI, and with 50 or so frames …

Member Avatar for fredzik
0
2K
Member Avatar for vital101

Hey everyone, I've recently needed to use python to retrieve a cookie from someone visiting my web site. This is all needing to be done server-side, so I will (i think) need to use the Cookie module. I've looked online everywhere, and I'm having a hard time figuring out exactley …

Member Avatar for vegaseat
0
89
Member Avatar for aot

So I would really like to use Python to play some sound files -- it doesn't particularly matter what format, as they're just going to be basic "ping" type noises. However, it seems like whatever advice I find doesn't work out for my situation -- most modules seem to be …

Member Avatar for aot
0
99
Member Avatar for jwjazz

Why does entering the expression 011 evaluate to 9? and 0111 = 73, 01111 = 585, and so on.

Member Avatar for sneekula
0
111
Member Avatar for jwjazz

This function is part of a program to convert numbers between different bases. [code=language] num = 32 b1 = 10 b2 = 2 x = 1 def increasex(num,b2,x): if num%(b2**x) < num: x = x+1 increasex(num, b2, x) else: print x return x print increasex(num,b2,x) [/code] The parameters are the …

Member Avatar for jrcagle
0
138
Member Avatar for leonardo01

Over the past two weeks I have let a lot of negative thoughts creep into my mind and has resulted in the feeling of being lost. I'm working on my visualization again and trying to get back on track. Any suggestions, tips, tricks etc on how to remain in line …

Member Avatar for elizabeth_7w
0
98
Member Avatar for qwerty__123

Hey, I'm having trouble with an exercise from a book, here it is; " Write a program that reads the values for a random list of card from a file,(cards.txt) where each line in the file represents a single card with the rank and then suit seperated by a space. …

Member Avatar for bumsfeld
0
104
Member Avatar for thian_seng

Hi all, Can I know if there's any other way to load and call functions inside a dll, besides using ctypes module? Thanks...... Best Regards Vincent

Member Avatar for bumsfeld
0
90
Member Avatar for nam5a

I was wondering if there is something in python similar to the begin expression in Scheme, and if not how would you write something in python to simulate it.

Member Avatar for nam5a
0
115
Member Avatar for chris99

I've successfully made an engine for a point and click game, but I want to know how to put subtitles so you know what the characters are saying. All I know is how to parent text to a background, do I just need to make an invisible layer with a …

Member Avatar for chris99
0
145
Member Avatar for dwrick

I am new to python and Tkinter. I was trying to build an addressbook for my class. I have the Tkinter GUI looking good - nothing fancy. Now I can't get my python part working. I want to keep the GUI in its own class and file. My two files …

Member Avatar for vegaseat
0
1K
Member Avatar for olufunkky

Please I need help with the following exercise: 1.Write a program that continually reads in numbers from the user and adds them together until the sum reaches 100. Write another program that reads 100 numbers from the user and prints out the sum 2. Write a function that implements Euclid's …

Member Avatar for olufunkky
0
292
Member Avatar for nam5a

How would you write a begin procedure in python that would be analogous to the scheme expression.

Member Avatar for nam5a
0
67
Member Avatar for fidolip

Hi! Probably that's gonna be absolutely no0b question, but I have to ask it: Say, I have two files, program.py and GUI.py. I have to launch the GUI from the program.py file, i.e. I have to call main function of GUI.py file from within the program.py. Could someone tell me …

Member Avatar for fidolip
0
30
Member Avatar for wandie

How do i take results in a mutli dim array and write it to a text file. Each sub array goes on a new line. I am a newbie at this. [code] [[2934110, 'B1', 'D4', '7C7C7C7C804040404040F140404000'], [2934110, 5, 1, 1, '01', 'Actes Sud '], [2934110, 4, 1, 2, '8C00Dubbelganger (motief)'], …

Member Avatar for wandie
0
104
Member Avatar for Blujacker

Hi I am trying to get the mouse position on my Canvas [code] # -*- coding: cp1250 -*- import wx class Okno: def __init__(self,parent): self.okno=wx.MDIChildFrame(parent,title=u"Náhled situace",id=-1) self.okno.Maximize() self.okno.SetAutoLayout(True) self.okno.SetBackgroundColour("#FCFCFE") self.sizer = wx.FlexGridSizer(2,2,0,0) # Add canvas self.platno = wx.ScrolledWindow(self.okno, id=wx.ID_ANY) self.platno.EnableScrolling(True, True) self.sirka = 10000 self.vyska = 10000 self.platno.SetScrollbars(20, 20, self.sirka/20, …

Member Avatar for Blujacker
0
243
Member Avatar for fredzik

Hi, I'm puzzled by how one positions in Tkinter. Take a look at the following code: [code=Python]print "...................................Hello, world!"[/code] This works fine in the Main Idle but when it comes to Tkinter I'm confused:confused: . The game I'm working on has about 30 "clues" dotted all about the screen. About …

Member Avatar for fredzik
0
141
Member Avatar for thian_seng

Hi All, Urgent SOS!!! I developed my project using pyton 2.5 under winXP and had an issue in loading my dll if the target user is using Win2000. Initially, I thought it was caused by the dlls I created were not compatible with Win2k. Then, I wrote a simple MFC …

0
50
Member Avatar for fredzik

G'day, I've worked on your code Vegaseat and have come up with the following rough sketch of how my game will look in the end: [code=Python]# using geometry manager Tkinter.Place for layouts # tested with Python24 vegaseat 28apr2007 import Tkinter as tk import random as rn #help('Tkinter.Place') root = tk.Tk() …

Member Avatar for fredzik
0
122
Member Avatar for Python23

hello, I was wondering if I could recieve some help? The function I am writing is called pyramid, it consumes a number and produces stars(*) from 1 to that number. For example pyramid(5) would be: * ** *** **** ***** so far I have a function that does that backwards …

Member Avatar for Python23
0
453
Member Avatar for fredzik

Hello every1, I've been googling about but can't seem to find a solution to the following problem: [code=Python] print "Hello world"[/code] How does one colourize the "Hello world" in the results. It can be any colour as long as it's not the standard blue. Also I need to know what …

Member Avatar for fredzik
0
143
Member Avatar for TheBouncer2006

Hello everyone. I have worked with Windows for a number of years however I want to take my knowledge to the next level and do not know the best approach let me explain. I recently got a book "Rootkits subverting the windows Kernel" I got this book because my best …

0
36
Member Avatar for caranjo

Hello all, Need some urgent help with generating Pydoc documentation I have three .py files (a.py, b.py, c.py) on my Desktop I would like to generate the HTML Pydoc for each of these files and place the generated Pydoc onto my Desktop. I just need help running the commands from …

0
63
Member Avatar for sliver_752

How do i put a Button indside the cell of a ListControl in wxPython. Thanks in advance.

0
59
Member Avatar for iluvblender

Hello Folks. This is Satish and my first post on DaniWeb. :) Ok. now that the formalities are over, lets get to business.:cool: I am writing a custom image viewer for Blender using Python+OpengGL. This script runs inside blender window. You can find the status of my project at the …

0
49
Member Avatar for jtxay

Hello, well i have written some code to try and simulate rolling a dice.. my program has to be able to play craps... here is how it should be played.. In a nutshell craps is played with two regular dice. You win a round of craps if your first roll …

Member Avatar for mawe
0
119
Member Avatar for Jellomaster

I need help with a program I am making it creates window but doesn't display buttons aor text controls [code=python] import wx import MySQLdb db = MySQLdb.connect(host="localhost", user="root", passwd="Hornets71", db="soul_society") cursor = db.cursor() class MainWin(wx.Frame): def reg(): number = self.numtxtctrl.GetLineText() name = self.nametxtctrl.GetLineText() uid = self.uidtxtctrl.GetLineText() cursor.execute("INSERT INTO member_list (number, …

Member Avatar for jrcagle
0
83
Member Avatar for atetrault

All, New to python programming so bare with me but I haven't quite seen an easy way to do this and looking for some suggestions. I want to be able to replace some contents of an [B]exisiting[/B] file either by both inserting new statements or modifying/replacing new ones withiout touching …

Member Avatar for jrcagle
0
328
Member Avatar for fredzik

G'day, First of all a very big thank you to both Jeff and Vegaseat for their great help...but sadly :icon_sad: it's not what I needed. Being a novice at Tkinter I did not realize what Tkinter was and was not capable of and I therefore blame myself :icon_redface: for any …

Member Avatar for fredzik
0
888
Member Avatar for muddpigeon

ok so i got the last part finished and working now for the bit i havent done before at all. instead of the pickle file the customer data has to be read in from a data base i have been supplied with the data base and the code but i …

Member Avatar for katharnakh
0
137

The End.