15,406 Topics

Member Avatar for
Member Avatar for ritzz
Member Avatar for vegaseat
0
191
Member Avatar for welshly_2010

i am having problems creating multiple frames and getting them in the right place. i want to put 4 frames on my display so i can have a display like the first attachments but this its not working and the 2 frame is going straight to the middle when i …

Member Avatar for vegaseat
0
7K
Member Avatar for usongo123

hi guys im stuck in this question would anyone care to help me(its a csv file)?? How many times does the least common string appear in the field [gemstone]? valid gemstone owing mark channels code No Diamond 26.06 20 218 (KJQ:10E)2 Yes Diamond 15.43 25 36 (DRX:25H)7 No Sapphire 11.44 …

Member Avatar for vegaseat
0
184
Member Avatar for bdheeraj

hi i wrote a Gui program in python3.2. i want to convert my .py program into a windows executable file(.exe). i googled for it and found py2exe but it only supports 2.7 . is there anyway i can convert my program.

Member Avatar for vegaseat
0
5K
Member Avatar for biscayne

There used to be an open source initiative called sla2pdf which used a python script to convert Scribus sla files to pdf. Unfortunately downloading the programs from https://code.google.com/p/sla2pdf/ is no longer possible. Is there anyone who knows where to find the programs and preferably some documentation ? Many thanks, P

Member Avatar for biscayne
0
257
Member Avatar for kay19

from __future__ import print_function, division #requested per VPython import time from visual import * #make sure this is asterisk char, copy/paste no go ## constants mzofp = 1e-7 L = 2.5 q = 2*1.6e-19 scalefactor = 7e-9 deltat = 9e-20 #objects & initial conditions particle = sphere(pos=vector(0,0,-4e-10), radius=1e-11, color=color.red) velocity …

Member Avatar for kay19
0
182
Member Avatar for otto531

I've been looking around for an answer to this but have had no luck. I need to take two files and print the top most frequent words they have in common as well as their combined(sum) frequencies. This might be simple but I'm pretty new to programming. Any help? def …

Member Avatar for bumsfeld
0
312
Member Avatar for Alkajak

class BTNode(object): """A node in a binary tree.""" def __init__(self, item, left=None, right=None): """(BTNode, object, BTNode, BTNode) -> NoneType Initialize this node to store item and have children left and right, as well as depth 0. """ self.item = item self.left = left self.right = right self.depth = 0 # …

Member Avatar for dashing.adamhughes
0
263
Member Avatar for johans22

I have numpy type array, array[x][y], 16bit, little endian. How to save this to a tiff file as an image?.

Member Avatar for johans22
0
161
Member Avatar for keitaurin

Let's say I have a user input a string. string = input("enter a string") and that string ends up being something like "hello world!" but with a lot more whitespace. string = "hello world!" I want to condense this user's input so that instead of all that whitespace I only …

Member Avatar for Lardmeister
0
185
Member Avatar for OmK@r

Hi Friends, I want to connect to a linux machine using a private key login as password from another linux machine. I want to connect this using a python script. Thanks in Advance, Omkar

Member Avatar for Gribouillis
0
307
Member Avatar for 3e0jUn

So I have a code that prints out the `sys.argv` when the program is ran. How can I parse $ python ./arch.py install * to show `["./arch.py","install","*"]` Instead of `["./arch.py","install",#other files in directory]`?

Member Avatar for deceptikon
0
201
Member Avatar for OmK@r

Hi Friends, I had a issue with telnet conncection in python. Can you send me a working module to connect to telnet windows from a linux machine using python scripting.. Thanks in Adwance, Omkar

Member Avatar for OmK@r
0
4K
Member Avatar for Lardmeister

Anybody out there that used Python on an Android system? Something like the subset on http://pygame.renpy.org/

Member Avatar for M.S.
0
220
Member Avatar for mksha

Hi Guys, I am kind of new to python and started working on python from February2013. I have a script which run on linux machine. It captures the available RAM from the system and then tries to eat it up. I am using subprocess.Popen('free',...) command and for first loop it …

Member Avatar for mksha
0
469
Member Avatar for clouds_n_things

