Re: Is there a unique method in python to unique a list?

2012-09-09 Thread Chris Angelico
On Sun, Sep 9, 2012 at 11:44 PM, Token Type wrote: > lemma_set.add(synset.lemma_names) That tries to add the whole list as a single object, which doesn't work because lists can't go into sets. There are two solutions, depending on what you want to do. 1) If you want each addition t

Re: Comparing strings from the back?

2012-09-10 Thread Chris Angelico
On Tue, Sep 11, 2012 at 12:06 AM, Oscar Benjamin wrote: > On 2012-09-10, Steven D'Aprano wrote: >> What interning buys you is that "s == t" is an O(1) pointer compare if >> they are equal. But if s and t differ in the last character, __eq__ will >> still inspect every character. There is no way t

Re: Comparing strings from the back?

2012-09-10 Thread Chris Angelico
On Tue, Sep 11, 2012 at 12:43 AM, Oscar Benjamin wrote: > On 2012-09-10, Oscar Benjamin wrote: >> I haven't looked at the source but my understanding was precisely that there >> is an intern() bit and that not only the builtins module but all the literals >> in any byte-compiled module are intern

Re: Parsing ISO date/time strings - where did the parser go?

2012-09-10 Thread Chris Angelico
On Tue, Sep 11, 2012 at 7:46 AM, Rhodri James wrote: > On Sun, 09 Sep 2012 13:14:30 +0100, Roy Smith wrote: > >> In article , >> Thomas Jollans wrote: >> >>> The ISO date/time format is dead simple and well-defined. > > >> Well defined, perhaps. But nobody who has read the standard could call

Re: Double sided double underscored variable names

2012-09-11 Thread Chris Angelico
On Wed, Sep 12, 2012 at 8:09 AM, Joshua Landau wrote: > If I were to use internal double-underscored names of the form > __BS_internalname__, would the compiled code be able to assume that no-one > had overwritten these variables and never will, even through modification > of, say, locals(). I ask

Re: Double sided double underscored variable names

2012-09-11 Thread Chris Angelico
On Wed, Sep 12, 2012 at 8:48 AM, Joshua Landau wrote: > Well, the problem is that a lot of collisions aren't predictable. > "locals()['foo'] = 2", for example. If it weren't for Python's annoying > flexibility* I would definitely do something very close to what you suggest. > Remember that "locals

Re: how to get os.py to use an ./ntpath.py instead of Lib/ntpath.py

2012-09-11 Thread Chris Angelico
On Wed, Sep 12, 2012 at 5:13 AM, ruck wrote: > I'm not sure how I could have known that ntpath was already imported, since > *I* didn't import it, but that was the key to my confusion. One way to find out is to peek at the cache. >>> import sys >>> sys.modules There are quite a few of them in

Re: Double sided double underscored variable names

2012-09-11 Thread Chris Angelico
f that is what I'm meant to be doing, I'll try > another email address. Mailing to python-list@python from Gmail is exactly what I do, and far as I know, none of my posts are getting lost. But then, I'm seeing all your posts, too, so maybe I just don't know when my posts d

Re: using text file to get ip address from hostname

2012-09-12 Thread Chris Angelico
On Thu, Sep 13, 2012 at 12:24 AM, wrote: > i'm new to Python and i searched the web and could not find an answer for my > issue. > > i need to get an ip address from list of hostnames which are in a textfile. This is sounding like homework, so I'll just give you a basic pointer. You have there

Re: Guides for communicating with business accounting systems

2012-09-13 Thread Chris Angelico
On Fri, Sep 14, 2012 at 1:02 AM, Ben Finney wrote: > What I want is pointers to a putative “What every programmer needs to > know about storing commercial transactions for business accounting” > general guide. > > Does that information already exist where I can point our team to it? Not a guide p

Re: datetime

2012-09-13 Thread Chris Angelico
On Fri, Sep 14, 2012 at 1:19 AM, Max wrote: > Say, it's 09:00 now and Python makes it 11:30 *without* me having specified > "11:30" but only given Python the 2h30m interval. Could you cheat and change the timezone offset? :D ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: Python presentations

2012-09-13 Thread Chris Angelico
On Fri, Sep 14, 2012 at 8:33 AM, Alexander Blinne wrote: > On 13.09.2012 21:01, 8 Dihedral wrote: >> def powerlist(x, n): >> # n is a natural number >> result=[] >> y=1 >> for i in xrange(n): >> result.append(y) >> y*=x >> return result # any object in t

Re: Comparing strings from the back?

2012-09-13 Thread Chris Angelico
On Fri, Sep 14, 2012 at 1:39 PM, Steven D'Aprano wrote: > You're assuming that people read your posts immediately after they read > the post you replied to. Always imagine that your reply will be read a > week after the post you replied to. And a week is extremely generous too; these posts get ar

Re: Guides for communicating with business accounting systems

