A question about import

2024-02-16 Thread Gabor Urban via Python-list
Hi guys, I need something about modules to be clarified. Suppose I have written a module eg: ModuleA which imports an other module, let us say the datetime. If I import ModuleA in a script, will be datetime imported automatically? Thanks in advance, -- Urbán Gábor Linux is like a wigwam: no G

Testing list sequence question -- thanks for the info

2023-03-05 Thread Gabor Urban
Hi guys, Thank you very much for the accurate answer. Upgrading our Python to 3.7 seems to be out of question at the moment. I will check the requirement specification if the order of the keys is important at all. It could be a wish only. -- Urbán Gábor Linux is like a wigwam: no Gates, no Win

Testing list sequence question

2023-03-04 Thread Gabor Urban
to verify the sequence. Sometimes this test fails, sometimes passes without any change neither in the code, nor in the testcase. I am using "list(myDict.keys())" to create the list of the keys of the dictionary. I am running Python 3.3 on MS Windows. Any idea why is this? Thx, Gabor

A problem with opening a file -- again

2020-11-29 Thread Gabor Urban
Hi guys, I tried to solve the problem once again. I have inserted some print statements the check the variables. The actual code (naplo.py) is copy-pasted here: class Naplo: def __init__(self, pNeve, pMeret, pMode = 'a'): self.logNev = pNeve self.meret = pMeret

A problem with opening a file

2020-11-28 Thread Gabor Urban
Hi, I am facing an issue I was not able to solve yet. I have a class saving messages to a file. The relevant code is: import OS import sys class MxClass: def __init__(self, fName, fMode,): self.fileName = fName self.fileMode = fMode def writeMetho

Re: Module import question

2020-08-09 Thread Gabor Urban
Hi guys, Thanks for the answers. IT is clear Noé. Gábor -- https://mail.python.org/mailman/listinfo/python-list

Module import question

2020-08-08 Thread Gabor Urban
Hi guys, I have a quite simple question but I could not find the correct answer. I have twoo modules A and B. A imports B. If I import A in a script, Will be B imported automatically? I guess not, but fő not know exactly. Thanks for your answer ín advance, Gábor -- https://mail.python.org/mail

Teaching Python

2014-09-29 Thread Gabor Urban
Hi, my 11 years old son and his classmate told me, that they would like to learn Python. They did some programming in Logo and turtle graphics, bat not too much. Doesn anybody has an idea how to start? -- Urbán Gábor Linux is like a wigwam: no Gates, no Windows and an Apache inside. -- https:

Python 2.3 and ODBC

2014-04-08 Thread Gabor Urban
Hi guys, I am using Python 2.3 on an XP box at my company. (I know it is quite outdated, but we could not make the management to upgrade.) I have started a pilot project the last week to show the possibility of processing incoming XML files and extracting data into Oracle tables. Now I am almost

Repository of non-standard modules.

2013-07-31 Thread Gabor Urban
seems to be far from complete. Thanks in advance, Gabor Urban -- Urbán Gábor Linux is like a wigwam: no Gates, no Windows and an Apache inside. -- http://mail.python.org/mailman/listinfo/python-list

Missing logging output in Python

2013-03-08 Thread gabor . a . halasz
Hi, I would like to enable loggin in my script using the logging module that comes with Python 2.7.3. I have the following few lines setting up logging in my script, but for whatever reason I don't seem to get any output to stdout or to a file provided to the basicConfig method. Any ideas?

Set initial size in TKinter

2011-12-20 Thread Gabor Urban
self.pack() self.createWidgets() self.db = 0 app = Application() app.master.title('UG test') app.mainloop() Thx in advance... Gabor -- Linux is like a wigwam: no Gates, no Windows and an Apache inside. -- http://mail.python.org/mailman/listinfo/python-list

Class attributes / methods..... full Python script

2010-03-01 Thread Gabor Urban
Hi guys, thanks for the ideas. Here you are the code. Not transcoded from Java for I do not know Java enough.. I am scanning an XML file, and have a large ammount of logging. Any ideas are wellcome as before Thnx Code:> #- ## Generate CSV from O

