226 Posted Topics

Member Avatar for TrustyTony

Works correctly. Order of operations. This also works: [CODE](-1+0j)**.5[/CODE] without error.

Member Avatar for Skyelher
0
341
Member Avatar for dhanapal86mca

Python for .Net is good, but [URL="ironpython.net"]IronPython[/URL] is better. It's Python written in C#, and you can use it with Visual Studio 2010. Check out the main website. Main use of Python? It's easy and powerful. You can embed it in your C# application if you want. You can also …

Member Avatar for ultimatebuster
0
115
Member Avatar for Mkaveli
Member Avatar for shashimgowda8

Embedded in your C# windows application? That sounds like IronPython. You can add a reference to IronPython and Microsoft.Scripting.Hosting assemblies to embed a Python application inside your C# one.

Member Avatar for shashimgowda8
-1
238
Member Avatar for haro2x

Why do you have so many global statements? Or did glade do that? You should have self.r, self.a1, etc instead of them all being global. Global is bad.

Member Avatar for haro2x
0
153
Member Avatar for echellwig

I repro-d your error with this: [CODE]"".replace(0.02,0)[/CODE] What exactly are you trying to do?

Member Avatar for echellwig
0
576
Member Avatar for YasaminKh

What you seem to be trying to do is multiply a list by another list. What do you expect the results to be?

Member Avatar for YasaminKh
0
187
Member Avatar for aframe

Either externally in a configuration file or database, or in the registry for Windows. There is no other way. EDIT: or environment variables

Member Avatar for griswolf
0
2K
Member Avatar for funfullson

Well, you won't get an experience like those C# reporters, I think, because there really isn't a Visual Studio for Python. You can take a look at this SO question: [URL="http://stackoverflow.com/questions/177799/what-is-a-good-pdf-report-generator-tool-for-python"]http://stackoverflow.com/questions/177799/what-is-a-good-pdf-report-generator-tool-for-python[/URL]

Member Avatar for jcao219
0
90
Member Avatar for Pykoda

Always use os.path.join! It's much easier and there's less room for error. [icode]workPath = os.path.join('Prod','Projects',project,'shots',path,'render','REN')[/icode]

Member Avatar for TrustyTony
0
125
Member Avatar for cableguy31

[QUOTE=tonyjv;1261087]I was meaning this Linux command: [url]http://linux.about.com/library/cmd/blcmdl1_file.htm[/url][/QUOTE] I think he also needs a Windows method. If you want to write in a specific encoding, then you can do this: [CODE]import codecs out = open("myfile.txt", "w") out.write(codecs.BOM_UTF8) #makes it obvious what encoding it is out.write(unicode(mytext,"UTF-8")) out.close()[/CODE] If you try to write …

Member Avatar for cableguy31
1
747
Member Avatar for hondros

[QUOTE=ultimatebuster;1260490]Python is extremely uncommon for use with websites. Sure, it's powerful, easy, but when it comes to real website (assuming that's what you want to do), you need php.[/QUOTE] Very untrue. "Real website"? Is washingtonpost real enough? PHP is great, but Rails and Django are simply much more powerful. ASP.NET …

Member Avatar for satishvis
0
576
Member Avatar for Hawkpath
Member Avatar for Beat_Slayer
0
126
Member Avatar for personx1212

This is a debugger/disassembler written in Python: [url]http://pedram.redhive.com/PyDbg/docs/[/url]

Member Avatar for personx1212
0
93
Member Avatar for wiluo
Member Avatar for mehdi0016

Very sorry, I don't think any of us have ever used Zope. I think you are better off asking somewhere else. Other threads concerning Zope that are unanswered: [URL="http://www.daniweb.com/forums/thread257316.html"]http://www.daniweb.com/forums/thread257316.html[/URL] [URL="http://www.daniweb.com/forums/thread264047.html"]http://www.daniweb.com/forums/thread264047.html[/URL]

Member Avatar for Tech B
0
75
Member Avatar for sravan953

You can do this [CODE]longnumber = long(longnumber) #and it should display the whole thing[/CODE] The << is operation left-shift.