2012-09-13 Thread Chris Angelico
On Fri, Sep 14, 2012 at 4:28 PM, Ben Finney wrote: > Chris Angelico writes: > >> Don't use MySQL. :) Okay, that's hardly a *rule*, but it's a strong >> recommendation. > > That's another struggle we have in our future, unfortunately. We moved from

Re: pythonOCC examples doesn't work?

2012-09-14 Thread Chris Angelico
On Fri, Sep 14, 2012 at 11:14 AM, Dwight Hutto wrote: > [over a hundred quoted lines snipped] > And if you look at the above in gmail, you can see the ...'s that when > not clicked, won't show some of the responses I leave just above, and > it clips my signature line as well. That's a Gmail featu

Re: pythonOCC examples doesn't work?

2012-09-14 Thread Chris Angelico
On Fri, Sep 14, 2012 at 5:49 PM, Dwight Hutto wrote: >> honest. How do you feel? Interesting... >> > Um, I guess like an inconsiderate bandwidth hog, but from now on I'll > trim more text. What you may have missed was that that was a quote from Princess Bride. Don't take it personally :) > First

Re: What's wrong with my arc tangens calculation?

2012-09-14 Thread Chris Angelico
On Fri, Sep 14, 2012 at 8:49 PM, xliiv wrote: > I do some math with python: > > import math as m > m.degrees(m.atan(2)) 63.43494882292201 > > but when i lookup tg in a paper table (last decade math book) i've got these > values: > > tg(63'10'') = 1.9768 > tg(63'20'') = 1.9912 > tg(63'30'') =

Re: Python presentations

2012-09-14 Thread Chris Angelico
On Fri, Sep 14, 2012 at 9:47 PM, Alexander Blinne wrote: > On 14.09.2012 00:38, Chris Angelico wrote: >> On Fri, Sep 14, 2012 at 8:33 AM, Alexander Blinne wrote: >>> def powerlist(x,n): >>> if n==1: >>> return [1] >>> p = powerlist

Re: What's wrong with my arc tangens calculation?

2012-09-14 Thread Chris Angelico
On Fri, Sep 14, 2012 at 11:13 PM, Mark Lawrence wrote: > Somebody or something has a length, height or width of 63 feet 30 inches? :) Sounds like the height of a building with a barometer. The thirty inches, of course, being the height of the barometer. ChrisA (big, big barometer) -- http://mai

Re: Decorators not worth the effort

2012-09-14 Thread Chris Angelico
On Sat, Sep 15, 2012 at 12:12 AM, andrea crotti wrote: > def fib(n): > if n <= 1: > return 1 > return fib(n-1) + fib(n-2) > > @memoize > def fib_memoized(n): > if n <= 1: > return 1 > return fib_memoized(n-1) + fib_memoized(n-2) > > > The second fibonacci looks exac

Re: AttributeError: 'list' object has no attribute 'lower'

2012-09-14 Thread Chris Angelico
On Sat, Sep 15, 2012 at 1:01 AM, Token Type wrote: > Thanks. By the way, do we have a list of explanations of error message? If > so, whenever we come across error message, we can refer to it and solve the > problem accordingly. Not really, but if you paste the message into Google or DuckDuckGo

Re: Decorators not worth the effort

2012-09-14 Thread Chris Angelico
On Sat, Sep 15, 2012 at 2:15 AM, andrea crotti wrote: > The poor algorithm is much more close to the mathematical definition > than the smarter iterative one.. And in your second version you > include some ugly caching logic inside it, so why not using a > decorator then? I learned Fibonacci as

Re: pythonOCC examples doesn't work?

