15,185 Topics

Member Avatar for
Member Avatar for machine91

I want to have two threads with a queue exchanging data (in the form of lists) between the two threads. However, at the moment I cannot fathom out how to write the code simply for taking the first list from the queue, processing it(which I have written the function for) …

Member Avatar for Gribouillis
0
264
Member Avatar for bsh6wc

Hi, I'm new to python and I am having issues attempting to input data into my code from a text file. The text looks like this: >INFO> CELLID, #729, >INFO> 20100520-035248 LightningTable (scale_1) >INFO> LON,LAT -96.485,34.67,0 datatime, maxref, ref_-10, MaxVIL, TotalVIL, Size(km2), CGDenAVG, CGmaxden, CGCount, FlashCount, FlashDenAVG, MESH 20:03:30:05, 63.5, …

Member Avatar for TrustyTony
0
260
Member Avatar for Boubakr

Hello, I've this lise: [CODE]lst = ['10:User1', '80:User2', '100:User3', '00:User4', '75:User4', '45:User5'][/CODE] I want to print it as: [CODE]100 User3 80 User2 75 User4 45 User5 10 User1 00 User4[/CODE] So, I want to organize them by the number.

Member Avatar for TrustyTony
0
141
Member Avatar for NetByte

Greetings to Everyone :cool: , I just would like to know how to run/launch/start the IDLE ide of python in linux? (In windows the IDLE ide comes part of the python download, I assume its the same for linux??! or not?!) I currently have installed ubuntu linux, its already got …

Member Avatar for snippsat
-1
1K
Member Avatar for M.S.

Hello All This is my first post in this forum, despite my long visiting hours as a guest:D I don't have any background in programming and I'm a newbie in python too. But Learning python for S60(Python distro for Symbian Phones. anyway, I have a problem with printing from two …

Member Avatar for M.S.
0
537
Member Avatar for Benderbrau

Hello, I've got a problem that I can't seem to figure out. I'm writing a program to simulate a process manager, and I'm doing four different algorithms: First come first serve, shortest job next, shortest remaining time, and round robin. I've got the first two down perfect, but I'm having …

Member Avatar for majid_shqeer
0
3K
Member Avatar for Smed

Hi, I am trying to use Regular Expressions to modify text without modifying the wildcard value. Here is an example: [CODE]import re text = 'Reference [14] and Reference [17] are References.' text = re.sub('Reference \[\d+\]','Ref. [\d]',text) print text [/CODE] I want the output to be "Ref. [14] and Ref. [17] …

Member Avatar for TrustyTony
0
138
Member Avatar for flebber

Say I have a basic list. [CODE]x = [2,3,1,3,5,4,5] [/CODE] And I want to find the sum result applied against the list without duplicates. So with duplicates the code could be. [CODE][elem * 2 for elem in x if elem >= 1 ] > [2, 4, 6, 6, 8, 10] …

Member Avatar for TrustyTony
0
298
Member Avatar for flebber

Can I ask for a little help with virtualenv. I am looking at the docs here [URL="http://guide.python-distribute.org/pip.html"]http://guide.python-distribute.org/pip.html[/URL] and here [URL="http://www.jython.org/jythonbook/en/1.0/appendixA.html#virtualenv"]http://www.jython.org/jythonbook/en/1.0/appendixA.html#virtualenv[/URL] There are a few things I can't quite understand about it. First just to clarify I am on ubuntu and my default python is 2.7.1 1. I use virtualenv to …

Member Avatar for flebber
0
192
Member Avatar for vidur

a software written in python to change the extension of all existing exe files on a system to a randomly generated integer would prevent a conventional virus as knowing the file is an executable and hence from infecting it. i know there are easy ways of getting around this. so …

Member Avatar for pseudorandom21
0
222
Member Avatar for adrianandreev

Hi guys, What i need is a way to [B]check the available USB ports in windows[/B] using python. The purpose: I'm trying to run on startUp a script that wait to plug in my Token, and after that the script will log me in automatically into the system that I'm …

Member Avatar for TrustyTony
0
11K
Member Avatar for debasishgang7

As i dont know php i am unable to understand how this code is working? Can any body please help me to convert the following php code into python code. [CODE] function icmpChecksum($data) { if (strlen($data)%2) $data .= "\x00"; $bit = unpack('n*', $data); $sum = array_sum($bit); while ($sum >> 16) …

Member Avatar for debasishgang7
0
96
Member Avatar for hadoque

In order to learn some basics about sockets I'm trying to program a simple IRC client. In order to receive server messages I have a thread that is receiving from the socket. When sending commands to the server a new thread is created, with the same socket. This doesn't seem …

Member Avatar for hadoque
0
171
Member Avatar for newtopython1111

Hi all, I have a data set that has a text header, followed by binary data. I want to search for a certain variable in the text header, store whatever name comes after the variable, and then replace it with X. Since I want to leave the binary alone, I …

Member Avatar for woooee
0
152
Member Avatar for debasishgang7

Hi all, I am trying to calculate checksum of some data using python. I am putting a sample ICMP header here and the correct checksum of that packet(Got this by sniffing network with wireshark) [B]DATA is "08 00 69 eb 8e 13 00 01" And the correct checksum is "0xa9eb". …

Member Avatar for debasishgang7
0
427
Member Avatar for duffsil

wxpython i cant figure out the problem. it says that the global neme 'panel' is not defined. Traceback (most recent call last): File "C:\Users\Daniel\Desktop\Duffan Teorem", line 34, in clickbutton wx.StaticText(panel,-1,media,pos=(150,240)) NameError: global name 'panel' is not defined could someone please help me to figure tha problem out? Thanks in Advance …

Member Avatar for duffsil
0
295
Member Avatar for hughesadam_87

Hey everyone. I have a matrix of matricies. Basically, I have a 3 dimensional matrix object which stores i 2-d arrays. For example: M=(i,j,k) A= M[1,:,:] = (j, k) B= M[2, :, :] = (j', k') etc.. Now, what is want to do is actually do the entire product (A*B*C...); …

-1
75
Member Avatar for felix001

Im trying to run a small python CGI script but when i run it i get the error : [B]malformed header from script. Bad header=[Querying whois.internic.net]: hello_get.py[/B] The CGI scripts im trying to run are : [CODE]#!/usr/bin/python # Import modules for CGI handling import cgi, cgitb import os # Create …

0
76
Member Avatar for de1337ed

Hey guys, I'm a little confused on a web scraping topic. I understand that you can use urllib2 to webscrape, but my project requires a little more advanced scraping. I want to use python to inpute data into a search box, then return the results of that information. As an …

Member Avatar for griswolf
0
3K
Member Avatar for blackcorner

Hi folks: How can I get information regarding the drives in the system?, using Python, off course ;) The information must include (at least in part) the following: [LIST] [*]Size [*]Used space [*]Free space (although you can calculate this value from the former two, some systems are tricky and don't …

Member Avatar for asdsdadfgdgsafd
0
4K
Member Avatar for rhuffman8

This is a continuation of problems with the program posted here: [URL="http://www.daniweb.com/software-development/python/threads/372311"]http://www.daniweb.com/software-development/python/threads/372311[/URL] I started thinking there was something wrong with my statement to open the csv file, using the reader. [CODE]reader = csv.reader(open('C:/Documents and Settings/VPC.VPC-SCALA.000/Desktop/RAH 7-11-11/RH/Projected Cash Goals Template.csv', 'rb')) [/CODE] I put a test statement above the open statement …

Member Avatar for rhuffman8
0
350
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
493
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
135
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
159
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
65
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
466
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
766

The End.