15,194 Topics

Member Avatar for
Member Avatar for TrustyTony

Breakin news item from [url]http://python.org/download/releases/3.2.1/[/url] (hope the input from command line will also be fixed) Python 3.2 is a continuation of the efforts to improve and stabilize the Python 3.x line. Since the final release of Python 2.7, the 2.x line will only receive bugfixes, and new features are developed …

Member Avatar for bumsfeld
1
501
Member Avatar for hughesadam_87

Hey guys, I am writing a GUI program, and one of the routines requires that I choose a file to be my data file. If the data file is chosen correctly, then my program will send it to a subroutine which will perform a bunch of methods and ultimately construct …

Member Avatar for hughesadam_87
0
137
Member Avatar for magnetic rifle

Is it possible to assign a variable to be a random vector. The only syntax I could find was rand.jumpahead but further research did not seem promising. Thank you, Suhail

Member Avatar for Gribouillis
0
160
Member Avatar for debasishgang7

Hi all, I am trying convert IP addresses form Decimal format [Like 192.168.12.13] to HEX format [c0 a8 9d 80]. For Example the IP "192.168.157.128" is equivalent to "c0 a8 9d 80" in HEX. How to do that.??

Member Avatar for debasishgang7
0
2K
Member Avatar for halamas

hello, I'm a computer sciense student has to learn python by myself, I have a task to accomplish, that is a litlle bit ambiguous for me! I have to read fro a text file and make a word_counter then I have to search for a word and replace it with …

0
67
Member Avatar for sneekula

I need to read in a text file, replace selected words and write the changed text back out to a file. Is there an easy way with Python?

Member Avatar for halamas
0
20K
Member Avatar for debasishgang7

Hi all, I am trying to send Binary data using In python raw socketusing socket.send(). For that i will do following. [CODE]s = '\x01\x00\x12\x59' # some binary data sock.send(s) # assuming "sock" is a valid, open socket object[/CODE] i have created a DATAGRAM in HEX in by sniffing a network …

Member Avatar for debasishgang7
0
1K
Member Avatar for [V]

Im using Matplotlib, and plotting a basic line graph. I have an very large set of data and I need my Y-axis to be much bigger. How do o make my graph much longer but not any taller? I found I can increase the overall graph size in proportion using …

Member Avatar for griswolf
0
470
Member Avatar for vegaseat

[B]Search for your answer first![/B] If you're having a problem, chances are good that someone else has had the same problem. Please search the forum for existing answers before starting a new thread. Nothing is more irritating to a long time member than to answer the same question for the …

Member Avatar for bumsfeld
6
768
Member Avatar for neuro

So I'm trying to learn Python mostly for fun but also to prepare for graduate school next year (i'm going into a quantitative neuroscience program this fall where it will help a lot to be familiar with programming ahead of time). The problem is I can't seem to find a …

Member Avatar for griswolf
0
300
Member Avatar for pythonnoobie

I need to find a pattern of kind APP[a-z][a-z][0-9][0-9][0-9] in the body of HTML and then replace them with hyperlinks. I am using Beautiful Soup to replace as I am dealing with HTML content. For Eg: APPsd222 to [URL="http://www.dani.com/APPsd222"]APPsd222[/URL] APPfd333 to [URL="http://www.dani.com/APPfd333"]APPsd333[/URL] If you are not aware about Beautiful Soup, …

Member Avatar for pythonnoobie
0
240
Member Avatar for magnetic rifle

Why do I get: Traceback (most recent call last): File "./2csvtbl.py", line 31, in <module> print row[k], row[-k] IndexError: list index out of range after running this code: #!/usr/bin/env python import csv import random alpha = 'abcdefghijklmnopqrstuvwxyz' e = range(0,99) x = random.sample(alpha,14) y = random.sample(e,14) c = csv.writer(open("test2.csv", "wb")) …

Member Avatar for griswolf
0
143
Member Avatar for rmsagar

The below script adds an attribute to an searched element. I would like to add the attribute at the end or which ever location i prefer, whereas the script adds at the beginning. Also I would like to commit only the changes to the file. Please share and ponder your …

0
51
Member Avatar for Lolalola

Hi, i need from PDF extract text and images. Maybe you know python library? Thanks

Member Avatar for Gribouillis
0
53
Member Avatar for magnetic rifle