2012-09-14 Thread Chris Angelico
On Sat, Sep 15, 2012 at 1:47 PM, Dwight Hutto wrote: > That's no problem, But some suported ad some opposed, it's a > democracy, but a dictatorship by the moderators. How much did I err in > their opinion of stating my opinion, in relation to the statistical > whole? Actually, I've not seen any m

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Chris Angelico
On Sat, Sep 15, 2012 at 10:22 PM, Νικόλαος Κούρας wrote: > Hello, > > I recently changed webhost and in the new one iam getting this error you can > see if you visit http://superhost.gr when program execution reaches the line: > >f = open( '../' + page ) > > In the previous host i wasn't gett

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Chris Angelico
On Sat, Sep 15, 2012 at 11:28 PM, Νικόλαος Κούρας wrote: > Iam not using frameworks just plain python code written in Notepad++ > > Can you please tell me how to switch this line in order for this line to work? f = open( '../' + page[0]) will possibly work. But do try to understand what's happen

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Chris Angelico
On Sun, Sep 16, 2012 at 12:44 AM, Νικόλαος Κούρας wrote: > Τη Σάββατο, 15 Σεπτεμβρίου 2012 5:21:22 μ.μ. UTC+3, ο χρήστης Roy Smith > έγραψε: >> Do you realize that the hosting service you're using (HostGator) is so >> mis-configured that it is exposing your source code and credentials to >> the e

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Chris Angelico
On Sun, Sep 16, 2012 at 12:51 AM, Νικόλαος Κούρας wrote: > in my case an .htaccess file gives redirects all html requests to > /cgi-bin/counter.py by also provide as an argument to the counter.py script > the initical html file request > > RewriteEngine On > RewriteCond %{REQUEST_FILENAME} -f >

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Chris Angelico
On Sun, Sep 16, 2012 at 1:06 AM, Νικόλαος Κούρας wrote: > Previous webhost has the same flaw as well, look: > > http://www.errorweb.gr/~nikos/cgi-bin/ > > giving away all my scripts. > > Webhost misconfiguration in both hosts! And when I look at the scripts, I see things that do not fill me with

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Chris Angelico
On Sun, Sep 16, 2012 at 1:23 AM, Νικόλαος Κούρας wrote: > I swicthed back my code to: f = open( '../' + page ) > > and http://superhost.gr works which means that line gets parsed correctly. > > Only when i post data to the text area boxes iam getting the error: > > cannot concatenate 'str' and 'l

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Chris Angelico
On Sun, Sep 16, 2012 at 1:33 AM, Νικόλαος Κούρας wrote: > You are right but iam a new python learner and i created this logging system > script as a poject to better learn the lalguage itself. > > I can always use google analytics for serious visitor logging. > > Apart from that i enjoy reading

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Chris Angelico
On Sun, Sep 16, 2012 at 2:04 AM, Νικόλαος Κούρας wrote: > I'am not sure what to do and i didnt quite understand what the problem is. > > Can you please tell me what parts need fixe so for the users to be able to > leave remakrs in he text area boxes? Your question demonstrates a more fundamental

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Chris Angelico
On Sun, Sep 16, 2012 at 2:53 AM, Νικόλαος Κούρας wrote: > The 'page' form field is of couse neccessary because how else the python > counter.py script would know which html file triggered it so to present it > and do its log thing?(i intend to create a few html files) > > I still do not see why

Re: Some Silly Questions

2012-09-15 Thread Chris Angelico
On Sun, Sep 16, 2012 at 3:18 AM, Subhabrata wrote: > Dear Group, > > I am going to ask two very silly questions, if any one can kindly tell me why > this structure is taken? > > classifier.pseudocode(depth=4) > > from nltk.corpus import brown Not sure what your question means. The first one is a

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Chris Angelico
On Sun, Sep 16, 2012 at 3:26 AM, Νικόλαος Κούρας wrote: > aahhh! alo it needed change to > > page = form.getvalue('htmlpage') > > now its working! at last! > > but can you please tell me what was wrong? > > Tha names of the variables was the same both in counter.py and the .htaccess > > But why wa

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Chris Angelico
On Sun, Sep 16, 2012 at 3:59 AM, Νικόλαος Κούρας wrote: > What hidden form value? > > you mean page variable does not needed? please clarify. > > Also i dont know what to do if someone enters a false entry as content for > htmlpage. You have this: What is that for? Is it needed? ChrisA -- ht

Re: cannot concatenate 'str' and 'list' objects

2012-09-15 Thread Chris Angelico
On Sun, Sep 16, 2012 at 4:10 AM, Νικόλαος Κούρας wrote: > ah yes in the index.html page yes...yes i totally forgot about that, that > bwas before creating the python counter logging when i was thinking other > ways of solving this matter. So it's like I was saying, redundant. :) > What about t

Re: datetime issue

2012-09-16 Thread Chris Angelico
On Sun, Sep 16, 2012 at 11:22 PM, Roy Smith wrote: > In article <4f9d9a0b-539a-4b6a-af3e-b02d1f400...@googlegroups.com>, > Νικόλαος Κούρας wrote: >> Iam sorry i didnt do that on purpose and i dont know how this is done. >> >> Iam positng via google groups using chrome, thats all i know. >> >> Wh

Re: datetime issue

2012-09-16 Thread Chris Angelico
On Mon, Sep 17, 2012 at 12:06 AM, Roy Smith wrote: > In article , > Chris Angelico wrote: > >> > Is it September already? >> >> Yes, it is; what does that mean in response to this question? Is there >> something about September that causes the question, or i

Re: newbie question : gedit as an ide

2012-09-16 Thread Chris Angelico
On Sun, Sep 16, 2012 at 9:52 PM, Mayuresh Kathe wrote: > new to the group, a quick hello to all. :-) > does anyone use gedit as an 'ide' for python development? > if yes, may i know the caveats against using 'idle', 'bpython', etc? > > thank you. I never really liked gedit; when I first switched

Re: newbie question About O'Reilly "Python for Unix and Linux System Administration" ftp Mirror question

2012-09-16 Thread Chris Angelico
ok at the docs suggests that one solution is to add a default value to the options: http://docs.python.org/library/optparse.html#default-values Alternatively, treat the options as mandatory, and provide them on the command line. Side point: When you go to the docs page there, you may noti

