Posts
 
Reputation
Joined
Last Seen
Ranked #133
Strength to Increase Rep
+13
Strength to Decrease Rep
-3
100% Quality Score
Upvotes Received
91
Posts with Upvotes
82
Upvoting Members
45
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
47 Commented Posts
~760.93K People Reached
About Me

I love life.

Interests
Video Games, Movies, Drinking, Fishing, Hiking
PC Specs
1. Windows XP SP2, Core2 Duo @ 2GHz, 2 GB 2. Ubuntu Hardy Heron, Pentium4 @ 2.3 GHz, 2.5 GB 3. Windows…
Favorite Tags

761 Posted Topics

Member Avatar for dseto200

If you're using a tuple to keep track of what the user has already tried then you'll need to concatenate in the following manner: [code=python] >>> a = () >>> a += 'a' Traceback (most recent call last): File "<input>", line 1, in <module> TypeError: can only concatenate tuple (not …

Member Avatar for Reverend Jim
0
3K
Member Avatar for lllllIllIlllI

I did this and had a hell of a time figuring it out! Go to Run -> "Run...", then type in [icode]C:\PythonXX\pythonw.exe "$(FULL_CURRENT_PATH)"[/icode] ** Note I use pythonw.exe, you can just as easily use the standard python.exe (I just hate that console window), and when you've got that hit the …

Member Avatar for Kuldeep_8
1
3K
Member Avatar for funfullson

[QUOTE=funfullson;1104986]sorry.I saw links but i can not solve my problem yet. ... .but how can i do it?[/QUOTE] You should really follow those links that woooee provided. For this type of task you should be either using pexpect or subprocess PIPES, not [ICODE]os.system[/ICODE].

Member Avatar for Krystor
0
2K
Member Avatar for zac202020

Here's a way: [code=python] shape = 0 while shape != 4: # Your existing code can go here [/code] Just slap that -blam- into a while loop and you've got a class 5 repeater.

Member Avatar for Gribouillis
0
4K
Member Avatar for mms6

[QUOTE=mms6;1029512]anyone plz help me out here[/QUOTE] We're not here to do your homework for you. But good job on copy-pasting your assignment. [QUOTE=masterofpuppets;1029534]hi after reading the specification like 5 times here's what I came up with :)[/QUOTE] Dear MasterofPuppets, You shouldn't be spoon feeding people looking for us to do …

Member Avatar for Hassaan_4
-2
894
Member Avatar for vegaseat

Wow turtle is fun to play with :) [code=python] import turtle, time tp = turtle.Pen() tp.color('blue') for k in xrange(51): for j in xrange(k): tp.right(360/float(k)) tp.forward(25) time.sleep(3)[/code] *Oops I didn't mean to post this here, it was supposed to be in the thread asking about turtle *sorry* Editor's note: It's …

Member Avatar for vegaseat
23
34K
Member Avatar for vegaseat

[QUOTE=Ene Uran;871712]Beer was the national drink of ancient Egypt. The pharoahs even appointed a "royal chief beer inspector" to protect its quality. I don't think there is such a person in the US.[/QUOTE] Well each brewery does employ their own Brew Master that checks the brew on a daily basis, …

Member Avatar for vegaseat
11
9K
Member Avatar for lapo3399

As far as conversions are concerned there are a number of functions: [QUOTE]int(x [,base]) converts x to an integer long(x [,base]) converts x to a long integer float(x) converts x to a floating-point number complex(real [,imag]) creates a complex number chr(x) converts an integer to a character unichr(x) converts an …

Member Avatar for vegaseat
0
2K
Member Avatar for python1

Gribouillis I'm not sure if this has been fixed or not (perhaps you're using a newer version of Python where this bug has been eliminated) but when I use your path.join this is what I get: [code=python] >>> from os.path import join as pjoin >>> pjoin("C:", "foo", "bar", "baz") 'C:foo\\bar\\baz' …