Class attributes / methods lost?

2010-03-01 Thread Gabor Urban
dex].owner,packages[index].schema) AttributeError: class Package has no attribute 'serial' The strange in this issue for me, that I do not see why are the class methods and fields lost. Any idea is wellcome. Gabor -- Linux: Choice of a GNU Generation -- http://mail.python.org/mailman/listinfo/python-list

Two questions ( Oracle and modules )

2009-12-07 Thread Gabor Urban
on is performed only once. How can we implement this? I do not know what to google for..... Gabor -- Linux: Choice of a GNU Generation -- http://mail.python.org/mailman/listinfo/python-list

More Python versions on an XP machine

2009-11-14 Thread Gabor Urban
Hi guys, this a very MS specific question. I do use a rather old Python version, because we have a couple of applications written for that. Porting them to a newer Python is not allowed by the bosses. Now we will start a new project with latest stable Python. Can I have them both on my computer, a

Re: Question on PEP 337 (Vinay Sajip)

2009-10-28 Thread Gabor Urban
Hy guys, Sorry, Vinay Sajip was right. I wrote my questions about PEP 391. I would like to know your ideas about my questions posted in my last mail. Gabor -- Linux: Choice of a GNU Generation -- http://mail.python.org/mailman/listinfo/python-list

Question on PEP 337

2009-10-28 Thread Gabor Urban
? -- How can the logging module guarantee that there will be no data loss during the reconfiguration process? Regards, Gabor -- Linux: Choice of a GNU Generation -- http://mail.python.org/mailman/listinfo/python-list

Re: best vi / emacs python features

2009-10-12 Thread Gabor Urban
Hey guys, this is supposed to be a Python mailing list... Both editors are great and are with great potentials. I do use both of them daily, though for different purposes. It is meaningless to start this old issue of preferences anew. -- Linux: Choice of a GNU Generation -- http://mail.python.

Logging question

2009-09-22 Thread Gabor Urban
created properly but contains no lines at all. If I put the code directly in __main__, it works fine. What did I miss? Any ideas are wellcome. Gabor -- Linux: Choice of a GNU Generation -- http://mail.python.org/mailman/listinfo/python-list

Re: What text editor is everyone using for Python

2009-05-28 Thread Gabor Urban
conceot of wrtitten User Manual or Reference. All we have learned Python from tutorials and not from the menues. As a summary, any open source editor should be perfect, which is extensible, optionally language-sensitive, portable, basically independent of any OS features. THat cuts the list dramm

Re: What text editor is everyone using for Python

2009-05-28 Thread Gabor Urban
I use Emacs, as for the other editing activities. I like it for it is very powerfull. -- Linux: Choice of a GNU Generation -- http://mail.python.org/mailman/listinfo/python-list

Re: Seeking old post on developers who like IDEs vs developers who like simple languages

2009-05-18 Thread Gabor Urban
Java, C++, and any other languages. For myself I can say, I am a seasoned Emacs user, and would not switch to any fancy IDE. BUT that is personal view. IMHO this question does not bellong here, though I was very pleased to read arguments instead of flames :-)) Gabor -- Linux: Choice of a GNU

Re: New to python, can i ask for a little help? (Andrew Chung)

2009-05-15 Thread Gabor Urban
I gues, it was rather simple... Begin with simple tasks, figure out how to do them. If you are proceding well, then increase difficulty/complexity. Gabor -- Linux: Choice of a GNU Generation -- http://mail.python.org/mailman/listinfo/python-list

Porting to new Python version

2009-02-19 Thread Gabor Urban
n pro and contra. I would like to get the background as precisely as possible. Thanks in advance and good day to You! Gabor -- http://mail.python.org/mailman/listinfo/python-list

Re: Volume id

2007-11-15 Thread Gabor Urban
OK, you are right... Problem was not precise enough. I need to process CDs to create a list. Does it ring a bell for you? Thanks 2007/11/15, Laszlo Nagy <[EMAIL PROTECTED]>: > > Gabor Urban wrote: > > Hi, > > > > I have a problem, which may be trivial, but I could