Re: datetime issue

2012-09-16 Thread Chris Angelico
On Mon, Sep 17, 2012 at 1:40 AM, wrote: > Cant it be written more easily as: > date = (datetime.datetime.utcnow(+2) > > i know this is not thhe correct syntax but it just needs a way to add GMT+2 > hours since utc=gmt I've dithered about whether to open this can of worms or let sleeping dogs l

Re: Obnoxious postings from Google Groups (was: datetime issue)

2012-09-16 Thread Chris Angelico
On Mon, Sep 17, 2012 at 1:44 AM, wrote: > Whaen i tried to post just now by hitting sumbit, google groups told me that > the following addresssed has benn found in this thread! i guess is used them > all to notify everything! > > cdf072b2-7359-4417-b1e4-d984e4317...@googlegroups.com > mailman.7

Re: Python presentations

2012-09-16 Thread Chris Angelico
On Mon, Sep 17, 2012 at 2:13 AM, Alexander Blinne wrote: > def powerlist3(x,n): > return [x**i for i in xrange(n)] > > for really big n powerlist3 always takes very much time :) I would reiterate that a really big n is a really unusual use case for a function like this, except that... I frankly

Re: Comparing strings from the back?

2012-09-16 Thread Chris Angelico
On Mon, Sep 17, 2012 at 11:11 AM, alex23 wrote: > On Sep 15, 1:10 pm, Dwight Hutto wrote: >> On Fri, Sep 14, 2012 at 6:43 PM, Prasad, Ramit >> > Since I was unsure myself if you were trying to be offensive or racist, >> > I would disagree with "everyone can know it wasn't meant as racist". >> >>

Re: gc.get_objects()

2012-09-17 Thread Chris Angelico
On Tue, Sep 18, 2012 at 12:16 AM, Steven D'Aprano wrote: > The __del__ method does not delete an object. Remember, objects are only > deleted when there are no references to it. Otherwise you could have some > code that tries to use a deleted object, and you would get a system crash > or BSOD. Th

Re: how to use property?

2012-09-17 Thread Chris Angelico
On Tue, Sep 18, 2012 at 7:55 AM, Fernando Jiménez wrote: > Hi guys! > > I'm noob in python and I would know how to correctly use the property. I > have read some things about it but I do not quite understand. > > But I think it's a bad habit to use _ to change the visibility of the > attributes as

Re: Decorators not worth the effort

2012-09-18 Thread Chris Angelico
On Tue, Sep 18, 2012 at 11:19 PM, Neil Cerutti wrote: > On 2012-09-14, Chris Angelico wrote: >> But then again, who actually ever needs fibonacci numbers? > > If it should happen that your question is not facetious: > > http://en.wikipedia.org/wiki/Fibonacci_number#Ap

Re: Comparing strings from the back?

2012-09-18 Thread Chris Angelico
On Wed, Sep 19, 2012 at 2:17 AM, Dwight Hutto wrote: >> >> You're right, my apologies. Dwight Hutto is the one I plonked. > You can call me David. I go by my middle name. You're most often going to be addressed by the name that's given in your post headers. In this case "David" has been reduced

Re: using text file to get ip address from hostname

2012-09-19 Thread Chris Angelico
On Wed, Sep 19, 2012 at 5:41 PM, Dan Katorza wrote: > > Hello again, > I have another question and i hope you will understand me.. > Is there any option where you can set the program to go back to lets say the > top of the code? > I mean if the program finished the operation and i want to stay in

Re: using text file to get ip address from hostname

2012-09-19 Thread Chris Angelico
On Wed, Sep 19, 2012 at 6:50 PM, Dan Katorza wrote: > i know about the while loop , but forgive me i just don't have a clue how to > use it for this situation. You've already used one. What you need to do is surround your entire code with the loop, so that as soon as it gets to the bottom, it go

Re: How to get the list of all my open file(descriptor)s and locks?

2012-09-19 Thread Chris Angelico
On Thu, Sep 20, 2012 at 7:09 AM, Ian Kelly wrote: > You could do: > > os.listdir("/proc/%d/fd" % os.getpid()) > > This should work on Linux, AIX, and Solaris, but obviously not on Windows. I'm not sure how cross-platform it is, but at least on Linux, you can use /proc/self as an alias for "/proc/

Re: Passing arguments to & executing, a python script on a remote machine from a python script on local machine

2012-09-19 Thread Chris Angelico
On Thu, Sep 20, 2012 at 2:27 PM, Steven D'Aprano wrote: > On Wed, 19 Sep 2012 12:46:33 -0700, ashish wrote: > >> 2. I have a python script, local.py, running on local which needs to >> pass arguments ( 3/4 string arguments, containing whitespaces like >> spaces, etc ) to a python script, remote.py

Re: portable way of locating an executable (like which)