Member Avatar for Parikshit_1
0
44K
Member Avatar for kiddo39

[code=python] >>> answer =('7', 'Q', '5', 'H', '9', '4', '3', '8', 'L') >>> ''.join(answer) '7Q5H9438L' >>> [/code]

Member Avatar for TrustyTony
0
31K
Member Avatar for jcafaro10

Sometimes, if the module isn't in the same place, it is a matter of the path. At the begging of your progam you can do something like: [code=python] import sys sys.path.append('/path/tomy/module') from MyMod import moduleA [/code] However I don't know how Eclipse as an IDE differs in terms of working …

Member Avatar for snippsat
0
157
Member Avatar for harrykokil

If you search this forum for pygame you will find tons of examples of games that our forums members have creating using said module. Either that or google.

Member Avatar for TrustyTony
0
10K
Member Avatar for Opsive

It depends heavily on the format that you are receiving the time data in. Could you provide us with an example of EXACTLY what you are getting? If it is coming in as a string with the Time Zone then iyou simply use time.strptime(), which will make it very easy …

Member Avatar for Gribouillis
0
913
Member Avatar for sravan953

I believe that [icode]subprocess.call[/icode] is used to open a file as if you had "dobule-clicked" the file's icon. If you're looking to do it "within" python you'll need to search this forum for how others have done it before you.

Member Avatar for aru123
0
2K
Member Avatar for Astudent

