3,386 Posted Topics

Member Avatar for Creatinas

shouldn't it be [CODE] response = urllib2.urlopen(self.areaa.GetValue()) [/CODE] urlopen does not know anything about wx.TextCtrl widgets. Check your naming of things and using of empty lines. You should also let wx handle the suitable size of widgets and not use absolute positioning and sizing ([URL="http://www.daniweb.com/software-development/python/threads/128350/623598#post623598"]sizers[/URL]).

Member Avatar for snippsat
0
1K
Member Avatar for RoqueyB

Is input shown [B]in the assignment[/B] red? i think you have other problem, but as you do not post your complete code, we can not know what.

Member Avatar for RoqueyB
0
2K
Member Avatar for mools3
Member Avatar for philipshoe
Member Avatar for milil

I have posted code for just a case as it is quite typical case: [URL="http://www.daniweb.com/software-development/python/code/289548"]Picking piece of string between separators[/URL] Also it is simple to get these pieces by regular expression using the re module. You then must take care that greedy matching does not take the first beginning separator …

Member Avatar for milil
0
194
Member Avatar for JoshuaBurleson

As I know you use Python 3.2.2, it is good to use ttk themed widgets, documentation is here: [url]http://docs.python.org/py3k/library/tkinter.ttk.html?highlight=ttk#tkinter.ttk[/url]

Member Avatar for Gribouillis
0
231
Member Avatar for philipshoe

use [iCODE]number, digit= divmod(number, 10)[/iCODE]. Continuation condition should be [iCODE]while sum(digits) > 9:[/iCODE] [CODE]>>> number = 123456 >>> while number: number, digit = divmod(number, 10) print digit 6 5 4 3 2 1 [/CODE]

Member Avatar for TrustyTony
0
181
Member Avatar for TrustyTony

Today advertisement is overflowing the first message, like earlier version of Nokia browser, where quoted message is overflowing the new message.

Member Avatar for Dani
0
191
Member Avatar for TrustyTony

I get old search result when clicking the menu bar on bottom of the window. I would also much appreciate one word text or iconic menu for mobile phone browsers once the bug is fixed. To reproduce (Platform WindowsXP, browser Firefox 4.0.1) I click New Posts after clicking Python Forum, …

Member Avatar for Dani
0
248
Member Avatar for TrustyTony

Very trivial program which could be thought as conclusion from the Quiz posts (thanks Gribouillis for inspiration for format)

Member Avatar for TrustyTony
0
195
Member Avatar for khsoccer

Sure, when you show your code and tell about your problems. Do not forget to push the CODE before pasting your code. Happy coding!

Member Avatar for Schol-R-LEA
0
443
Member Avatar for Stackheuw

Looks like you are putting data to bins: [url]http://www.daniweb.com/software-development/python/code/373120[/url], just integer data and self-defined bins. Numpy should handle it with ease.

Member Avatar for Stackheuw
0
276
Member Avatar for TrustyTony

Looks like every single thread gets double tweeted immediately by one guy (in software development), see attached sample.

Member Avatar for Dani
0
114
Member Avatar for veeresh_cm

You could combine reading in and comparison so you save replacement instead of the searched one to memory record during the read. Then you do not need to move string arrays in memory, only allocate space for the array and write it out after scan and replace.

Member Avatar for TrustyTony
0
314
Member Avatar for TrustyTony

There was question about encryption in Delphi/Pascal forum and a guy was suggested reversing the bits as additional step (I do not know if he in reality meant XOR 255, that is making 0's 1's and vice versa). As it keeps still same distribution of letters I suggested as better …

0
634
Member Avatar for M09

You came to right place, this forum have loads of 'sticky thread' which are shown in beginning of threads organised our dear moderator and mentor vegaseat, starting with [url]http://www.daniweb.com/software-development/python/threads/20774[/url]. Of course for information to solve these, you should use good tutorial like one in python.org and maybe also book like …

Member Avatar for M09
0
231
Member Avatar for momartin

Use Python commands, like os.listdir(os.curdir), not system commands. Better you make code in Python for whole thing which is goal of your commands. Also you should use subprocess if you do need to run a command: [url]http://jimmyg.org/blog/2009/working-with-python-subprocess.html[/url]