2012-09-20 Thread Chris Angelico
On Fri, Sep 21, 2012 at 7:47 AM, Mark Lawrence wrote: > On 20/09/2012 22:06, Gelonida N wrote: >> >> I'd like to implement the equivalent functionality of the unix command >> /usr/bin/which >> >> The function should work under Linux and under windows. >> >> Did anybody already implement such a fun

Re: portable way of locating an executable (like which)

2012-09-20 Thread Chris Angelico
On Fri, Sep 21, 2012 at 8:32 AM, Ian Kelly wrote: > On Thu, Sep 20, 2012 at 4:21 PM, Chris Angelico wrote: >> os.sep is the directory separator, but os.pathsep may be what you >> want. Between that and os.getenv('path') you can at least get the >> directories. Th

Re: python idioms : some are confusing

2012-09-20 Thread Chris Angelico
I'm responding to the OP here, not to Alex, but I'm quoting his text to expand on it. :) On Fri, Sep 21, 2012 at 3:52 PM, alex23 wrote: > On Sep 21, 3:34 pm, Vineet wrote: >> Amongst the python idioms, how the below-mentioned make sense? >> ## There should be one-- and preferably only one --obvi

Re: Functional way to compare things inside a list

2012-09-21 Thread Chris Angelico
On Fri, Sep 21, 2012 at 8:58 AM, wrote: > Hi, > > list = [{'1': []}, {'2': []}, {'3': ['4', '5']}] > > I want to check for a value (e.g. '4'), and get the key of the dictionary > that contains that value. > (Yep, this is bizarre.) > > some_magic(list, '4') > => '3' > > What's the functional way t

Re: Functional way to compare things inside a list

2012-09-21 Thread Chris Angelico
On Fri, Sep 21, 2012 at 6:28 PM, Chris Rebert wrote: > On Fri, Sep 21, 2012 at 1:23 AM, Chris Angelico wrote: >> On Fri, Sep 21, 2012 at 8:58 AM, wrote: > >> That gets the result, but probably not in the cleanest way. I'm not >> sure off-hand if Python has a conve

Re: Blue Screen Python

2012-09-21 Thread Chris Angelico
On Sat, Sep 22, 2012 at 12:04 AM, mikcec82 wrote: > Hallo to all, > > I'm using Python 2.7.3 with Windows 7 @ 64 bit > and an Intel Core i3 -2350M CPU @2.30GHz 2.3GHz. > > Sometimes, when I'm programming in Python on my screen compare this blue > screen: > http://imageshack.us/a/img228/8352/48579

Re: how to do draw pattern with python?

2012-09-21 Thread Chris Angelico
On Sat, Sep 22, 2012 at 2:50 AM, Ismael Farfán wrote: > 2012/9/21 Peter Otten <__pete...@web.de>: >> echo.hp...@gmail.com wrote: >> >> print "\x1b[2J\x1b[0;0H" # optional > > Nice code : ) > > Could you dissect that weird string for us? > > It isn't returning the cursor to (0,0), it's just lik

Re: how to do draw pattern with python?

2012-09-21 Thread Chris Angelico
On Sat, Sep 22, 2012 at 3:31 AM, Chris Angelico wrote: > It's an ANSI escape sequence, or rather two of them. The first one > clears the screen, the second returns you to 0,0. (Isn't that implicit > in the 2J code? Maybe I'm misremembering.) Ah. From Wikipedia: "If

Re: Does python have built command for package skeleton creation?

2012-09-21 Thread Chris Angelico
On Sat, Sep 22, 2012 at 1:54 AM, Steven D'Aprano wrote: > But consider, C and C++ don't have minor releases *at all*. The last > versions of those two languages are C99 and C+98 -- that's FOURTEEN YEARS > since the last version of C++. And Java hasn't had a major feature update > since 2006. > > F

Re: One of my joomla webpages has been hacked. Please help.

2012-09-21 Thread Chris Angelico
On Sat, Sep 22, 2012 at 4:45 AM, Νίκος Γκρεεκ wrote: > One webpage of mine, http://www.varsa.gr/ has been *hacked* 15 mins ago. > > I know this is not a python question but you guyshave high knowledge of web > sites programming and i though you wouldnt mind helping me out. No, this is not a Pyth

Re: One of my joomla webpages has been hacked. Please help.

2012-09-21 Thread Chris Angelico
On Sat, Sep 22, 2012 at 11:42 AM, Steven D'Aprano wrote: > But you asked anyway. Why don't you ask your car mechanic to fix your > plumbing, or go to the doctor to ask advice on how to cook pizza? Or your plumber to rescue the princess who's in another castle... ChrisA -- http://mail.python.org

Re: Does python have built command for package skeleton creation?

2012-09-21 Thread Chris Angelico
On Sat, Sep 22, 2012 at 11:43 AM, Steven D'Aprano wrote: > On Sat, 22 Sep 2012 03:44:55 +1000, Chris Angelico wrote: > >> On Sat, Sep 22, 2012 at 1:54 AM, Steven D'Aprano >> wrote: >>> For a programming language with a lot of corporate use, Python already >