Volume id

2007-11-15 Thread Gabor Urban
unix type systems, and on MS XP or Vista, too Any ideas are wellcome. Gabor -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple question about logging module.

2007-07-31 Thread Gabor Urban
Thx guys You gave me good ideas. At the moment I do not have time for it, but I would like to write a summary. Have fun -- http://mail.python.org/mailman/listinfo/python-list

Simple question about logging module.

2007-07-31 Thread Gabor Urban
Hullo, I have started to use Python's logging, and got a problem. I have created some loggers and wrote some lines in the log. The problem is, that most of the lines appear doubled in the log, and some lines do not appear at all. Any ideas or comments are wellcome, Gabor Here is the

Re: The Modernization of Emacs: terminology buffer and

2007-07-13 Thread Gabor Urban
Hullo, I was just wondering if this thread was whithering out.. I gues not for a good time. A short summary in the hope for the last posting in this topic. Some provocative posting caused or Twister brother to send a large amount of doubtful info. It seems, he had some very bad experience w

Dynamic method

2007-07-10 Thread Gabor Urban
Hi guys. I have an issue I think Python could handle. But I do not have the knowledge to do it. Suppose I have a class 'myClass' and instance 'var'. There is function 'myFunc(..)'. I have to add (or bind) somehow the function to the class, or the instance. Any help, info or point of referenc

Emacs topic should be stopped....

2007-06-25 Thread Gabor Urban
mailing list of an open source programming language. :- Arguments and logic are not working, it's been a 'religious' flame topic. I am open to discuss this issue further in private.. Gabor -- http://mail.python.org/mailman/listinfo/python-list

Emacs topic

2007-06-21 Thread Gabor Urban
of them, and IMHO could be set as an efficiency/proficiency standard. But if it does not fit to your fingers or working style, do not use it. I am open to personal debate outside of this list, Gabor -- http://mail.python.org/mailman/listinfo/python-list

Re: The Modernization of Emacs

2007-06-20 Thread Gabor Urban
Hi guys... This topic is not relevant in this mailing list. Though some info from an other mailing list. Emacs (and xemacs) runs perfectly well on non-gui environments as well. So keyboard commands are the only efficient way to work with. It is true, Emacs may be a bit antiquated, but it honed

Re: A few questions

2007-05-22 Thread Urban, Gabor
t stuff!)." I would suggest you to read Dive into Python. Very deep descriptions. 3. I vote for Emacs :-)) Gabor Urban NMC - ART -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Newbie Suggestions

2007-05-21 Thread Urban, Gabor
Stephen wrote: " For a newbie any material referenced should be current and include what is available in Python 2.5." I disagree. A newbie should learn Python and and Python programming . Not the latest should be the best choice.... Gabor Urban NMC - ART -- http://mail.python.o

RE: unittest dependencies

2007-05-04 Thread Urban, Gabor
good enough. Good luck, Gabor Urban NMC - ART -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of urielka Sent: 2007. május 2. 23:10 To: python-list@python.org Subject: unittest dependencies i am using unittest to test a project,and one thing i really want

IDLE problem

2007-04-02 Thread Urban, Gabor
ile "D:\Python24\lib\unittest.py", line 797, in runTests sys.exit(not result.wasSuccessful()) SystemExit: False >>> The script I was executing was a simple unittest.TestCase descendant. Any ideas? Gabor Urban NMC - ART -- http://mail.python.org/mailman/listinfo/python-list

Re: XML Parsing

2007-03-28 Thread Urban, Gabor
HI, I could suggest you to use the minidom xml parser from xml module. Your XML schema does not seem to complocated. You will find detailed descriptions, and working code in the book: Dive ino Python. Google for it :-)) Gabor Urban NMC - ART -- http://mail.python.org/mailman/listinfo

Re: os.lisdir, gets unicode, returns unicode... USUALLY?!?!?