Hello, I have this code [CODE]#!/usr/bin/env python import csv import random alpha = 'abcdefghijklmnopqrstuvwxyz' e = range(0,99) x = random.sample(alpha,14) c = csv.writer(open("test2.csv", "wb")) c.writerow([x]) cr = csv.reader(open("test2.csv","rb")) for row in cr: print ', '.join(row) print "How many rows?" l = input() k = 1 while k < int(l): y …

Member Avatar for magnetic rifle
0
9K
Member Avatar for user45949219

Hey all! This is my first post on Dani's Web but I have long before used it as a resource for understanding different problems I have encountered with Python. I have only just started learning Python so please excuse my lack of understanding on this problem. [CODE]counter = 0 nameList …

Member Avatar for TrustyTony
0
155
Member Avatar for hughesadam_87

Hey everyone, I'm getting familiar with TkInter, and while it's a cool program, I'm having a hell of a time with keeping all the classes straight. As of now, I'm trying to build a program with a menubar and some other widgets. I can get the program working if I …

Member Avatar for hughesadam_87
0
216
Member Avatar for deb0and

Not sure what this error means "NameError: global name 'sessionid' is not defined" Any help would be greatly appreciated. Below is the code [CODE]import sys from socket import * import re import os from time import sleep print ("[*] BY THE POWER OF GRAYSKULL - I HAVE THE ROOTZ0R!\r\n" "[*] …

Member Avatar for deb0and
0
877
Member Avatar for zidaine

why is it that when i pop a dictionary in variable b, variable a does the same? And When i print variable a, the value is [{'b':2}]. How can i retain the value of variable a? [CODE] a=[{'a':1,},{'b':2,}] b = a b.pop(0)[/CODE]

Member Avatar for TrustyTony
0
138
Member Avatar for jodata26

What is the easy way to learn GUI Python, i mean where to choose pyGTK, pyQT , TkInter or what? Thanks

Member Avatar for SamarthWiz
0
385
Member Avatar for Archenemie

I feel like a total muppet for not being able to do what is likely a stupidly easy task. I have downloaded the MySQLdb.zip, unzipped it to my desktop and am trying to get it to work with my python 2.7 (its compliant). Can anyone give me a step by …

Member Avatar for griswolf
0
119
Member Avatar for piethon

I am a beginner in learning Python and I am currently reading "Learning Python the Hard Way." In one of its exercises, there's a code that says: [CODE]def bear_room(): print "There is a bear here." print "The bear has a bunch of honey." print "The fat bear is in front …

Member Avatar for GreenDay2001
0
1K
Member Avatar for TrustyTony
Member Avatar for Archenemie
1
699
Member Avatar for Niner710

I am new to Python and am looking for something in Python that is equivalent to parsing files in Perl. I have a text file as follows. [CODE] Blah.txt vcc = 2.6, clock = 1.5 Mhz vcc = 2.7, clock = 1.6 Mhz vcc = 2.8, clock = 1.7 Mhz …

Member Avatar for TrustyTony
0
184
Member Avatar for Lolalola

Hi, sometimes my one of function work too long. How i can break my function, if this function work longer than 3 seconds? thanks

Member Avatar for TrustyTony
0
196
Member Avatar for mikedeomon

The code below works but does not loop through each name in the txt file (loops only when i just want to print their names from the text file) , it only returns the details of the last user in the list rather than returning individual user details one by …

Member Avatar for woooee
0
197
Member Avatar for rhuffman8

I am still relatively new to Python and don't think I'm familiar/comfortable enough with my understanding of the datetime functions... I want to take just the current month from the datetime function so I can use the number to send the string of the month (ex, datetime would give me …

Member Avatar for griswolf
0
201
Member Avatar for Thropian

I was thinking of doing some simple animations in python,Tkinter and my biggest problem was getting things to move together. so I was wondering if there was a way to make say an arc and rectangle into one object to rotate and such. thanks in advance

Member Avatar for Thropian
0
183
Member Avatar for shurshot

Hi all, I'm new to this forum and I am also new to Python and coding in general. While I've gotten through basic tutorials on most general topics of Python such as series, dictionary, parameters, loops, and so forth I am still very much a newbie (as you will see …

Member Avatar for TrustyTony
0
350
Member Avatar for bf2loser

I have to strip anything that isn't a letter between a-z (lowercase only) out of a sentence. I wrote this [code=python]def breakPhrase(string): string=string.lower() for character in string: if ord(character) < 97 or ord(character) > 122: string=string.strip(character) return string[/code] and it works, but only if theres only one punctuation or non …

Member Avatar for sachin004
0
3K

The End.