So, quick question, (has to be just something I'm missing), if I want to concantate a string and integers in a url, is there a way to do so? I'm sure there is...I mean this IS python! from urllib2 import urlopen width = input("Please enter a width specification here: ") …

Member Avatar for clouds_n_things
0
182
Member Avatar for johans22

import matplotlib.pyplot as plt plt.plot(x, y, 'b-') plot.legend ( ... ) 'put legend on left, i do not have the actual code with me. plt.show() How can I resize the plot window to show the legend on the left side?. Also, I like for program Not to stop when calling …

Member Avatar for Lardmeister
0
141
Member Avatar for clouds_n_things

So I'm writing a personal bank tracker for myself, and I'm having a bit of trouble with a line of code. The ID_Pin method below is equal to 0000, however when i try to create an instance (any instance of the Account class), it returns the "Access Denied" bit that …

Member Avatar for clouds_n_things
0
177
Member Avatar for dude1

i have a problem im trying to solve in python but I'm not sure if its possible ive got lists of data one line that is the full name Eg. name:John Doe and the line below is a the user ID Eg. userID:jdoe i have both of those being made …

Member Avatar for Lucaci Andrew
0
297
Member Avatar for welshly_2010

how can i add data to a label that i have and keep updating it based on the folder selected here my code so far def listDir(): dirname = tkFileDialog.askdirectory(parent=root,initialdir="/",title='Please select the file you would like to scan') myvar.set('Current Folder Selected is: ') label = Label(root, width = 30, height …

Member Avatar for vegaseat
0
169
Member Avatar for krystosan

why does this gives error `print "module {0}".format(key)` , i hope this is nt the python version problem...

Member Avatar for vegaseat
0
345
Member Avatar for vegaseat

A permutation is the arrangement of a set of items in different order. One interesting application is the rearrangement of characters in a word to create other words. If all the n characters are unique, you should get n! unique permutations. You can make a list of words unique by …

Member Avatar for vegaseat
1
6K
Member Avatar for vegaseat

Scientists and deficit spenders like to use Python because it can handle very large numbers. I decided to give it a test with factorials. Factorials reach astronomical levels rather quickly. In case you can't quite remember, the factorial of 12 is !12 = 1*2*3*4*5*6*7*8*9*10*11*12 = 479001600, that is 479 million …

Member Avatar for sneekula
2
5K
Member Avatar for rev_ollie

Hi, I'm doing some more work on my sensor program - and it now has a GUI and graph which I'm happy with. I'm having a look at a WX python tree - which looks like a good control for what I'm looking for. The question I have is this …

Member Avatar for rrashkin
0
221
Member Avatar for syfr

Hello. I'm a complete Python beginner and I'd like to know how to add a fail-safe to your code so that the script is stopped after a certain phrase or key combination has been given as input. To explain further, I'm playing around with a Raspberry Pi at work. I …

Member Avatar for Gribouillis
0
961
Member Avatar for sugarzzzz

I have a minelist[0,15] for a board 4 height and 4 width every elemnt in the board is a zero so it looks like [['0','0','0', '0'],['0','0','0', '0'],['0','0','0', '0'],['0','0','0','0']]now if I mines X in 0,15 it would look like [['x','0','0', '0'],['0','0','0', '0'],['0','0','0', '0'],['0','0','0','x']] now whereever the mines are touching it is …

Member Avatar for woooee
0
123
Member Avatar for ebc3142

Hi, After having come to grips with PHP, I've decided that it's time to move onto a more sophisticated language for building web applications. I've chosen Python, utilising the Django framework. Could somebody provide me with the software I will need for writing the code? My first guess would have …

Member Avatar for LastMitch
0
219
Member Avatar for abacus_x

Hi there! Ive been looking to get some help on a small script im writing to recover an encrypted word for homework. Its a 5 character word of random capital letters encrypted with the RSA algorithm. I undesrtand that Rsa is not a block cipher. Its been encrypted in two …

Member Avatar for blj.davidson
0
165
Member Avatar for carlpike

Edit: I've discovered that the problem isn't the code, but the proxy hangs for several minutes. Is there any way I can set a timeout for this socket so that it can just request a new socket after say 10 seconds? Also, the Timer class isn't working. The classes aren't …

Member Avatar for chriswelborn
0
159
Member Avatar for aVar++

Hello, I have made a programme for finding cominations of a number from the user, it is designed to take any length and then tell the user how many combinations there are. However im not sure how to find how many combernations there are. I have googled it and there …

Member Avatar for Ene Uran
0
289
Member Avatar for lancevo3

Hi all - Working on teaching myself some python and have some code I am working on, I am at a point where I would like to update a parent class variable from within a subclass, I am wondering what is the proper method for doing this. Something similiar to …

Member Avatar for Ene Uran
0
1K
Member Avatar for robert99x

I previously used 32bit Python 2.7 on Windows Vista. My new PC is Windows8 and 64 bit. I would like Python to work with Microsoft Office Excel. Is the best / simplest way forward to stick with 32 bit Python and 32 bit Excel? Can you mix 32 bit Python …

Member Avatar for vegaseat
0
313
Member Avatar for superbhimanshu

Hi, I am supposed to make a GUI using Tkinter which has basic menubar options, a optionmenu and some textboxes. Here is the code. from Tkinter import * ################ import basic libraries ################# import Tkinter import Pmw import tkMessageBox import tkFont from PIL import ImageTk,Image from mmap import mmap,ACCESS_READ def …

Member Avatar for vegaseat
0
430
Member Avatar for vegaseat

This snippet allows you to find the number of ordered permutations of items taken from a population of known size. It uses the well know algorithm with factorials. For very large populations you may want to use an approximation of factorials.

3
3K
Member Avatar for vegaseat

If you want to know the number of combinations of x things taken n at a time, you can use the Python module gmpy. The module gmpy is a C-coded Python extension module that supports fast multiple-precision arithmetic, very handy if x things reach a large number.

3
476
Member Avatar for dp121307

I wrote out a test for a Complex class on python but I'm getting an error. Here's what I have: class Complex: def __init__(self, real=0, imaginary=0): self._r=real self._i=imaginary def __add__ (self, other): return Complex((self._r + other._r), (self._i + other._i)) def __sub__ (self, other): return Complex((self._r - other._r), (self._i - other._i)) …

Member Avatar for TrustyTony
0
488
Member Avatar for amweasel

If I make a website using Django, is there any need to use Javascript? Can Django work in place of Javascript itself?

Member Avatar for amweasel
0
296
Member Avatar for krystosan

what does it mean by defining a variable with double underscore only at the prefix part ? like in this [example](http://pastebin.com/8e5t2eAZ) at pastebin i.e. self.__weakReference

Member Avatar for vegaseat
0
482
Member Avatar for flebber

I was reading this article [Click Here](http://maxburstein.com/blog/python-shortcuts-for-the-python-beginner/) http://maxburstein.com/blog/python-shortcuts-for-the-python-beginner/ In there was this example from itertools import combinations teams = ["Packers", "49ers", "Ravens", "Patriots"] for game in combinations(teams, 2): print game >>> ('Packers', '49ers') >>> ('Packers', 'Ravens') >>> ('Packers', 'Patriots') >>> ('49ers', 'Ravens') >>> ('49ers', 'Patriots') >>> ('Ravens', 'Patriots') So I …

Member Avatar for vegaseat
0
434
Member Avatar for longtomjr

I dont know what the responce will be but I kind of like the idea. Pls reply with critisim but pls stay polite. I have been Thinking if there can not be started something like a python guild. Run by an advanced python programer and the people part of it …

Member Avatar for longtomjr
0
198
Member Avatar for scubastevie

Hey all, I am working on learning python, I have a question about lists. When I call Variable x to equal numbers from a text file, I am getting the file returned in multiple lists. with open('numbers.txt') as f: for item in f: n = item.split() print (n) I end …

Member Avatar for Lucaci Andrew
0
228
Member Avatar for jevgeny.abramov

Sorry for my bad english, i have translated this task for fast, but i really neeed help. > Your task - to make automatic sfetofora (3d model). > > Traffic light works in three directions: to the two directions of movement of vehicles (in the center and from the center) …

Member Avatar for vegaseat
0
387
Member Avatar for vegaseat

This Python snippet shows how to control a VPython visual 3D sphere with Tkinter GUI toolkit button clicks.

4
3K
Member Avatar for sudipta.mml

How to save two images into two separate files using same python script. The two output images are correlation matrix and a graph. I was using matplotlib imshow(matrix, interpolation='bilinear') colorbar() savefig('/home/sudipta/Downloads/phppython/'+ filename +'.png') x = range(-width, width) plt.plot(x, avg_vec) plt.savefig('/home/sudipta/'+ filename +'plot' +'.png') The figures overlap each other when I …

Member Avatar for TrustyTony
0
406
Member Avatar for gangster88

how could i make the function to do the colours red, yellow and green for 5 sec delays and make the loop keep on going? [code] def trafficLights(): win = GraphWin() red = Circle(Point(100, 50), 20) red.setFill("black") red.draw(win) amber = Circle(Point(100, 100), 20) amber.setFill("black") amber.draw(win) green = Circle(Point(100, 150), 20) …

Member Avatar for TrustyTony
0
2K
Member Avatar for jeremywduncan

def is_anagram(t,u): if sorted(t)== sorted (u): return True else: return False print is_anagram('realtor', 'rotlear') # True print is_anagram('superpuff','local') # False print is_anagram('alla', 'lala') # True print is_anagram('tools', 'stool') # True print is_anagram('double', 'trouble') # False

Member Avatar for TrustyTony
-1
784
Member Avatar for jeremywduncan

def is_sorted(t): if t == sorted(t): return True else: return False print is_sorted([1,2,2]) # True print is_sorted(['b','a']) # False print is_sorted([3, 1, 5, 2, 4]) # False print is_sorted(['d', 'a', 'c', 'b']) # False print is_sorted(['a', 'b', 'b', 'd', 'e', 'e', 'f', 'g']) # True

Member Avatar for jeremywduncan
0
831
Member Avatar for MasterHacker110

What are advantieges of Ruby over Python and vise versa? Then in your opinion wich one is better for all around programming on linux and windows?

Member Avatar for Ene Uran
0
194
Member Avatar for vegaseat

Let's imagine you are taking a lot of pictures and modify them with one of those fancy image editors. You burned the image files to a CD, and decided to purge some of the outdated files because your hard drive is getting full. This Python code allows you to set …

Member Avatar for Ene Uran
0
540
Member Avatar for SteveA

I am trying to work out how to remove files from a directory the files will always have a given extention e.g .txt I want to remove the filesfrom a specific directory that are older than say 14 days. Noob to Python sorry if this has been answered elsewhere, all …

Member Avatar for Ene Uran
0
309

The End.