Member Avatar for Gribouillis
0
1K
Member Avatar for TrustyTony

Dig up this for discussion thread request and some Googling. By little experiment found the different forms for sending message commands. Could no send in Python3 the code of program itself so only simple test "Hello". Sorry that subject is left incorrectly refering program name.

Member Avatar for JoshuaBurleson
3
2K
Member Avatar for Skrell

r'C:\*.*' not inside the quotes. See [url]http://www.tutorialspoint.com/python/python_strings.htm[/url] for all about strings.

Member Avatar for TrustyTony
0
208
Member Avatar for jfussion

Have you by the way seen [url]http://www.daniweb.com/software-development/python/threads/128350/1545337#post1545337?[/url]

Member Avatar for TrustyTony
0
82
Member Avatar for Fireprufe15

Unfortunately your encruyption is very weak, as it uses sequence of three operations to map single letters to single letters keeping the letter frequencies of the original message. These could be replaced by doing a single lookup table for each non-ascii letter value 0..255 and for each possible shift for …

Member Avatar for Fireprufe15
0
294
Member Avatar for go_big12

Maybe you would need to switch over to pySide (aka pyQT) or wx toolkits. They have more complicated formatting available. Here is example of superscript used for printing polynomials in main text box using FancyText of wx: [url]http://www.daniweb.com/software-development/python/code/322922[/url]

Member Avatar for woooee
0
476
Member Avatar for SpiritualMadMan

I can not speak of everybody, but for me impression of your design looks overcomplicating simple things by bad design joices. I do not see why you need threads, how long running the processes are. Examples you have shown look simple input forms, but maybe you have long running database …

Member Avatar for SpiritualMadMan
0
161
Member Avatar for Danielle87

