15,175 Topics

Member Avatar for
Member Avatar for slamshuffle

Hi all, I'm quite new to Python (and programming in general) and I'm a bit confused about how to implement inheritance in an assignment I'm doing at the moment. The basic gist is: we're supposed to make a program that can record stock items for a company. We're to make …

Member Avatar for james.lu.75491856
0
185
Member Avatar for Mohammad_7

I am running canopy 64 bit Version: 1.0.3.1262 on mac Mountain Lion. I have installed virtualenv using easy_install. But while I am trying to execute the command: virtualenv venv --distribute It shows the following error: Using base prefix '/Applications/Canopy.app/appdata/canopy-1.0.3.1262.macosx-x86_64/Canopy.app/Contents' New python executable in venv/bin/python dyld: Library not loaded: @rpath/Python Referenced …

Member Avatar for slate
0
294
Member Avatar for red23

I'm a beginner in phyton. i'm just starting to read things about phyton because we need it for our project. I really need basic and detailed instructions on how to use it and use it using notepad++. Could someone help me? or teach me? ill also do my part and …

Member Avatar for JasonHippy
0
3K
Member Avatar for epicSHOOTER236

so I need to be able to open a text file, and when a button is pressed it searches for a tag in the file such as <l1> and anything after that tag would be put into a label. how would I go about doing this?

Member Avatar for epicSHOOTER236
0
157
Member Avatar for james.lu.75491856

code: #I meant memory card import pygame, sys,random from functools import partial def image(x=50,y=100,default=True,nondefault_color=(0,0,0)): if default: color = hiddencolor else: color = nondefault_color print color image = pygame.Surface((x,y)) image.fill(color) pygame.draw.lines(image, [0,0,0],False, [(0,0),(0,100),(50,100),(50,0),(0,0)], 1) rect = image.get_rect() return image def card(pos): x= pos[0]/50 #integer divison y= pos[1]/100 if (x,y) in flashcards: …

0
98
Member Avatar for stealthless

I'm trying to make a short program where the user enters as many integers as they want. When they type 'done,' the program will calculate all of the numbers the user entered. So far when I run this program, all I get is "done." Am I close to being finished? …

Member Avatar for slate
0
184
Member Avatar for pythonforlife

I am looking for someone who can teach me how to segment a video file into chunks. Will appreciate it greatly if anyone decides to help me!

Member Avatar for Gribouillis
0
280
Member Avatar for stealthless

How to make initials-counter program? Hello, I'm trying to make a program that asks for the user's initials (3 letters) and a block of text, and then reports how many times their initials showed up in the block of text. For example, if my intials are VKL, and I type …

Member Avatar for TrustyTony
0
246
Member Avatar for toniann.midori

the input is [120, [10, 20, 30]] i split the balance using this code def checkio(data): balance=[int(x) for x in data[0:1]] withdrawal=data[1:2] but when i split it the withdrawal section looks like [[10,20,30]] which hinders the loops im going to do. I want it to have single brackets like so: …

Member Avatar for toniann.midori
0
3K
Member Avatar for james.lu.75491856

Weak refrences to an object can be collected if no strong refrences remain, but we can disable it! Lists and dictionaries cannot be weak refrenced, but this can: class Dict(dict): pass class List(list): pass If your holding a large dictionary, you might want to split up over diffrent variables, like …

Member Avatar for james.lu.75491856
0
140
Member Avatar for Cducks

I need help writing a program that will read a string from the user and print the string with every other word removed. Ex. Input sentence: Hello everybody Eloeeyoy

Member Avatar for snippsat
0
166
Member Avatar for ihatehippies

I stumbled on upon this anomaly in one of my programs and can't figure out why this is happening. I made a small test function that exhibits the same behavoir. It's like the local variables of my function are being saved after the function exits. The exclude_ids variable keeps growing. …

Member Avatar for james.lu.75491856
0
768
Member Avatar for Matigo

Hello I want to make a GUI tool in python Tkinter that can check if the site is up or down, I did a quick search on google and i came up with the following code import httplib conn = httplib.HTTPConnection("www.google.com") conn.request("HEAD", "/") r1 = conn.getresponse() print r1.status, r1.reason I'm …

Member Avatar for james.lu.75491856
0
173
Member Avatar for james.lu.75491856

notdone = [tuple((x,y))for x in range(5) for y in range(6)] for i in showns: s = lambda :tuple(random.sample(notdone,1)) #random.sample gives a LIST even though I used tuple() print notdone #debug a = s() print a #debug notdone.remove(a) b = s() flashcards[a] = Flashcard((x*20,y*100),i) flashcards[b] = Flashcard((x*20,y*100),i) [(0, 0), (0, 1), …

Member Avatar for james.lu.75491856
0
174
Member Avatar for 26bm

Hi, I'm wondering if anybody knows of a python compiler to make an exe with. I have tries cx_freeze and py2exe so far, but I haven't been able to get it to work. If anyone has any good python to exe compilers please post here. Thanks, 26bm

Member Avatar for james.lu.75491856
0
377
Member Avatar for pythonforlife

