15,194 Topics

Member Avatar for
Member Avatar for triksterx

Hi everyone. Let me start by saying I have managed to learn quite a few things and solve pretty much any python problems using this site. So thanks to everyone who contributes to these forums. Now for my problem. I am having a hard time getting the .grid method to …

Member Avatar for woooee
0
1K
Member Avatar for TrustyTony

I have left my source of information as docstring comment on code side. If you want to solve the problem yourself do not run the code. This code actually gives the correct answer. I have not reacted to the border case comment in my formula source as it is quite …

0
1K
Member Avatar for MasterMic

I've taken 1 course in Java and 1 in C++ and now I'm tinkering with Python (love it so far). My module I'm currently working on is designed to solve a certain puzzle. To understand the code you'll need to understand the puzzle: There is an upside down triangle with …

Member Avatar for MasterMic
0
269
Member Avatar for AnaR

Hi, i would like to put some icons over desktop and these launch apps. It's necessary to use xlib with python, and i'm lost. thanks in advanced

Member Avatar for AnaR
0
241
Member Avatar for _neo_

I need to convert this C code to python. void GetChkSum(Int len, PSTR buf, PSTR res) { memset(res, 0, 4); for(int i=0; i<len; i+=4) { res[0]^=(buf+i)[0]; res[1]^=(buf+i)[1]; res[2]^=(buf+i)[2]; res[3]^=(buf+i)[3]; } res[0]=~res[0]; res[1]=~res[1]; res[2]=~res[2]; res[3]=~res[3]; } In my case, buf is bytes object. for example: buf = b'00000001TXBEG 0000' len is …

Member Avatar for _neo_
0
320
Member Avatar for tckotb

Please help, when i try to use keybd_event in my python script, it is not recognized by an emulator. [CODE] user32.keybd_event(0x43,0,0,0) [/CODE] It fails to be recognized by an emulator, but it works in browsers etc., so a game like playbiolab.com works just fine.

0
45
Member Avatar for ytrewq1

Hi, I have generated an array of random numbers and I'm trying to then write this array to a .txt file but the code I have written doesn't seem to do this correctly. Any help on this would be great. Here is what I have so far: import numpy as …

Member Avatar for snippsat
0
22K
Member Avatar for gunneronaspooky

Ok folks...more help with a programming class... I'm seriously starting to think programming is not for me, but I just want to finish out this class with a decent grade. I'm not looking for answers...just some guidance in the right direction. Here is the problem... As an exercise, write a …

Member Avatar for woooee
0
113
Member Avatar for sohel807

Following scripts makes logs first, and then can be printed. What should be the way I can print from the frame directly assuming I have printer in place? [ICODE]import wx import os.path class MainWindow(wx.Frame): def __init__(self, filename='noname.txt'): super(MainWindow, self).__init__(None, size=(400,200)) self.filename = filename self.dirname = '.' self.CreateInteriorWindowComponents() self.CreateExteriorWindowComponents() self.log= open("foo.log",'w+') …

0
73
Member Avatar for Boubakr

Hi... I've this: [CODE]random_name = ['Mohamed', 'Ahmed','Aboubakr'] print "1: %s 2: %s 3: %s" % (random_name[1], random_name[0], random_name[2])[/CODE] I want to print all the three names but in random way, as: some time: Mohamed, Ahmed, Aboubaker and some time: Mohamed, Aboubaker, Ahmed and some time: Aboubaker, Ahmed, Mohamed and some …

Member Avatar for TrustyTony
0
153
Member Avatar for rebo544

Hi so i created a function that asks users to input their grades for a course and theoretically it should post all of the results and then the grade for the course. I have so far been able to create a function that asks the user for their information and …

Member Avatar for richieking
0
129
Member Avatar for sohel807