I recommend good tutorial on Python or book. This looks good for me (even as programmer, I learned from tutorial [url]http://docs.python.org/tutorial/index.html[/url]) [url]http://diveintopython.org/[/url]

Member Avatar for TrustyTony
0
174
Member Avatar for lochnessmonster

And of course that other guy should have rights to read your memory block and access to the system in first place.

Member Avatar for TrustyTony
0
146
Member Avatar for RealNoob

You can post code in zipped file, once you push th [B]Go Advanced[/B] or reply by [B]Use Advanced Editor[/B], attached to your post, email communication is not according to rules, as it excludes others from discussion.

Member Avatar for Duoas
0
907
Member Avatar for TrustyTony

Here is example how data can be summed to dictionary or you can use numpy.histogram to sum the data as weights of the categorized data.

Member Avatar for Stackheuw
2
2K
Member Avatar for Orymeyer
Member Avatar for cse.avinash
0
215
Member Avatar for Reverend Jim

I got this way also right mouse event visible, but mouse wheel still not and middle event came from 'chord middle' ie both left and right down simultanously: [CODE]from visual import * myscene = display(title="test",width=500,height=320) myscene.userspin = myscene.userzoom = False status = label(text="test",color=(1,0,0)) while True: rate(100) for count in range(myscene.mouse.events): …

Member Avatar for Reverend Jim
0
274
Member Avatar for ali13

[QUOTE=pyguy62;1639890]preferred method: [CODE] dcheck() [/CODE][/QUOTE] Thanks for your helping spirit, but now you are giving terrible example, and as this is present in most of your code I think you need some beating to learn the do of Python. So I will analyse this piece of code (changing it better), …

Member Avatar for ali13
0
3K
Member Avatar for JoshuaBurleson
Member Avatar for Danielle87

Do [URL="http://wiki.python.org/moin/Generators"]generator [/URL]for paragraphs and do re.search in each of those separately.

Member Avatar for TrustyTony
0
144
Member Avatar for tommygee100

Something like this: [CODE]from itertools import product a = [5,3,1] b = [6,5,2] c = [2,0,-2] def valid(*args): """ define the requirement here""" print('Checking: ', args) return args[0] == min(args) print(next(comb for comb in sorted(product(a, b, c), key=sum, reverse=True) if valid(*comb))) [/CODE]

Member Avatar for TrustyTony
0
352
Member Avatar for maddocspace

Small typo I think: if lines.strip().startswith("**HM", "**HW"): should be [CODE] if lines.strip().startswith(("**HM", "**HW")):[/CODE] And same way you can use: [CODE]elif not under and line_strip.endswith(("S1", "S2", "S3", "S4", "S5", "S6")):[/CODE] and the not under you can eliminate if you move the branch one down after [CODE]elif under:[/CODE]

Member Avatar for maddocspace
0
215
Member Avatar for TrustyTony

I finally modernized this code. It is very primitive, but it is nice to have basic version, even it does a lot of mistakes. You could add features, like repetition elimination, or you can check the compete chatbot: [url]http://www.jezuk.co.uk/cgi-bin/view/software/whereskal[/url].

Member Avatar for TrustyTony
0
941
Member Avatar for JoshuaBurleson

Are you sure extension is same, you could for example have html registered for firefox and htm for ie?

Member Avatar for snippsat
0
3K
Member Avatar for kylelendo
Member Avatar for DevourOfDarknes
Member Avatar for DevourOfDarknes
0
2K
Member Avatar for JoshuaBurleson

You mean infinite recursion from line 42 until deck become empty in line 58? Do loop in main program, do not put looping inside the class. Would be easier to advice if I would know which rules you are trying to apply.

Member Avatar for TrustyTony
0
233
Member Avatar for debasishgang7

Before re experts start to give they advices I give the standard answer for HTML: Don't, use for example BeautifulSoup module instead.

Member Avatar for debasishgang7
0
129
Member Avatar for shanki himanshu

From [url]http://www.techterms.com/definition/iteration[/url] [QUOTE]Iteration is the repetition of a function or process in a computer program. Iterations of functions are common in computer programming, since they allow multiple blocks of data to be processed in sequence. This is typically done using a "while loop" or "for loop" (see the examples below). …

Member Avatar for sharathg.satya
0
136
Member Avatar for David321
Member Avatar for raptr_dflo
0
667
Member Avatar for wolf29

You are not setting variables from command output but return value of system call function, which should be set from commands error code. I would not use system codes but check for example existence of mount point sda18 directory in /media directory in my Ubuntu distributions case.

Member Avatar for wolf29
0
144
Member Avatar for Danielle87

Works here in Python 2.6.6. Output: [CODE]work - Use a work breakdown structure for a large project. [/CODE] Of course you do not need re if you do not want to, for example for simple searches of given exact word: [CODE]# finding a search word fname = "SearchFile.txt" word = …

Member Avatar for Danielle87
0
2K
Member Avatar for TrustyTony

I was not happy of solution [url]http://chaos.weblogs.us/archives/331[/url] for one line Ceasar cipher, so I wrote my own version without import by using raw_input (change to input for Python3). Chance to play little with memoryview object also. Crypt: give displacement amount for shift Decrypt: give -displacement amount shift

Member Avatar for TrustyTony
0
420
Member Avatar for Skrell
Member Avatar for JoshuaBurleson

Check it out, what is ab? It is one global instance of Addressbook? Which class searchfor belongs, isn't it Adressbook class? Shouldn't you refer the class instance as self (again), not ab?

Member Avatar for TrustyTony
0
190
Member Avatar for JoshuaBurleson

Do you mean the command window which comes when you run files ending with .py and which do not show when you change extension to .pyw or run it with pythonw.exe otherwise?

Member Avatar for TrustyTony
0
356
Member Avatar for JoshuaBurleson

Do you mean searching for first letter of word: [CODE]re.findall('\s\w', r"For example how would I find \s\w within a string and then change that character?")[/CODE]

Member Avatar for JoshuaBurleson
0
307
Member Avatar for Skrell

I do not know if you use Python2 or 3, but reacent verions can use print function like this [CODE]from __future__ import print_function with open("formatted_numbers.txt", 'w') as outfile: print('%.3g, %2.3f' % (123.4, 123.4), file=outfile) [/code]

Member Avatar for markfw
0
229

The End.