import os segmentbytes = 5242880 fullbytes = os.path.getsize("Wildlife.wmv") numframe = fullbytes / segmentbytes remainder = fullbytes % segmentbytes parts = [open("Wildlife_Part%i.wmv" %i ,'wb') for i in range(numframe)] with open("Wildlife.wmv",'rb') as f: segment = f.read(segmentbytes) for j in range(numframe): parts[j].write(segment) f = open("Segment.txt", "wb") for i in range(numframe): f.write("Wildlife_Part%i.wmv" %i + …

Member Avatar for pythonforlife
0
131
Member Avatar for bwshields

Sorry for the complete newbie question, and apologies in advance if this isn't the right place to post this, but I'm trying to revamp my portfolio site and have been pulling my hair out for 3 days trying to get Jinja 2 templates to work. I originally designed my site …

0
74
Member Avatar for jude.caird

This code isn't working and is just returning "Is a Palindrome", I believe it is a slicing problem of sorts. Please help! #!/usr/bin/env python x = input("Enter here: ") x is x[:-1] if True: print ("Is a Palindrome") else: print ("Is Not a Palindrome")

Member Avatar for james.lu.75491856
0
169
Member Avatar for krystosan
Member Avatar for Gribouillis
0
74
Member Avatar for LincyDaniel

I have included the entire source. I am getting the traceback error. import os import sys import fileinput import datetime from time import localtime name = sys.argv[1] # log specifies the file that is supposed to be parsed by the script log = fileinput.input('/var/log/secure.log') L = localtime() CalendarMonth = L[1] …

Member Avatar for james.lu.75491856
0
164
Member Avatar for wolf29

I want to create sqlite3 databases from within a python script. I am currently running this code which does not pass the right variable content to the sqlite3 command prompt, so I have one issue there. I also do not want to have the user have an sqlite3 command shell …

Member Avatar for james.lu.75491856
0
358
Member Avatar for BlackJavaBean

I'm working on a script that needs to use the Github API to allow the user to gain access to their Github account. I'm still really new to web programming, so I'm not really comfortable with how to securely transmit username and password combinations. I'm just wondering what are some …

Member Avatar for gusano79
0
119
Member Avatar for tony75

Hi I have script(ip.py) that send me ip.txt from my remote pc to my email. My problem is my firewall in my remote pc block ip.txt file. How can I tell Firewall in my script to allow ip.txt file from my remote pc(Add python script to firewall exceptions)? I’m using …

0
80
Member Avatar for 26bm

Hi, I am wondering if there is a way to somehow look at the contents of a variable and make a variable name with the contents of that variable. I really don't know how else to word that, just wondering. If anyone understands what I am saying and knows an …

Member Avatar for TrustyTony
0
255
Member Avatar for imperialguy

I use: Python 2.6 and sqlalchemy 0.6.1 This is what I am trying to do: from sqlalchemy.types import ( Integer, String, Boolean ) from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() class SampleMeta(type): def __new__(cls, name, bases, attrs): attrs.update({ 'id': Column('Id', Integer, primary_key=True), 'name': Column('Name', String), 'description': Column('Description', String), 'is_active': Column('IsActive', …

Member Avatar for Gribouillis
0
403
Member Avatar for kdar

How do I go about writing a python application for windows mobile 6.1 or 6.5? I need to write one application (simple application, except for need for SQL support) for Windows Mobile. I been trying to decide which language is better to use. At first I tried to install Windows …

0
76
Member Avatar for Empireryan

Hi all. I'm wondering if it is possible to pass formatted strings to function arguments. I'm doing something like this: `OUT_TASK = "Task_{id1}, FUNCTION, {id2}, task{id3}_types, None"` `t = Task(OUT_TASK.format(id1=i, id2='doNothing', id3=i))` Any clues are much appreciated. Any other means for doing variable arguments are of interest.

Member Avatar for snippsat
0
222
Member Avatar for srinivas.rambha

import serial import threading import Queue import Tkinter as tk class SerialThread(threading.Thread): def __init__(self, queue): threading.Thread.__init__(self) self.queue = queue def run(self): s = serial.Serial('COM10',9600) while True: if s.inWaiting(): text = s.readline(s.inWaiting()) self.queue.put(text) class App(tk.Tk): def __init__(self): tk.Tk.__init__(self) self.geometry("1360x750") frameLabel = tk.Frame(self, padx=40, pady =40) self.text = tk.Text(frameLabel, wrap='word', font='TimesNewRoman 37', …

Member Avatar for m_ishwar
0
1K
Member Avatar for m_ishwar

Hey guys is there a funtion in python that enables to output values to a bin files? Just like storing strings in .txt files, can we store hexadecimal values directly into .bin files? I am working using Python 2.7.3

Member Avatar for m_ishwar
0
313
Member Avatar for zaphoenix

hi, Please can anybody help me with this problem, i am creating an application that outputs to a notepad file on windows 7, i would like to know if there is a python module that i can use to invoke a notepad file(example trial.txt) to output into.THanks

Member Avatar for pbj.codez
0
239

The End.