Member Avatar for TrustyTony
0
198
Member Avatar for echellwig
Member Avatar for TrustyTony
0
48K
Member Avatar for echellwig

[QUOTE=echellwig;1257892]Inserting %s didn't seem to do anything except put %s in my outfile. I think the problem is that the program is writing literally what I put in the command. So I need a way for it not to do that, if that's possible.[/QUOTE] That means you did something wrong. …

Member Avatar for echellwig
0
155
Member Avatar for ryan461

[QUOTE=griswolf;1255778]woops. My bad. This is why we need constructors... I was just typing, not actually trying. I should learn. This code works (but :hasattr isn't a good introduction to classes)[CODE]class SimpleMessageClass: def setMessage(self, message): self.message = message def printMessage(self): if hasattr(self,'message'): print(self.message) else: print("Sorry, I have no message")[/CODE][/QUOTE] Just a …

Member Avatar for ryan461
0
127
Member Avatar for angraca

One thing I see is [icode]while done==False[/icode] You should change that to [icode]while not done[/icode] Also, you should have the imports at the beginning, not in the middle of a while loop, since you only import once, usually at the beginning of execution.

Member Avatar for vegaseat
0
940
Member Avatar for zentropy

Well, ethernet cables connect to your network card, so you'll be dealing with your network card mainly. You need to search for modules that allow for [icode]packet capture[/icode] and things like that.

Member Avatar for tzushky
0
350
Member Avatar for lewashby

[QUOTE=Garrett85;1253989]No. It's not the exactly the same thing as pygame and I'M afraid it wont work with the book I'M trying to learn how to program with. "Head First Programming".[/QUOTE] That means that you will have to either skip learning pygame, or install Python 2.6 (I use it personally, I …

Member Avatar for Kruptein
0
125
Member Avatar for Pinchanzee

You said earlier that Python cannot do case statements. It can somewhat do that, in a different fashion, like this: [CODE]if a==1: pass #do something elif a==2: pass #do some other thing else: pass[/CODE] which is like [CODE=C#]switch(a) { case 1: //do something break; case 2: //do some other thing …

Member Avatar for Pinchanzee
0
159
Member Avatar for G_S

Why don't you do, [icode]unsortedT = text1.get(1.0, END).split("\n")[/icode] and then [icode]text1.insert(END, "\n".join(sortedT)[/icode]

Member Avatar for TrustyTony
0
134
Member Avatar for jcao219

Interesting right? If you read [URL="http://www.daniweb.com/forums/post1252636.html"]this[/URL] amazing tutorial by lionaneesh, you will understand why I posted this brain-boggling code.

Member Avatar for jcao219
0
161
Member Avatar for CobRalf

The external module should never need some code from the main module, so as griswolf said, you should probably refactor the code.

Member Avatar for griswolf
0
643
Member Avatar for TrustyTony
Member Avatar for Mattokun99

That's what GetWindowText is supposed to do If you want to get the contents, you have to do something like this: [CODE]import win32gui as w WM_GETTEXTLENGTH = 0x0E WM_GETTEXT = 0x0D t1 = w.SendMessage(hwnd, WM_GETTEXTLENGTH, 0, 0) #hwnd has to be the handle to the text control t = " …

Member Avatar for jcao219
0
197
Member Avatar for leiger

You can use Jython...[URL="http://www.jython.org/faq2.html"]http://www.jython.org/faq2.html[/URL]

Member Avatar for leiger
0
154
Member Avatar for ihatehippies

Why is google so fast? It uses extremely great data management, for example, it has its own [URL="http://labs.google.com/papers/gfs.html"]GoogleFileSystem[/URL], uses [URL="http://en.wikipedia.org/wiki/Column-oriented_DBMS"]column-oriented dbms[/URL] it has some very ingenious matching algorithms, and not to mention its highly trained batch of [URL="http://www.google.com/technology/pigeonrank.html"]pidgeons[/URL].

Member Avatar for TrustyTony
0
2K
Member Avatar for i-teq

tonyjv, I fixed your code so it does work. There are some intricacies of magic methods that are tricky. [CODE]# This class describes the currency in terms of its name and conversion rate. class Currency(object): def __init__(self, name, rate): self.name = name self.rate = rate # This class allows for …

Member Avatar for i-teq
0
4K
Member Avatar for G_S

To clarify tonyjv's post, let's so for instance to open daniweb in the default browser would be: [icode]os.startfile("http://www.daniweb.com/")[/icode]

Member Avatar for G_S
0
4K
Member Avatar for jamesl22

This is the kind of question you might want to ask on the Python mailing list. The masters are there.

Member Avatar for jcao219
0
183
Member Avatar for G_S

Well, in your situation, they are the same: Let's look at this: [CODE]if True: print("A") elif True: print("B")[/CODE] Would display A. Now this: [CODE]if True: print("A") if True: print("B")[/CODE] Would display A B Get it? Of course, in your situation, os.name can't be two things at once, and elif is …

Member Avatar for G_S
0
146
Member Avatar for drfrev

sure, here's an example: [CODE]import ctypes user32 = ctypes.windll.user32 while True: inputhex = raw_input("Please enter your desired key's code (HEX): ") keycode = int(inputhex, 16) #VOID keybd_event(BYTE bVk, BYTE bScan, DWORD dwFlags, PTR dwExtraInfo); user32.keybd_event(keycode,0,2,0) #2 is the code for KEYDOWN user32.keybd_event(keycode,0,0,0) #0 is the code for KEYUP [/CODE] Keycodes …

Member Avatar for jcao219
0
383
Member Avatar for TrustyTony

Tuples aren't necessarily points logically. When comparing lesser than or greater than with tuples, the first element is compared.

Member Avatar for TrustyTony
0
338
Member Avatar for MrAlshahawy

Well... I don't think many of us use Python for Symbian, so it's best that you ask on a Symbian forum, but I see that you already have. I don't think the API for turning on and off bluetooth/wifi/and vibration etc. is public.

Member Avatar for jcao219
0
61
Member Avatar for lsmurfl
Member Avatar for ultimatebuster

MonoDevelop is for .NET, so I think the Python binding is actually IronPython. You can use either [URL="http://ironpython.net/tools/"]IronPython Tools for Visual Studio[/URL], which supports somewhat good code-completion, a WPF designer, and some better Silverlight support. Of course, you'll need at least Visual Studio 2010, and you can get for free …

Member Avatar for jcao219
0
198
Member Avatar for oaktrees

Not part of the standard library, but you can download them and install them easily.

Member Avatar for jcao219
0
125
Member Avatar for funfullson

Private attributes are stupid for dynamic languages. Don't you see Python is dynamic and strongly typed, and C++ is dynamic and strongly typed? Python doesn't have them for a reason. It contributes to the beauty of the Python language. So in other words, it is a [I]feature[/I]. Even private attributes …

Member Avatar for jcao219
0
266
Member Avatar for arty.net

It seems you would use the CallAfter method, as illustrated by sergb. Just remember CallAfter calls its target after the function exits, not immediately.

Member Avatar for arty.net
0
1K
Member Avatar for thejinx0r

[QUOTE=thejinx0r;1229721]I guess I want it to behave as though it was part of my wallpaper. Because when I click on "show Desktop" it still minimizes the window ( in both examples ).[/QUOTE] That is not possible as cross-platform.

Member Avatar for thejinx0r
0
134
Member Avatar for lotrsimp12345
Member Avatar for macca21

Well, you need to first write a class. That class should have a method that is something like [I]newOrder()[/I], and also a collection orders. Then work from there.

Member Avatar for woooee
0
94
Member Avatar for macca21

You don't need that many global statements. Actually, the use of global is discouraged. Since catalog variable is constant, just declare it in the beginning of your file.

Member Avatar for Lizzard013
0
91
Member Avatar for haydensewell
Member Avatar for vegaseat
0
2K
Member Avatar for CobRalf

Your project is unique and complex in design, and I fully understand the problems you have right now. I don't have any knowledge of PyGame, so I can't really help you with the top-most concept (which is what problems #1-3 are related to) Perhaps, after the window.update() method is called, …

Member Avatar for CobRalf
0
769
Member Avatar for TitusPE

The End.