I want to make a simple editor using wxPython. Complete code is already available in wxPython tutorial page ([url]http://wiki.wxpython.org/WxHowtoSmallEditor[/url]). However, in addition I want to add "print" menu which will print the contents of editor (i.e., whatever written in editor). I will appreciate if someone please show me. Thanks, Akand

Member Avatar for richieking
0
423
Member Avatar for gunneronaspooky

I'm just trying to come thru with a passing grade at this point because there was no instruction. I can't even get the program that was given to me to work, even though I copied it verbatim from the text. Please help me figure out what the error is so …

Member Avatar for -ordi-
0
139
Member Avatar for joywheels

Hi everyone, I am going through a self-paced class for Python beginners and have ran into a dictionary problem that I can't figure out. I'm creating a set of words from user input. Then send those words to a dictionary that adds a key for when the word is first …

Member Avatar for TrustyTony
0
131
Member Avatar for blenkhn

I have been trying to no avail to load a ui file and insert it into a tabWidget as a new tab. I commented out a try that I thought would work, I was wrong. I have tried several different ways but I always seem to get the same error. …

Member Avatar for blenkhn
0
892
Member Avatar for zizuno

I may have phrased the title wrong but it is what I mean. I am not looking for multiple windows at once, I am writing a script that opens a tkinter window asking for information etc etc etc and it all saves into a database after the last window. Right …

Member Avatar for TrustyTony
0
672
Member Avatar for pythonn00b

Implement a function punctuation() that takes no parameters, inputs a string from the user, and prints all of the punctuation characters appearing in the string, in order from left to right. My coding I have so far is: def punctuation(): a = raw_input("Please enter a string:") check = ['!', ',', …

Member Avatar for snippsat
0
380
Member Avatar for benqb

Iam using [color=#FF0040]import paketlogic2[/color] in my project when i hosted that project in webserver i got the following error [color=#FF4000]Couldn't connect to PacketLogic: cannot import name PLv11[/color] why?

0
51
Member Avatar for aint

Hi, I have many files made by a software. I want to extract some data from those files, and when I open the file with textedit, I see that what i need is on the first line. i have many of these files, and when I run the script, it …

Member Avatar for aint
0
134
Member Avatar for blagoblg

Hi. I want to draw something like graph in 3D. I wrote this for its points (vertices):[CODE]import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import numpy as np fig = plt.figure() ax = Axes3D(fig) ax.scatter([3,4,4,4,3,2,2,2], [3,3,3,4,4,4,5,5], [3,3,2,2,2,2,2,1],s=150, c='r') ax.set_xlim3d(1, 5) ax.set_ylim3d(1, 5) ax.set_zlim3d(1, 5) plt.show()[/CODE] , but I don't know …

0
47
Member Avatar for benqb

In my phpcode [CODE=php] <?php $out = array(); $execute='./test.py'; $name = "?key=1234&path=host"; exec ("$execute $name", $out); foreach ($out as $value) { echo "$value<br />\n"; } ?>[/CODE] In test.py file i want to get the value corresponding to path that is host In test.py [CODE] #!c:/Python27/python.exe -u import django import cgi, …

0
63
Member Avatar for WildBamaBoy

I'm at a point with this program that I need to do a lot of work with strings. This would be so much simpler to do in Python, however I don't want the entire program written in Python. How could I use functions from a Python script in C++?

Member Avatar for WildBamaBoy
0
264
Member Avatar for jamd200

This program allows one to use many different sorting algorithms to sort an iterable. [code=python] from time import* from random import* #GNOME SORT def gnome_sort(lst): pos = 1 while pos < len(lst): if lst[pos] >= lst[pos-1]: pos = pos+1 else: temp = lst[pos] lst[pos] = lst[pos-1] lst[pos-1] = temp if …

Member Avatar for jamd200
0
346
Member Avatar for jamd200

I coded a simple tic-tac-toe "from scratch" (haven't included a GUI or anything of that sophistication). I would like to know about any improvements that can be made to this game. Thank you. [code=python] import random board_lst = [] class board: def __init__(self, rows, columns): self.rows = rows self.columns = …

Member Avatar for jamd200
0
231
Member Avatar for jamd200

So far, my simple numerical analysis program has differentiation, integration, first-order ODEs and Taylor Series. What else can I add to this? [code=python] from math import* """Single-variable calculus.""" #DIFFERENTIATION def gen_differentiation(f,x,h): #finds the first derivative of any mathematical function return (f(x+h)-f(x))/(h) def special_differentiation(f,x): #finds the first derivative of specific functions …

Member Avatar for jamd200
0
161
Member Avatar for benqb

I am executing python file through php code in my local host [CODE=php]<?php $out = array(); $execute='C:\wamp\bin\apache\Apache2.2.11\cgi-bin\test.py'; exec ("$execute", $out); foreach ($out as $value) { echo "$value<br />\n"; } ?>[/CODE] test.py [CODE=python] #!/usr/bin/python import cgi, cgitb, os, sys cgitb.enable(); # formats errors in HTML print "helloworld"[/CODE] it correctly working in …

Member Avatar for jkon
0
97
Member Avatar for kitjo

Am teaching it to my self but i have found many problems. i need your help because i want to build a dictionary for my local language. the words i already havee them and i only need the codes forlinking to the database and extraction from the database

Member Avatar for jordan0420
0
184
Member Avatar for Tech B

This is a facial recognition system. Supports one face so far. This is an example ported from C++ to python. To see the original and to obtain the dll used visit [URL="http://www.kyb.mpg.de/bs/people/kienzle/facedemo/facedemo.htm"]this site.[/URL] I do not take credit of the dll, only the ported python code. The comments in the …

Member Avatar for Tstrv
1
657
Member Avatar for benqb

I am passing the given query [url]http://localhost:8080/show?key=1234&path=host[/url] in my python script i want to take the 'path' only how can i get it? i use [CODE] def get(self): data = self.request.get('path') [/CODE] but it not working

Member Avatar for GDICommander
0
227
Member Avatar for blagoblg

Hi I have a problem with installation of numpy ! I followed the instructions from the page of scipy and tried sudo apt-get install python-numpy python-scipy too. It shows this message: [CODE]blago@blago-laptop:~$ python Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39) [GCC 4.4.5] on linux2 Type "help", "copyright", "credits" or "license" …

Member Avatar for GDICommander
0
436

The End.