2006-11-19 Thread gabor
Martin v. Löwis wrote: > gabor schrieb: >>> I may have missed something, but did you present a solution that would >>> make the case above work? >> if we use the same decoding flags as binary-string.decode(), >> then we could do: >> >> [os.path.

Re: os.lisdir, gets unicode, returns unicode... USUALLY?!?!?

2006-11-19 Thread gabor
Martin v. Löwis wrote: > gabor schrieb: >> 1. simply fix the documentation, and state that if the file-name cannot >> be decoded into unicode, then it's returned as byte-string. > > For 2.5, this should be done. Contributions are welcome. > > [...then] &

Re: os.lisdir, gets unicode, returns unicode... USUALLY?!?!?

2006-11-19 Thread gabor
Fredrik Lundh wrote: > gabor wrote: > >> yes, sure... but then.. it's possible to implement it also on top of >> an raise-when-error version :) > > not necessarily if raise-when-error means raise-error-in-os-listdir. > could you please clarify? currently i

Re: os.lisdir, gets unicode, returns unicode... USUALLY?!?!?

2006-11-19 Thread gabor
Martin v. Löwis wrote: > gabor schrieb: >> depends on the application. in the one where it happened i would just >> display an error message, and tell the admins to check the >> filesystem-encoding. >> >> (in other ones, where it's not critical to get the

Re: What do I look for in a shared Python host?

2006-11-18 Thread gabor
Gregor Horvath wrote: > walterbyrd schrieb: >> What other "gotchas" would I look for? >> > > Maybe this is helpfull for you: > > http://docs.turbogears.org/1.0/Hosting > and this: http://code.djangoproject.com/wiki/DjangoFriendlyWebHosts gabor --

Re: Python v PHP for web, and restarting Apache?

2006-11-17 Thread gabor
astcgi - sci - proxy also the same way, for php: - mod_php - fastcgi - cgi - (maybe something more, i'm not much experienced with php) so first you should tell us which python-solution would you like to compare to which php-solution.. gabor -- http://mail.python.org/mailman/listinfo/python-list

Re: os.lisdir, gets unicode, returns unicode... USUALLY?!?!?

2006-11-17 Thread gabor
Martin v. Löwis wrote: > gabor schrieb: >> i also recommend this approach. >> >> also, raising an exception goes well with the principle of the least >> surprise imho. > > Are you saying you wouldn't have been surprised if that had been > the behavior

Re: os.lisdir, gets unicode, returns unicode... USUALLY?!?!?

2006-11-17 Thread gabor
Fredrik Lundh wrote: > gabor wrote: > >> get an Unicode-exception, as everywhere else. you see, exceptions are >> ok, i can deal with them. > >> p.s: one additional note. if you code expects os.listdir to return >> unicode, that usually means that all your cod

Re: os.lisdir, gets unicode, returns unicode... USUALLY?!?!?

2006-11-17 Thread gabor
iles = [check_and_fix_wrong_filename(f) for f in files] in other words, your opinion is that the proposed solution is not optimal, or that the current behavior is fine? gabor -- http://mail.python.org/mailman/listinfo/python-list

Re: os.lisdir, gets unicode, returns unicode... USUALLY?!?!?

2006-11-17 Thread gabor
Laurent Pointal wrote: Laurent Pointal wrote: > gabor a écrit : >> hi, >> >> from the documentation (http://docs.python.org/lib/os-file-dir.html) for >> os.listdir: >> >> "On Windows NT/2k/XP and Unix, if path is a Unicode object, the result >> w

Re: os.lisdir, gets unicode, returns unicode... USUALLY?!?!?

2006-11-16 Thread gabor
Jean-Paul Calderone wrote: > On Fri, 17 Nov 2006 00:31:06 +0100, "\"Martin v. Löwis\"" > <[EMAIL PROTECTED]> wrote: >> gabor schrieb: >>>> All this code will typically work just fine with the current behavior, >>>> so people typical

Re: os.lisdir, gets unicode, returns unicode... USUALLY?!?!?

2006-11-16 Thread gabor
Martin v. Löwis wrote: > gabor schrieb: > >> or am i using os.listdir the "wrong way"? how do other people deal with >> this? > > You didn't say why the behavior causes a problem for you - you only > explained what the behavior is. > > Most pe

os.lisdir, gets unicode, returns unicode... USUALLY?!?!?

2006-11-16 Thread gabor
l, because the auto-convert only happens using 'ascii' as the encoding, and if it was not possible to decode the filename inside listdir, it's quite probable that it also will not work using 'ascii' as the charset. gabor -- http://mail.python.org/mailman/listinfo/python-list

new-style classes, __hash__. is the documentation wrong?

2006-10-25 Thread gabor
currently wrong? because from what i see (the bug will not be fixed), it's still much safer to define a __hash__ even for mutable objects (when the object also defines __eq__). gabor -- http://mail.python.org/mailman/listinfo/python-list

Re: datetime: the date of the day one month ago...how?

2006-04-12 Thread gabor
Max M wrote: > gabor wrote: >> hi, >> >> i'm trying to get the date of the day one month ago. >> >> for example: >> >> today = 12.apr.2006 >> one-month-ago = 12.mar.2006 >> >> so: >> >> one-month-ago(12.apr.2006) =

datetime: the date of the day one month ago...how?

2006-04-12 Thread gabor
the datetime.timedelta objects only work with hours or days or weeks, not month (i understand why)... but is there a way to calculate this in python? i really don't want to calculate it by myself :-)) thanks, gabor -- http://mail.python.org/mailman/listinfo/python-list

Re: which is more 'pythonic' / 'better' ?

2005-09-13 Thread gabor
m, >>so I assumed it was string. > > > I did too. > i'm sorry ;) it was a list of strings... the code was something like: for line in open('x.y'): line = line.split('\t') a better naming would be better it seems :) gabor -- http://mail.python.org/mailman/listinfo/python-list

which is more 'pythonic' / 'better' ?

2005-09-12 Thread gabor
hi, there are 2 versions of a simple code. which is preferred? === if len(line) >= (n+1): text = line[n] else: text = 'nothing' === === try: text = line[n] except IndexError: text = 'nothing' === which is the one you would use?

multi-CPU, GIL, threading on linux

2005-06-14 Thread gabor
when i am running a python process, and the threads are running on different cpus? i understand that because of the GIL i cannot make my application faster. but slower? thanks, gabor -- http://mail.python.org/mailman/listinfo/python-list

Re: write to the same file from multiple processes at the same time?

2005-05-31 Thread gabor
Mike Meyer wrote: > gabor <[EMAIL PROTECTED]> writes: > > >>ok, i ended up with the following code: >> >>def syncLog(filename,text): >> f = os.open(filename,os.O_WRONLY | os.O_APPEND) >> fcntl.flock(f,fcntl.LOCK_EX) >> os.write(f

Re: write to the same file from multiple processes at the same time?

2005-05-30 Thread gabor
gabor wrote: > Jp Calderone wrote: > >> To briefly re-summarize, when you want to acquire a lock, attempt to >> create a directory with a well-known name. When you are done with it, >> delete the directory. This works across all platforms and filesystems >>

Re: write to the same file from multiple processes at the same time?

2005-05-30 Thread gabor
done periodically by > another process, on a time-scale that is 'useful' if not > instantaneous... > > Just trying to understand here... > actually this is what i implemented after asking the question, and works fine :) i just thought that maybe there is a solution wher

Re: write to the same file from multiple processes at the same time?

2005-05-30 Thread gabor
mething like a mutex-synchronized block of the code... gabor -- http://mail.python.org/mailman/listinfo/python-list

write to the same file from multiple processes at the same time?

2005-05-27 Thread gabor
seems as a stupid way to do it :( another idea was to use a simple database (sqlite?) which probably has this problem solved already... any better ideas? thanks, gabor -- http://mail.python.org/mailman/listinfo/python-list

Re: www.pythonchallange.com

2005-05-10 Thread Gabor Farkas
Gabor Farkas wrote: > www.pythonchallange.com sorry, wanted to send it to someone else.. (too tired...) ;( gabor -- http://mail.python.org/mailman/listinfo/python-list

www.pythonchallange.com

2005-05-10 Thread Gabor Farkas
www.pythonchallange.com -- http://mail.python.org/mailman/listinfo/python-list