Re: technologies synergistic with Python

2012-09-21 Thread Chris Angelico
On Sat, Sep 22, 2012 at 11:48 AM, Steven D'Aprano wrote: > Integration with Java frameworks and applications? > > Java :-P I asked you not to tell me that! JavaScript/ECMAScript/etc-script isn't that bad a language. It's workable. And thanks to it, my boss now understands pass-by-object semantic

Re: how to do draw pattern with python?

2012-09-21 Thread Chris Angelico
On Sat, Sep 22, 2012 at 5:55 AM, Mark Lawrence wrote: > I tried running your code but got this:- > > c:\Users\Mark>pattern.py > File "C:\Users\Mark\pattern.py", line 22 > > Doing your homework since 2001 > ^ > SyntaxError: invalid syntax > > What am I doing wrong? The problem i

Re: One of my joomla webpages has been hacked. Please help.

2012-09-22 Thread Chris Angelico
On Sat, Sep 22, 2012 at 5:13 PM, Νίκος Γκρεεκ wrote: > The web host company pulled a previous backup and now its all good. > > My apologies for the annoyance i have coused you all i wanted was some > insight so to make sure this wont happen again( it already happened 2 times > by now). Just rea

Re: Blue Screen Python

2012-09-22 Thread Chris Angelico
On Sat, Sep 22, 2012 at 11:07 PM, Steven D'Aprano wrote: > As per their partnership agreement, IBM took over development of OS/2 > version 2 while Microsoft worked on developing version 3. OS/2 2.0 was > significantly improved over the 1.x series. > > Then Microsoft reneged on the agreement to rel

Re: One of my joomla webpages has been hacked. Please help.

2012-09-22 Thread Chris Angelico
On Sun, Sep 23, 2012 at 12:44 AM, Νίκος Γκρεεκ wrote: > But how am i supposed to fix this vulnerability if i don't know which one is > it? > > My guess is they used joomlas template to insert arbitrary code but thats > just a guess. The answer to that is a thing called "research", and you'll us

Re: One of my joomla webpages has been hacked. Please help.

2012-09-22 Thread Chris Angelico
On Sun, Sep 23, 2012 at 4:13 AM, Νίκος Γκρεεκ wrote: > Is there a way to somehow embed(or utilize) python code, for example my > python counter code script you have seen last week inside my Joomla/WordPress > cms sites? You probably could. But I reiterate, you're going about things all backward

Re: One of my joomla webpages has been hacked. Please help.

2012-09-22 Thread Chris Angelico
On Sun, Sep 23, 2012 at 12:52 PM, Νίκος Γκρεεκ wrote: > Τη Σάββατο, 22 Σεπτεμβρίου 2012 9:18:02 μ.μ. UTC+3, ο χρήστης Chris Angelico > έγραψε: >> On Sun, Sep 23, 2012 at 4:13 AM, Νίκος Γκρεεκ wrote: >> >> > Is there a way to somehow embed(or utilize) python code,

Re: One of my joomla webpages has been hacked. Please help.

2012-09-22 Thread Chris Angelico
On Sun, Sep 23, 2012 at 2:48 PM, Dwight Hutto wrote: > On Sun, Sep 23, 2012 at 12:06 AM, Steven D'Aprano > wrote: >> On Sat, 22 Sep 2012 19:52:00 -0700, Νίκος Γκρεεκ wrote: >> >>> Out of curiocity how would i used my python counter source code along >>> with Joomla? >> >> >> This is not a Joomla

Re: One of my joomla webpages has been hacked. Please help.

2012-09-22 Thread Chris Angelico
On Sun, Sep 23, 2012 at 3:18 PM, Dwight Hutto wrote: > On Sun, Sep 23, 2012 at 12:56 AM, Chris Angelico wrote: >> Steven's point is not that we, human beings (or parahuman beings, as >> the case may be), do not know how to run code in Joomla; I've worked >> with

Re: cant install livewires

2012-09-23 Thread Chris Angelico
On Sun, Sep 23, 2012 at 10:05 PM, wrote: > i cant install livewires and their help about making a directory is useless > to me as i dont know how > btw im using windows 7 > REALLY DESPERATE :) May I recommend searching the web for 'make directory windows 7'? That might help. ChrisA -- http://

Re: Capitalization for variable that holds a class

