14,952 Topics

Member Avatar for
Member Avatar for [V]

Here is my scenario: I have a bunch of data points, each of which shares homology with another. Basically A -> B A ->D B -> C C -> A .:. C ->D, etc... given a bunch of these relations, I need someway to graphically represent these relationships. I picture …

Member Avatar for TrustyTony
0
174
Member Avatar for Russ775

My issue with this code is that when it is executed it does loop correctly. It just runs once and my goal is to have it run 100 times. I am using Python version 3.1 and could really use some help... Considering I am the only geek with in a …

Member Avatar for JoshuaBurleson
0
114
Member Avatar for Russ775

[CODE]import random print("\t\tWant to know your future?") input() fortune = random.randint(1, 5) if fortune == 1: print("You are gonna die today") input() elif fortune == 2: print("You will find love") input() elif fortune == 3: print("You will make it big today!") input() elif fortune == 4: print("You friends will betray …

Member Avatar for JoshuaBurleson
0
183
Member Avatar for heavy.is.happy

Hi. I have an issue who i can't solve. The problem is that a = "13.33" and I want it to turn a = 13.33 and not 13.3333333333 and not 13.330000002. So, how do i make it so "13.33" will be an 13.33 float?

Member Avatar for Gribouillis
0
129
Member Avatar for TrustyTony

Inspired by Computer Science forum post, I did this code. I prepared it Shedskin compatible, and it runs quite nicely indeed. Even interpreted the algorithm is faster than full sort. Here interpreted test for the module, shedskinning this test would show better time for sort solution. Python version has benefit …

Member Avatar for TrustyTony
0
359
Member Avatar for Pyprogrammer

how do you make the python script run when the computer realizes that the flash drive is there when is not in your computer....I'm making a internet boost program and its on a flash drive but i don't want to have to navigate to start it...Thanks

Member Avatar for Purkinje
-1
100
Member Avatar for shibunath
Member Avatar for Purkinje
0
2K
Member Avatar for noobprogrammer

Hi everyone, i was given a book.xml file which contains all the title,author of the books. Here's how it looks like. <?xml version="1.0" ?> <Books> <Item> <BookID>A001</BookID> <Title>A Tale of Two Cities</Title> <Author>Charles Dickens</Author> <Language>English</Language> <Year>1859</Year> <Quantity>5</Quantity> </Item> <Item> <BookID>A002</BookID> <Title>The Lord of the Rings</Title> <Author>J. R. R. Tolkien</Author> <Language>English</Language> …

Member Avatar for Gribouillis
0
148
Member Avatar for noobprogrammer

Hi everyone here, Can someone please guide me in transforming XML-to-SQL output with Python? I need to create 2 tables (Books and Patrons) into SQL. How much i suppose to start with??? <?xml version="1.0" ?> <Books> <Item> <BookID>A001</BookID> <Title>A Tale of Two Cities</Title> <Author>Charles Dickens</Author> <Language>English</Language> <Year>1859</Year> <Quantity>5</Quantity> </Item> <Item> …

0
72
Member Avatar for DragonSlayerX

[CODE]from gasp import * begin_graphics() Circle((200, 200), 60) Line((100, 400), (580, 200)) Box((400, 350), 120, 100) update_when('key_pressed') end_graphics() [/CODE]

Member Avatar for DragonSlayerX
0
100
Member Avatar for JoshuaBurleson

I am having issues finding a way to have the below program search for any given string of "query" in the keys of the dictionary AB and return the value, or the key and value. Thus far I just done what I have preset in the dictionary; Ashley and Joshua, …

Member Avatar for JoshuaBurleson
0
273
Member Avatar for fonzali

hi guys , I rented a gps from the airport and it had no problem giving me the directions , while using it , I kept wondering how it picks the routes , and can python be used to program these devices and how ? a short code would be …

Member Avatar for fonzali
0
91
Member Avatar for lrh9

I'm working on a project where I would like to compare collections of words, but I have additional constraints I need to account for. The collections are like a set in that order doesn't matter for the comparison. However, in my problem equal elements are significant. E.g. the collection of …

Member Avatar for TrustyTony
0
139
Member Avatar for [V]

I am trying to use a the re.sub() method. I have a string which I backreference with '\\1'. In my substitution parameter, is there anyway I can pass \\1 through a function? For example [CODE] output = re.sub(r'blah blah blah(\d+)','\\SOME_FUNCTION(\\1)',string) [/CODE] where any instance of (\d+) will replaced by the …

Member Avatar for Gribouillis
0
93
Member Avatar for miac09

Hi, I have posted an example code to report overlaps between segments in two lists based on their start and end coordinates. The problem is that the while loop is breaking after 'True' and won't iterate through the lists. So, in the example lists it will only return (True, 0, …

Member Avatar for TrustyTony
-1
224
Member Avatar for Purkinje

I have a question about function-based decorators. When I make the first call to sqrt(), I enter the decorator function, which I understand. However, every subsequent call to sqrt() only calls the temp_func, not the actual decorator again. I thought decorators were called every time the method is called, but …

Member Avatar for Purkinje
0
190
Member Avatar for elieobeid7

i had some problem with python so i tried to fix it and now i can't use pypm to install anything, see this picture [url]http://s1201.photobucket.com/albums/bb354/elieobeid7/?action=view&current=er.jpg[/url] can you fix it? I'm using activepython 2.7

Member Avatar for elieobeid7
0
94
Member Avatar for iwant2learn
0
110
Member Avatar for jfarny

Hello all, I created a simple game using the pygame and livewires packages a few years ago on a windows PC. Since then my pc died on me :( and I've switched over to a mac. I decided I wanted to dust off my old game, make some modifications, and …

0
85
Member Avatar for flebber

How do I use glob with urllib2? So what I have been trying to acheive with no success is creating a list of file names with glob from two sources and comparing them and download file if it doesn't exist. I can't get past the start because I am not …

Member Avatar for snippsat
0
2K
Member Avatar for ia2196

Hello, I get following error while importing h5py. Can some one please help me in how does this work. import h5py File "/usr/lib/python2.6/site-packages/h5py-1.3.1-py2.6-linux-x86_64.egg/h5py/__init__.py", line 24, in <module> import h5 File "h5.pyx", line 386, in init h5py.h5 (h5py/h5.c:5557) File "h5.pyx", line 359, in h5py.h5.init_hdf5 (h5py/h5.c:3946) File "h5r.pxd", line 24, in init …

Member Avatar for Gribouillis
0
453
Member Avatar for kingdeslok

So I'm creating a backup GUI in Python which basically asks the user for their username/password and source directory so it can be rsynced over to a remote server. The only trouble I'm coming across is passing the password (entered in the GUI) to the server after I execute the …

Member Avatar for kingdeslok
0
532
Member Avatar for arindam31

Regular Expression (RE) They can be used with string operations. Using this, we specify the rules for the set of possible strings that we want to match (Searching for patterns in another string). Note : its finds FIRST instance of that pattern We can also use REs to modify a …

Member Avatar for arindam31
-1
234
Member Avatar for manni123

hii, i am new to python.. i want to run a batch file on a remote computer by running python script on my computer both in the same network. i am able to run batch file on my computer in python script using subprocess, but not able to access the …

Member Avatar for Gribouillis
0
3K
Member Avatar for theharshest

I am using the following code to extract second name from the html having following kind of lines - <tr align="right"><td>3</td><td>Matthew</td><td>Brittany</td> So, I want to extract "Brittany" from the above line [CODE]for line in f: match3 = re.search(r'$([a-zA-Z]+)(</td>)',line) if match3: print match3.group(1)[/CODE] But this ain't working. Please help.

Member Avatar for Gribouillis
0
445
Member Avatar for fokys

[CODE]con=L2DatabaseFactory.getInstance().getConnection() rem=con.prepareStatement("DELETE FROM buffer_scheme_contents WHERE scheme_id=? AND skill_id=? AND skill_level=? LIMIT 1") rem.setString(1, scheme) rem.setString(2, skill) rem.setString(3, level) try : rem.executeUpdate() except : pass if getBuffCount(scheme) == 0 : HTML = getOptionList(scheme) else : HTML = viewAllSchemeBuffs(scheme,eventParam2,"remove") return HTML if event == "add_buff" : event = eventParam1.split("_") scheme = event[0] …

Member Avatar for fokys
0
192
Member Avatar for knan

<text> <p><s id="s1"><ng><w pws="yes" id="w1" p="CD">25</w> <w l="woman" pws="yes" id="w4" p="NNP" common="true" headn="yes">Woman</w></ng> <vg tense="past" voice="act" asp="simple" modal="no"><w l="create" pws="yes" id="w10" p="VBD" headv="yes">created</w></vg> <pg><w pws="yes" id="w18" p="IN">for</w></pg> <ng><w vstem="succeed" l="success" pws="yes" id="w22" p="NN" headn="yes">success</w> <w l="barbie" pws="yes" id="w30" p="NN" headn="yes">barbie</w></ng> <ng><enamex type="location"><w l="reynold" pws="yes" id="w37" p="NNP" locname="single">Reynolds</w></enamex> <w l="sep" pws="yes" …

Member Avatar for snippsat
0
221
Member Avatar for sneekula
Member Avatar for Peacer

Let's say the website has this code: [url]http://www.hypergurl.com/randomimage.html[/url] What it does is each time you load the page the script generates a random number and loads the appropriate image. Let's just say that the image is an image of that number and this website displays this random number in text …

0
43
Member Avatar for fingerpainting

Say I have a list of lists as follows (which I do): [CODE][['Value1', 'Value2', 'Value3'], ['Value1', 'Value2', 'Value3'], ['Value1', 'Value2', 'Value3'], ['Value1', 'Value2', 'Value3']][/CODE] What I want to accomplish is if in any list Value1 & Value2 equal the Value1 & Value2 of any other list, I want to merge …

Member Avatar for TrustyTony
0
630

The End.