[QUOTE=tyincali;724172] (I think (I) (Might) ((See) A Problem) (Here) [/QUOTE] This is improper syntax, you're missing a closing parenthesis ;) No but seriously, to the OP: the error you are getting is trying to tell you that the image file that you're trying to open doesn't exist. You need to …

Member Avatar for vegaseat
0
7K
Member Avatar for zachabesh

I don't know if this module has been updated to support xlsx, but it provides a method to convert xls to xml: [URL="http://www.lexicon.net/sjmachin/xlrd.html"]xlrd[/URL]

Member Avatar for zarfishan
0
5K
Member Avatar for abacus_x

You're not multiplying by 2^16 and 2^8 you're shifting by 16 and 8 bits, respectively. By doing so (and then adding), you're able to fit the two letters into a single 16 bit block... or something like that.

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

Greetings, welcome. Wondering what version of Python you're using and on which platform? First a tip: Don't EVER use tabs for Python indentation. It's pretty much standard practice to use 4 spaces instead. Most text editors can be set up to handle this. Here: Read over [URL="http://www.python.org/dev/peps/pep-0008/"]PEP 8[/URL], and then …

Member Avatar for Blacktono4
0
1K
Member Avatar for jworld2

An even easier workaround for being able to import modules from ANY directory is to modify the sys.path variable at run time. So at the beginning of your code do something like this: [code=python] import os,sys sys.path.append('/path/to_my/module') import my_custom_module [/code] And if you're working with a hard-coded windows path make …

Member Avatar for vegaseat
0
5K
Member Avatar for jancho1911

Please use code tags so that your indentation is not lost, and so that we may better read your posts. Code tags go like this: [noparse][code=python] # MY code goes between these tags! [/code][/noparse]

Member Avatar for callmerudy
0
215
Member Avatar for johndb

[QUOTE=vegaseat;1038164]My advice, get rid of Vista as soon as you can.[/QUOTE] And if that's not an option make sure you're both installing and running all these things by right-clicking the executable and selecting "Run as Administrator"

Member Avatar for alex.avak
0
302
Member Avatar for mahela007

[QUOTE=mahela007;1041780]Is it possible to keep writing the output of a program on the same line instead of moving to a new line every time? The output should be written over the preceding output. An example would be a kind of counter... say a number that counts from 1 to 10 …

Member Avatar for Lucaci Andrew
0
11K
Member Avatar for ndoe

Without using list comprehension: [code=python] f = open( "data.txt" ) lines = f.readlines() f.close() f = open( "data2.txt", 'w' ) for line in lines: line = line.strip() if line: f.write( "%s " % line ) f.write( "\n" ) f.close() [/code]

Member Avatar for munna03
0
2K
Member Avatar for Stefano Mtangoo

I've used [URL="http://icofx.ro/"]IcoFX[/URL] in the past with no trouble

Member Avatar for jsdevel
0
165
Member Avatar for Tyler212

It is impossible to answer your question without more information. If you are implementing a CGI HTTP server you should reference the following module, which may already provide some of the functions you're looking for: http://docs.python.org/library/cgihttpserver.html#module-CGIHTTPServer

Member Avatar for jlm699
0
77
Member Avatar for Niner710

You could create your own class based on dictionary that checks whether that key already exists in `__setattr__` and then add the value to a list/tuple. When you do your `get()` you can then use `isinstance` to act accordingly.

Member Avatar for TrustyTony
0
3K
Member Avatar for VinceW

Use code tags: [noparse][code=python] #Code in here [/code][/noparse] This will make your code readable for us forum members, which in turn helps us to solve your problem. In order to limit the number of guesses, you should be using an [icode]if guesses == allowed_guesses:[/icode] statement, or something similar.

Member Avatar for themoviegeek
0
332
Member Avatar for dh273
Member Avatar for tls-005
0
16K
Member Avatar for leegeorg07

[QUOTE=leegeorg07;903214]Hi, me again, sorry if this sounds completely noobish but I have no idea what to do, even with shadwickman's help could anyone help?[/QUOTE] You have no idea what to do with regards to what? You don't know how to download the files? Browse the source tree? What?

Member Avatar for SamarthWiz
0
167
Member Avatar for sneekula

[QUOTE=sneekula;862497]It's time again to poll the well educated folks at DaniWeb about the possible cause of the end of humanity on earth.[/QUOTE] I foresee an unavoidable uprising of our machines against us. Machines kill people at alarming rates, and we only keep trying to make them better and smarter... more …

Member Avatar for bumsfeld
2
935
Member Avatar for ihatehippies

[QUOTE=ihatehippies;847706]How do you keep a wx frame from not responding while the code is running in the background? ie a search or other demanding function.[/QUOTE] You can use a busy cursor so that the user can't click on anything within the application: [code=python] wx.BeginBusyCursor() # Do all the stuff here …

Member Avatar for ihatehippies
0
913
Member Avatar for hyperzero4

What Platform are you on? If this is linux you'll likely need to install tcl/tk to enable the Tk support portion of OpenGL

Member Avatar for creed_creed
0
791
Member Avatar for serkan sendur

Fight Club [QUOTE=Tyler Durden]F*ck redemption. We are God's unwanted children? So be it! ... You're not your job. You're not how much money you have in the bank. You're not the car you drive. You're not the contents of your wallet. You're not your f*cking khakis... You are not special. …

Member Avatar for ronnieaka
0
1K
Member Avatar for Shadow-Illusion

You should uncomment your [icode]commit[/icode] statement. You need to commit your transactions before they go through.

Member Avatar for djmagba
0
3K
Member Avatar for vmars

In the top-most bar (with the <DANIWEB> logo) select Control Panel -> Edit Options. On that page look for Messaging & Notification section (should be second gray section) [B][U]Uncheck[/U][/B] the boxes that read "[COLOR="Red"]Receive Occassional Email from DaniWeb[/COLOR]" and "[COLOR="Red"]Receive Email from Other Members[/COLOR]". Finally, on the drop down for …

Member Avatar for Stefano Mtangoo
0
398
Member Avatar for Vibze

If the script has access to the URL you could do something like: [code=python] >>> url_in = 'http://host.com/script/2008/05/05' >>> match_text = 'script/' >>> index = url_in.find(match_text) + len(match_text) >>> url_in[index:].split('/') ['2008', '05', '05'] >>> [/code] Is that kind of what you were looking for?

Member Avatar for Schol-R-LEA
0
2K
Member Avatar for deeapk_kapdi

Usually it's as simple as [icode]python myscript.py[/icode] If python isn't in the path you'd need the full path to the python executable.

Member Avatar for TrustyTony
0
9K
Member Avatar for jlm699

Please pardon my lack of networking knowledge. I am trying to figure out how to setup routing tables to connect to machines that are on a subnet on a different network. My current machine is sitting on a network, we'll call it Net1: My IP is 10.44.76.X (subnet 255.255.254.0 - …

Member Avatar for ipradip
0
263
Member Avatar for prashanth s j

Go through the input file line by line writing to an output file - using either regular expression or a simple [icode]if 'dtp' in line:[/icode] expression, which when true skips writing the line to the output file.

Member Avatar for jlm699
0
107
Member Avatar for LabPsycho
Member Avatar for Clueless86

[QUOTE=zachabesh;939198]the interactive shell (a la IDLE) is pretty darn awesome for testing stuff out. [/QUOTE] Agreed. I use Notepad++ for my editing and have it set up with all kinds of whiz-bangs. I hit F6 to pull up an instance of PyCrust which is a Python Shell with autocomplete, syntax …

Member Avatar for Stefano Mtangoo
0
322
Member Avatar for Feenix45

Here's a start: [url=http://www.google.com/search?hl=en&q=python+menu&btnG=Google+Search&aq=f&oq=]Google It[/url]

Member Avatar for Bart_uam
0
2K
Member Avatar for mahela007

[QUOTE=mahela007;1041779]is it possible, for example, to make the text that appears as output on the command line appear in a certain colour using python?[/QUOTE] Yes. But the answer depends on your platform. In windows you can use the command-line [ICODE]COLOR[/ICODE] command. Here's how: [code=console] Microsoft Windows XP [Version 5.1.2600] (C) …

Member Avatar for Tech B
0
1K
Member Avatar for thehivetyrant

Use the [ICODE]button_object.config(text=my_text)[/ICODE] option. [URL="http://effbot.org/tkinterbook/button.htm#Tkinter.Button.config-method"]Source[/URL]

Member Avatar for thehivetyrant
0
12K
Member Avatar for ds2000

I'm sorry to hear that you have to work with Jython. My condolences. That being said, why don't you insert a [icode]print type(strTest)[/icode] to see if it's actually being presented as a string.

Member Avatar for woooee
0
226
Member Avatar for revathskumar

It would help to know what GUI toolkit you're working with; however a good method (in wx) would be to specify the ID of the window, and then check to see if that ID is already being used or not as the basis of opening the window.

Member Avatar for lllllIllIlllI
0
152
Member Avatar for rwbarrette

[QUOTE=rwbarrette;1107124]I can't seem to work out the scope of the variables so that they can be seen in the drawline function[/QUOTE] The things in drawline that are referenced as being members of self are defined in __init__ without being a member of anything (ie they are objects that are created …

Member Avatar for jlm699
0
97
Member Avatar for germ

[QUOTE=germ;1105936]Does anyone have information that will sharpen my python programming knowledge very quickly with some get straight to the point programming tutorials and information?[/QUOTE] I suggest reading the book entitled Dive into Python, available for free [URL="http://diveintopython.org/"]here[/URL] EDIT: Also, it would benefit you to make use of the search capability …

Member Avatar for jlm699
-2
92
Member Avatar for J_IV

[QUOTE=J_IV;1104776]Looks fine to me. Can anyone tell what the problem is?[/QUOTE] You never defined [icode]t[/icode]

Member Avatar for jlm699
0
89
Member Avatar for prankyrules

Are you asking if your program will work in Unix, or are you literally asking how to transfer a file from one computer to another?

Member Avatar for jlm699
0
115

The End.