2012-09-23 Thread Chris Angelico
On Mon, Sep 24, 2012 at 1:48 AM, Joshua Landau wrote: > Simple question: > > [myClass() for myClass in myClasses] > vs > [MyClass() for MyClass in myClasses] > > Fight. > > (When considering, substitute in a more real-world example like [Token() for > Token in allTokens] or [token() for token in a

Re: For Counter Variable

2012-09-23 Thread Chris Angelico
On Mon, Sep 24, 2012 at 2:36 AM, jimbo1qaz wrote: > Am I missing something obvious, or do I have to manually put in a counter in > the for loops? That's a very basic request, but I couldn't find anything in > the documentation. You mean, if you want the indices as well as the values? Try the en

Re: List Problem

2012-09-23 Thread Chris Angelico
On Mon, Sep 24, 2012 at 7:44 AM, jimbo1qaz wrote: > On Sunday, September 23, 2012 2:31:48 PM UTC-7, jimbo1qaz wrote: >> I have a nested list. Whenever I make a copy of the list, changes in one >> affect the other, even when I use list(orig) or even copy the sublists one >> by one. I have to manu

Re: List Problem

2012-09-23 Thread Chris Angelico
On Mon, Sep 24, 2012 at 10:56 AM, Littlefield, Tyler wrote: > I've not been following this thread fully, but why not just use x=list(y) to > copy the list? > The issue is that when you assign i=[1,2,3] and then j = i, j is just a > reference to i, which is why you change either and the other chang

Re: Seome kind of unblocking input

2012-09-23 Thread Chris Angelico
On Mon, Sep 24, 2012 at 3:50 AM, Dennis Lee Bieber wrote: > On Sun, 23 Sep 2012 18:13:57 +0100, Mark Lawrence > declaimed the following in > gmane.comp.python.general: > >> On 23/09/2012 16:49, Ramchandra Apte wrote: > >> > You can clear the buffer by calling file.flush() >> > >> >> Shock, horror

Re: python file API

2012-09-24 Thread Chris Angelico
On Tue, Sep 25, 2012 at 7:49 AM, Dave Angel wrote: > On 09/24/2012 05:35 PM, zipher wrote: >> Let file-type have an attribute .pos for position. Now you can get rid of >> the seek() and tell() methods and manipulate the file pointer more easily >> with standard arithmetic operations. >> >

Re: keeping information about players around

2012-09-24 Thread Chris Angelico
On Tue, Sep 25, 2012 at 7:14 AM, Dwight Hutto wrote: > Also, If this is a browser app I'd go with phpmyadmin, and MySQL > > If a tkinter/wxpython/etc app, then maybe sqlite. Out of curiosity, why? MySQL isn't magically better for everything where data ends up displayed in a web browser. Unless yo

Re: keeping information about players around

2012-09-24 Thread Chris Angelico
On Tue, Sep 25, 2012 at 8:31 AM, Dwight Hutto wrote: > And in the end it's usually html, php, css, javascript in the browser, > atleast for me it is. I'm just starting to utilize python in that > area, so excuse the naivety. In the browser it's HTML, CSS, JavaScript (ECMAScript, etc, etc); PHP is

Re: python file API

2012-09-24 Thread Chris Angelico
On Tue, Sep 25, 2012 at 8:37 AM, Ian Kelly wrote: > On Mon, Sep 24, 2012 at 4:14 PM, Chris Angelico wrote: >> file.pos = 42 # Okay, you're at position 42 >> file.pos -= 10 # That should put you at position 32 >> foo = file.pos # Presumably foo is the integer 32 >&g

Re: For Counter Variable

2012-09-25 Thread Chris Angelico
On Tue, Sep 25, 2012 at 11:32 AM, Dwight Hutto wrote: >> By now I think we're in the DNFTT zone. >> -- > Taking a bite yourself there buddy. Hop under the bridge, and > comment...it make you a troll, and you're trying to feed yourself with > pile on comment from the rest of the under bridge dwelle

Re: For Counter Variable

2012-09-25 Thread Chris Angelico
On Wed, Sep 26, 2012 at 12:19 AM, Steven D'Aprano wrote: > On Tue, 25 Sep 2012 11:16:40 +0100, Mark Lawrence wrote: > >> On 25/09/2012 10:53, Chris Rebert wrote: >> >> [snip] >> >>> Well, the PSU might, except they emphatically do not exist... >> >> I know that they exist > > You are delusional. T

Re: new-style class or old-style class?

2012-09-25 Thread Chris Angelico
On Wed, Sep 26, 2012 at 12:44 AM, Jayden wrote: > In learning Python, I found there are two types of classes? Which one are > widely used in new Python code? Is the new-style much better than old-style? > Thanks!! Definitely go with new-style. In Python 3, old-style classes aren't supported, an

Re: data attributes override method attributes?

2012-09-25 Thread Chris Angelico
On Wed, Sep 26, 2012 at 12:54 AM, Peter Otten <__pete...@web.de> wrote: > To me > > "Data attributes override method attributes with the same name" > > implies that data attributes take precedence over method attributes, not > that they replace them only when there is an assignment of data after th

Re: python file API

2012-09-25 Thread Chris Angelico
On Wed, Sep 26, 2012 at 2:07 AM, Dennis Lee Bieber wrote: > f.pos += delta > > would be a "seek.set" and with a naive driver might trigger a rewind to > the start of the tape followed by a seek to the absolute position, > whereas the seek from current location would only move the tape by t

Re: Article on the future of Python

2012-09-25 Thread Chris Angelico
On Wed, Sep 26, 2012 at 10:54 AM, Steven D'Aprano wrote: > SQL? ... it's time to sell your shares in Oracle. Ehh, I wouldn't be investing in Oracle, but that's more because I think free RDBMSes like PostgreSQL outshine it. And this is even more true of MS SQL Server - this last week I've been res

Re: Article on the future of Python

2012-09-25 Thread Chris Angelico
On Wed, Sep 26, 2012 at 3:16 PM, Steven D'Aprano wrote: > On Wed, 26 Sep 2012 14:10:28 +1000, Chris Angelico wrote: > >> The flip side to node.js is pyjs. > > After the ham-fisted, nasty way pyjamas project was hijacked this year, > I'm not entirely sure I'

Re: Article on the future of Python

2012-09-26 Thread Chris Angelico
On Wed, Sep 26, 2012 at 5:39 PM, Dwight Hutto wrote: > On Wed, Sep 26, 2012 at 3:17 AM, Ethan Furman wrote: >> wxjmfa...@gmail.com wrote: >>> >>> Py 3.3 succeeded to somehow kill unicode and it has >>> been transformed into an "American" product for >>> "American" users. >> > Well, we can all use

Re: regular expression : the dollar sign ($) work with re.match() or re.search()

2012-09-26 Thread Chris Angelico
On Wed, Sep 26, 2012 at 5:48 PM, Jussi Piitulainen wrote: > What was the weird character that you used as a question mark? I > removed them because they confuse the newsreader I use. It appears to be Unicode Character 'FULLWIDTH QUESTION MARK' (U+FF1F). Normally I'd be inclined to simply use U+00

Re: Article on the future of Python

2012-09-26 Thread Chris Angelico
On Wed, Sep 26, 2012 at 6:34 PM, Mark Lawrence wrote: > Further for somebody who is apparently up in the high tech world, why are > you using a gmail account and hence sending garbage in more ways than one to > mailing lists like this? I use gmail too, largely because I prefer to keep mailing lis

Re: Article on the future of Python

2012-09-26 Thread Chris Angelico
On Wed, Sep 26, 2012 at 7:31 PM, wrote: > you are correct. But the price you pay for this is extremely > high. Now, practically all characters are affected, espacially > those *in* the Basic *** Multilingual*** Plane, these characters > used by non "American" user (No offense here, I just use thi

Re: Looking for pointers/suggestion - how to make a webbrowser with these restriction?

2012-09-26 Thread Chris Angelico
On Wed, Sep 26, 2012 at 6:23 PM, Anthony Kong wrote: > Hi, all, > > It is kind of a MacGyver question. I am just looking for some general > suggestions/pointer. > > First let me first describe the development environment I am in: it is a > locked down WinXP PC with limited development tools and

Re: Article on the future of Python

2012-09-26 Thread Chris Angelico
On Wed, Sep 26, 2012 at 10:19 PM, wrote: > You are always selling the same argument. > Py3.3 is the only computer language I'm aware of which > is maltreating Unicode in such a way. You mean, the only computer language that represents Unicode characters as integers, and then stores them as an ar

Re: Article on the future of Python

2012-09-26 Thread Chris Angelico
On Wed, Sep 26, 2012 at 11:43 PM, Mark Lawrence wrote: > On 26/09/2012 14:31, Littlefield, Tyler wrote: > >> >> PS: Anyone know if rantingrik had relatives? ;) >> > > I say steady on old chap that's just not cricket. I've been known to have a > go at rr in the past for good reasons, but when he g

Re: Looking for pointers/suggestion - how to make a webbrowser with these restriction?

2012-09-26 Thread Chris Angelico
On Wed, Sep 26, 2012 at 8:41 PM, Anthony Kong wrote: > Hi, Chris, > > Thanks for your reply. I really do not have any requirement. It is more a > curiosity question (not work related). I'd like to find out how python can be > used to 'glue' all these moving parts together. Performance and securi

Re: Article on the future of Python

2012-09-26 Thread Chris Angelico
On Thu, Sep 27, 2012 at 12:19 AM, wrote: > No, I'm comparing Py33 with Py32 narrow build [*]. Then look at the broken behaviour that Python, up until now, shared with Javascript and various other languages, in which a one-character string appears as two characters, and slicing and splicing strin

Re: Article on the future of Python

2012-09-26 Thread Chris Angelico
On Thu, Sep 27, 2012 at 12:50 AM, wrote: > I just see the results and the facts. For an end > user, this is the only thing that counts. Then what counts is that Python 3.2 (like Javascript) exhibits incorrect behaviour, and Python (like Pike) performs correctly. I think this tee applies to you.

<    6   7   8   9   10   11   12   13   14   15   >