Re: Python for beginners or not? [was Re: syntax difference]
To: Steven D'Aprano From: "Stefan Ram" To: Steven D'Aprano From: r...@zedat.fu-berlin.de (Stefan Ram) Steven D'Aprano writes: >It has been a long, long time since Python has been a "simple" language >suitable for rank beginners, if it ever was. Python is not Scratch. Python is simpler insofar as you can write on a higher level than with C. Python has a GC and an intuitive syntax for lists, tuples and dictionaries. main.c #include int main( void ){ printf( "%d\n", 6 * 6 ); } transcript -694967296 Above, a beginner has to take care to use Γ╗%dΓ½ and remember to change this to Γ╗%gΓ½ when necessary. He also needs to understand why the result is negative, and that the result is /implementation-dependent/. Surely, |>>> print( 6 * 6 ) |36 is easier to read, write, and understand. Still, one must not forget that learning Python encompasses all the hard work it takes to learn how to program in every language. -+- BBBS/Li6 v4.10 Toy-3 + Origin: Prism bbs (1:261/38) --- BBBS/Li6 v4.10 Toy-3 * Origin: Prism bbs (1:261/38) -- https://mail.python.org/mailman/listinfo/python-list
Re: Python for beginners or not? [was Re: syntax difference]
To: Stefan Ram From: r...@zedat.fu-berlin.de (Stefan Ram) r...@zedat.fu-berlin.de (Stefan Ram) writes: >Still, one must not forget that learning Python encompasses >all the hard work it takes to learn how to program in every >language. "Beginner", however, is a very vague term. A good scientist or engineer who (for some reason) never programmed before (or, at least, not in Python) is a totally different kind of a "beginner" than a secretary, a garbage collector or a schoolchild. Quoting: Γ╗I've found that some of the best [Software ]developers of all are English majors. They'll often graduate with no programming experience at all, and certainly without a clue about the difference between DRAM and EPROM. But they can write. That's the art of conveying information concisely and clearly. Software development and writing are both the art of knowing what you're going to do, and then lucidly expressing your ideas.Γ½ http://praisecurseandrecurse.blogspot.com/2007/03/english-majors-as-programmers .html --- BBBS/Li6 v4.10 Toy-3 * Origin: Prism bbs (1:261/38) -- https://mail.python.org/mailman/listinfo/python-list
Re: translating foreign data
To: Richard Damon From: "Stefan Ram" To: Richard Damon From: r...@zedat.fu-berlin.de (Stefan Ram) Richard Damon writes: >Now, if I have a parser that doesn't use the locale, but some other rule >base than I just need to provide it with the right rules, which is >basically just defining the right locale. Here's an example C++ program I wrote. It uses the class s to provide rules for an ad hoc locale which then is used to imbue a temporary string stream which then can parse numbers using the thousands separator given by s. main.cpp #include #include #include #include #include using namespace ::std::literals; struct s : ::std::numpunct< char > { char do_thousands_sep() const override { return ','; } ::std::string do_grouping() const override { return "\3"; }}; static double double_value_of( ::std::string const & string ) { ::std::stringstream source { string }; source.imbue( ::std::locale( source.getloc(), new s )); double number; source >> number; return number; } int main() { ::std::cout << double_value_of( "4,800.1"s )<< '\n'; ::std::cout << double_value_of( "3,334.5e9"s )<< '\n'; } transcript 4800.1 3.3345e+012 -+- BBBS/Li6 v4.10 Toy-3 + Origin: Prism bbs (1:261/38) --- BBBS/Li6 v4.10 Toy-3 * Origin: Prism bbs (1:261/38) -- https://mail.python.org/mailman/listinfo/python-list
Re: Static variables [was Re: syntax difference]
To: Stefan Ram From: "Stefan Ram" To: Stefan Ram From: r...@zedat.fu-berlin.de (Stefan Ram) r...@zedat.fu-berlin.de (Stefan Ram) writes: >def f(): >def g(): >g.x += 1 >return g.x >g.x = 0 >return g Or, "for all g to share the same x": main.py def f(): def g(): f.x += 1 return f.x return g f.x = 0 g = f() print( g() ) print( g() ) print( g() ) g1 = f() print( g1() ) print( g1() ) print( g1() ) transcript 1 2 3 4 5 6 -+- BBBS/Li6 v4.10 Toy-3 + Origin: Prism bbs (1:261/38) --- BBBS/Li6 v4.10 Toy-3 * Origin: Prism bbs (1:261/38) -- https://mail.python.org/mailman/listinfo/python-list
Re: Static variables [was Re: syntax difference]
To: Steven D'Aprano From: "Stefan Ram" To: Steven D'Aprano From: r...@zedat.fu-berlin.de (Stefan Ram) Steven D'Aprano writes: >def f(): >static x = 0 >def g(): >x += 1 >return x >return g What one can do today: main.py def g(): g.x += 1 return g.x g.x = 0 print( g() ) print( g() ) print( g() ) transcript 1 2 3 main.py def f(): def g(): g.x += 1 return g.x g.x = 0 return g g = f() print( g() ) print( g() ) print( g() ) transcript 1 2 3 -+- BBBS/Li6 v4.10 Toy-3 + Origin: Prism bbs (1:261/38) --- BBBS/Li6 v4.10 Toy-3 * Origin: Prism bbs (1:261/38) -- https://mail.python.org/mailman/listinfo/python-list
Re: Python for beginners or not? [was Re: syntax difference]
To: Steven D'Aprano From: r...@zedat.fu-berlin.de (Stefan Ram) Steven D'Aprano writes: >It has been a long, long time since Python has been a "simple" language >suitable for rank beginners, if it ever was. Python is not Scratch. Python is simpler insofar as you can write on a higher level than with C. Python has a GC and an intuitive syntax for lists, tuples and dictionaries. main.c #include int main( void ){ printf( "%d\n", 6 * 6 ); } transcript -694967296 Above, a beginner has to take care to use Γ╗%dΓ½ and remember to change this to Γ╗%gΓ½ when necessary. He also needs to understand why the result is negative, and that the result is /implementation-dependent/. Surely, |>>> print( 6 * 6 ) |36 is easier to read, write, and understand. Still, one must not forget that learning Python encompasses all the hard work it takes to learn how to program in every language. --- BBBS/Li6 v4.10 Toy-3 * Origin: Prism bbs (1:261/38) -- https://mail.python.org/mailman/listinfo/python-list
Re: translating foreign data
To: Richard Damon From: r...@zedat.fu-berlin.de (Stefan Ram) Richard Damon writes: >Now, if I have a parser that doesn't use the locale, but some other rule >base than I just need to provide it with the right rules, which is >basically just defining the right locale. Here's an example C++ program I wrote. It uses the class s to provide rules for an ad hoc locale which then is used to imbue a temporary string stream which then can parse numbers using the thousands separator given by s. main.cpp #include #include #include #include #include using namespace ::std::literals; struct s : ::std::numpunct< char > { char do_thousands_sep() const override { return ','; } ::std::string do_grouping() const override { return "\3"; }}; static double double_value_of( ::std::string const & string ) { ::std::stringstream source { string }; source.imbue( ::std::locale( source.getloc(), new s )); double number; source >> number; return number; } int main() { ::std::cout << double_value_of( "4,800.1"s )<< '\n'; ::std::cout << double_value_of( "3,334.5e9"s )<< '\n'; } transcript 4800.1 3.3345e+012 --- BBBS/Li6 v4.10 Toy-3 * Origin: Prism bbs (1:261/38) -- https://mail.python.org/mailman/listinfo/python-list
Re: Static variables [was Re: syntax difference]
To: Steven D'Aprano From: r...@zedat.fu-berlin.de (Stefan Ram) Steven D'Aprano writes: >def f(): >static x = 0 >def g(): >x += 1 >return x >return g What one can do today: main.py def g(): g.x += 1 return g.x g.x = 0 print( g() ) print( g() ) print( g() ) transcript 1 2 3 main.py def f(): def g(): g.x += 1 return g.x g.x = 0 return g g = f() print( g() ) print( g() ) print( g() ) transcript 1 2 3 --- BBBS/Li6 v4.10 Toy-3 * Origin: Prism bbs (1:261/38) -- https://mail.python.org/mailman/listinfo/python-list
Re: Static variables [was Re: syntax difference]
To: Stefan Ram From: r...@zedat.fu-berlin.de (Stefan Ram) r...@zedat.fu-berlin.de (Stefan Ram) writes: >def f(): >def g(): >g.x += 1 >return g.x >g.x = 0 >return g Or, "for all g to share the same x": main.py def f(): def g(): f.x += 1 return f.x return g f.x = 0 g = f() print( g() ) print( g() ) print( g() ) g1 = f() print( g1() ) print( g1() ) print( g1() ) transcript 1 2 3 4 5 6 --- BBBS/Li6 v4.10 Toy-3 * Origin: Prism bbs (1:261/38) -- https://mail.python.org/mailman/listinfo/python-list
Re: While, If, Count Statements
Cai Gengyang writes: Statement 0: >count = 0 Statement 1: >if count < 5: > print "Hello, I am an if statement and count is", count Statement 2: >while count < 10: > print "Hello, I am a while and count is", count > count += 1 There are three statements here. They are executed in the given sequence. First, statement 0 binds the name â»countâ« to an object which has the int-value â»0â«. Next, statement 1 prints â»am an ifâ«. Now statement 1 was executed. It will never be revisited. It's history. Next, statement 2 will print "am a while" several times. It is separated from statement 2, like, totally. The statement 1 is in the remote past from where it never will return to be executed while the while loop is happily printing aways its "am a while" :-). Statement 1 is sad :-(, because it will never print no more. Never more. -- https://mail.python.org/mailman/listinfo/python-list
Re: Argh!! Can't wrap my head around this Python stuff!
Ram) (Stefan Ram) Greg Tibbet writes: >I'm an old timer, have programmed in Fortran, C, C++, Perl, and a bit >of Java and trying to learn this new-fangled Python language! Which actually is older than Java. >def ellipse(self, xy, fill=None, outline=None): >"""Draw an ellipse.""" >ink, fill = self._getink(outline, fill) >if fill is not None: >self.draw.draw_ellipse(xy, fill, 1) ><...snipped...> >ellipse() uses the method self.draw.draw_ellipse() Okay, fine... >but WHERE is draw_ellipse defined?? What magic is happening there? Depends on the nature of â»selfâ«. Usually, the answer would be that it's defined in a superclass. But with Python, one could also decrypt a string and then feed the result to â»execâ« to dynamically add methods to an object whose source code is well hidden. Looking into the matter, it turns out, however, ... â»_draw_ellipseâ« is defined in the language C in the file â»_imaging.câ« and then mapped to â»draw_ellipseâ« via PyMethodDef which is part of Python's C API. -- https://mail.python.org/mailman/listinfo/python-list
Re: Stopping an iterator and continuing later
r...@zedat.fu-berlin.de (Stefan Ram) writes: >Then you can use pickle or custom methods to save and >restore the object, or get the state from an iterator >and create a new iterator with that state later. One does not always have to write a custom class, for example: main.py import pickle r = range( 9 ) i = iter( r ) del r next( i ) next( i ) next( i ) bytes = pickle.dumps( i ) del i i = pickle.loads( bytes ) print( next( i )) del i del pickle transcript 3 -- https://mail.python.org/mailman/listinfo/python-list
Re: Argh!! Can't wrap my head around this Python stuff!
Greg Tibbet writes: >I'm an old timer, have programmed in Fortran, C, C++, Perl, and a bit >of Java and trying to learn this new-fangled Python language! Which actually is older than Java. >def ellipse(self, xy, fill=None, outline=None): >"""Draw an ellipse.""" >ink, fill = self._getink(outline, fill) >if fill is not None: >self.draw.draw_ellipse(xy, fill, 1) ><...snipped...> >ellipse() uses the method self.draw.draw_ellipse() Okay, fine... >but WHERE is draw_ellipse defined?? What magic is happening there? Depends on the nature of â»selfâ«. Usually, the answer would be that it's defined in a superclass. But with Python, one could also decrypt a string and then feed the result to â»execâ« to dynamically add methods to an object whose source code is well hidden. Looking into the matter, it turns out, however, ... â»_draw_ellipseâ« is defined in the language C in the file â»_imaging.câ« and then mapped to â»draw_ellipseâ« via PyMethodDef which is part of Python's C API. -- https://mail.python.org/mailman/listinfo/python-list
Re: Stopping an iterator and continuing later
r...@zedat.fu-berlin.de (Stefan Ram) writes: >Then you can use pickle or custom methods to save and >restore the object, or get the state from an iterator >and create a new iterator with that state later. One does not always have to write a custom class, for example: main.py import pickle r = range( 9 ) i = iter( r ) del r next( i ) next( i ) next( i ) bytes = pickle.dumps( i ) del i i = pickle.loads( bytes ) print( next( i )) del i del pickle transcript 3 -- https://mail.python.org/mailman/listinfo/python-list
Re: Argh!! Can't wrap my head around this Python stuff!
Greg Tibbet writes: >I'm an old timer, have programmed in Fortran, C, C++, Perl, and a bit >of Java and trying to learn this new-fangled Python language! Which actually is older than Java. >def ellipse(self, xy, fill=None, outline=None): >"""Draw an ellipse.""" >ink, fill = self._getink(outline, fill) >if fill is not None: >self.draw.draw_ellipse(xy, fill, 1) ><...snipped...> >ellipse() uses the method self.draw.draw_ellipse() Okay, fine... >but WHERE is draw_ellipse defined?? What magic is happening there? Depends on the nature of â»selfâ«. Usually, the answer would be that it's defined in a superclass. But with Python, one could also decrypt a string and then feed the result to â»execâ« to dynamically add methods to an object whose source code is well hidden. Looking into the matter, it turns out, however, ... â»_draw_ellipseâ« is defined in the language C in the file â»_imaging.câ« and then mapped to â»draw_ellipseâ« via PyMethodDef which is part of Python's C API. -- https://mail.python.org/mailman/listinfo/python-list
manipulating an existing plot !
Hello, I already have a script that plots a polygon. But now I'm trying to script a python class that would enable me to import the previous plot , make instances and control it too(like specifying parameters like spacing , width, height or the like). My approach was, to create a new layout and try to import the exisiting plot and then try to make instances and manipulate it. class DerivedClass(BaseClass): def __init__(self, layout,topcell): self.layout = pya.Layout() self.layout.dbu = 0.001 self.topcell = self.layout.create_cell("TOP") l1 = layout.layer(1, 0) topcell.shapes(l1).insert(pya.Box(0, 0, 1000, 2000)) self.path = [] def add_new(self,path): self.path.append(path) How could I use layer mapping or any other method to accomplish this? Looking forward to your advise. Thanks. -- https://mail.python.org/mailman/listinfo/python-list
Re: Problems compiling Python 3.4 on Ubuntu
Worked! Thanks Ervin! On Mon, Feb 3, 2014 at 1:08 PM, Ervin Hegedüs wrote: > Hello, > > On Mon, Feb 03, 2014 at 02:50:15AM -0800, cool-RR wrote: > > Hi, > > > > I'm trying to install Python 3.4b3 on Ubuntu. Since compilation seems to > be the only way, I'm trying that. > > > > I downloaded the source, I changed Setup.dist to have this: > > > > SSL=/usr > > _ssl _ssl.c \ > > -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \ > > -L$(SSL)/lib -lssl -lcrypto > > > [...] > > > ./Modules/_ssl.c:57:25: fatal error: openssl/rsa.h: No such file or > directory > > #include "openssl/rsa.h" > > ^ > > compilation terminated. > > > > What do I do to solve this? > > try this: > > sudo apt-get install libssl-dev > > > cheers, > > > a. > > -- https://mail.python.org/mailman/listinfo/python-list
REG PYTHON developer
urgently looking for python developer for contract opportunity for one our financial client. Location: NYC, NY Contract: 12 Months 4 to 8 years of Developer experience. Excellent coding and design skills. Software that works is reliable, testable and maintainable should be what you do by default. You enjoy writing software and take pride in what you build. SOL proficiency, particularly with PostgreSQL is a plus. Strong communications skills, both written and verbal. Thanks & Regards, Ram i3 Software 100 Wood Avenue South, Suite 105 Iselin, NJ, 08830 (O) 703 953 2828 Think Green: Please consider the environment before printing this e-mail. -- http://mail.python.org/mailman/listinfo/python-list
Client Needs at Network Engineer at Germantown,MD
Good Day, We have an urgent Contract Opening in Germantown, MD. Looking forward to submit your resume for below mentioned Requirement… If you are interested, Please forward your latest resume along with location and pay rate details to r...@tech-netinc.com Job Title: Network Engineer Location: Germantown,MD Duration: 6+ months Position Details: Client is looking for a Network Engineer to join a multi-member / multi-region team which supports a Global Enterprise Network consisting of more than 50 sites. The successful candidate will engage with a Global team supporting systems and tools which include Cisco and HP networking and security systems, Blue Coat proxies, Juniper and Cisco SSL VPN appliances, Cisco and F5 load balances, H.323 and SIP voice gateways, Riverbed optimization and analysis appliances and management tools such as SPLUNK, Solar Winds Orion and TACACS+. Principal duties and responsibilities may include, but are not limited to: • Participate in rotating on-call coverage (as an escalation point for Tier 2) • Identify, diagnose, and resolve complex network problems • Assist application teams to diagnose and resolve performance issues over the network using sniffing tools (i.e. wire shark) • Able to travel occasionally for special projects • Implement, maintain and enhance network management tools (i.e. Riverbed Cascade, SPLUNK, Solar Winds Orion, etc…) • Review project specifications and make design/implementation recommendations for improvements • Escalation point for incident, change, and service request tickets • Preparation of proposals and solution presentations • Act as a level 3 support for firewalls, load balancers, routing, and switching. Work with technical group to resolve issues in a timely manner • Mentor and knowledge sharing (training) for Tier 2, Tier 1, desk side and helpdesk support staff • Submit network level changes and provide appropriate level of coordination along with implementation. • Maintain knowledge of the network environment and sufficient familiarity with business/application/systems • Perform work in an ethical manner, and act at all times with a business professional manner Required Qualifications: • Minimum eight (8) years networking support for medium to large networks • Have senior/expert knowledge of routing and switching with Cisco and HP hardware/software. • Have senior/expert knowledge of Cisco ASA / ACE / ACS / TACACS+ / NCS, Juniper, and F5 • Have senior/expert knowledge of ACE and F5 load balancing technologies. • Capable of performing packet level analysis. • Have senior/expert knowledge of Cisco Router suite of products (2900/3800, 3900/2900, ASR, etc.) • Have senior/expert knowledge of Cisco Switch suite of products (6500, 4500, 4900, 3750, etc.) • Have senior/expert knowledge of WAN technologies: Frame Relay, ATM, T3, MPLS, MetroE • Have senior/expert knowledge of Internet and networking technologies such as DNS, SMTP, SNMP, NTP. • Ability to understand and adhere to systems security and control procedures in accordance with departmental, vendor standards and regulatory bodies • Knowledge of network technologies such as, TCP/IP protocol, Layer 2 Spanning Tree, Layer 3 routing (EIGRP, BGP, OSPF), Quality of Services, DNS, DHCP, SNMP • Good knowledge of IP Telephony • Good Knowledge of Server Virtualization (i.e. VM Ware) and networking requirements to support • Have senior/expert knowledge of network cabling standards and wireless network technologies • Have senior/expert knowledge of enterprise network management tools such as Cisco Works, HP Open view, Solar Winds • Provide leadership to junior staff • Must be able to create and update documentation with Visio, Excel and Word • At least 2 years in a team lead or technical project management role, with experience in: o Ability to oversee and lead vendors and other network department resources o Ability to interact with other departments such as facilities • Ability to work independently and provide timely status updates. • Good oral and written communications skills. • Ability to handle multi-tasking and frequently changing priorities. • Cisco Certifications a plus • Familiarity with ITIL processes a plus Thanks, Ram Dev Recruiter Tech-Net Inc. Tel: 916-458-4390 Ext 102 Email: r...@tech-netinc.com Ym: vramde...@yahoo.com URL: www.tech-netinc.com -- http://mail.python.org/mailman/listinfo/python-list
Need Data Architect/Technical Business Analyst For 6months at San Rafael, CA
Good Day, urgent Requirement : San Rafael, CA 6 months As a member of the Market Intelligence team, the Data Architect/Technical Business Analyst will be tasked with assessing current state business process and corresponding data flows, understanding Marketing business objectives, and identifying gaps in process, systems, and data that prevent execution against those objectives. This will require understanding the broader internal data integration landscape to adequately determine synergies/ overlap and call out integration areas pertinent to Marketing that are insufficiently addressed by current systems and in-flight projects. Principal Duties and Responsibilities: • Develop clear understanding of company’s integrated Marketing objectives/KPIs • Leverage IT and Marketing resources to understand related process/data flows • Develop and execute ETL procedures to integrate required sources (where currently feasible) • Perform data/system/project gap analysis, documenting issues within the context of Marketing objectives • Work closely with/inform business owners and project teams to ensure that documented gaps are addressed Requirements: • 5+ years SQL experience (SQL Server, Oracle) experience • 5+ years ETL (SSIS, DTS, Informatica) experience • High proficiency in data/systems analysis and integration • Understanding of data models, data quality • Proven ability to work within a highly-matrixed, global organization • Excellent documentation and organizational skills • Excellent communication skills, both written and verbal, and interpersonal skills Desired Knowledge/Skills: • Siebel CRM data model experience strongly preferred • Business systems analysis./process engineering experience strongly preferred • SFDC data model experience a plus • Understanding of Clients Customer, Product, Contract, and Entitlement data/structures a plus Thanks, Ram Dev Recruiter Tech-Net Inc. Tel: 916-458-4390 Ext 102 Email: r...@tech-netinc.com -- http://mail.python.org/mailman/listinfo/python-list
Client Needs Sr. Java Developer, Sacramento, CA
Good Day, We have an urgent Contract Opening in Sr.Java Developer Looking forward to submit your resume for below mentioned Requirement… If you are interested, Please forward your latest resume along with location and pay rate details to r...@tech-netinc.com asked at the bottom of mail Job Title: Sr. Java Developer Location: Sacramento, CA Duration: 12+ Months Required Skills: • J2EE • SOA • Web services(Strong, i.e., 3-4 years) • Oracle pl/sql • UNIX platform • Full Name: • Current Location: • Pay Rate : • Contact Details: • Email: • Availability: • Visa Status: • Relocation to : • Last 4-digits of SSN: • References: • Ready for Telephonic discussion during office hours Thanks, Ram Dev Recruiter Tech-Net Inc. Tel: 916-458-4390 Ext 102 Email: r...@tech-netinc.com -- http://mail.python.org/mailman/listinfo/python-list
Client Needs---QA Manual Tester at Sacramento, CA
Good Day, We have an urgent Contract Openings in Folsom, CA Looking forward to submit your resume for below mentioned Requirement… If you are interested, Please forward your latest resume along with location and pay rate details to r...@tech-netinc.com Job Title: QA Engineer(Strong Web services Experience Needed) Location: Sacramento, CA Duration: 2 Years Required: • Strong knowledge of SDLC • Manual testing experience should be 6+ years • Web services exp must be more than 4+ years • Solid background of software testing methods, processes, tools • Strong in XML,UNIX and SQL • Advance level knowledge and hands-on experience with Test Planning, Test Development, Test Data Setup, Test Execution and Test Reporting. • Knowledge of variety of testing methods and direct experience in test development and execution of functionality, integration, security, transaction, error handling, performance of web applications. • Expertise in testing web services API using Parasoft SOA Test or SOAP UI. • Hands-on experience with Quality Center/ALM 11. • Experience working in Windows and Unix (Linux) environments. • Team player with good mentoring and presentation skills Desired: • ISO or Electricity Industry experience • GUI and API test automation using HP Quick Test Pro • Load/performance test automation using HP Load Runner • Experience in integrating QTP, SOA Test, Load Runner or other test automation tools with HP Quality Center • Advance level experience in using and administering Quality Center, developing workflows to customize QC using VB Script. • Strong programming/scripting background in Java and Python. Able to code review and develop unit test if needed. Environment: JBoss, Groovy and Grails, Oracle 11g, SQL, XNL, Actuate, Reporting Services, SharePoint, Quality Center, Quick Test Pro, Load Runner, SOA Test, Windows, Linux. Thanks, Ram Dev Recruiter Tech-Net Inc. Tel: 916-458-4390 Ext 102 Email: r...@tech-netinc.com URL: www.tech-netinc.com -- http://mail.python.org/mailman/listinfo/python-list
Bug in logutils package
Does anyone have any inkling on how to fix this bug? http://code.google.com/p/logutils/issues/detail?id=3 Or any good pointers on how to find out whats wrong and how to fix it would be nice. Thanks, --Ram -- http://mail.python.org/mailman/listinfo/python-list
logging.getLogger( __name__ )
How does this line work? How do I get my logger to point to a file to be named as /tmp/modulename.log : I can do this using inspect, but there probably is a better way? Thanks, --Ram -- http://mail.python.org/mailman/listinfo/python-list
Re: generation of keyboard events
On 6 July, 10:02, Simon Brunning wrote: > 2009/7/6 RAM : > > > I am trying to do this on windows. My program(executable) has been > > written in VC++ and when I run this program, I need to click on one > > button on the program GUI i,e just I am entering "Enter key" on the > > key board. But this needs manual process. So i need to write a python > > script which invokes my program and pass "Enter key" event to my > > program so that it runs without manual intervention. > > Try <http://pywinauto.openqa.org/>. > > -- > Cheers, > Simon B. Thank you all for the help the below url helped me in accomplishing my task http://www.rutherfurd.net/python/sendkeys/index.html regards Sreerama V -- http://mail.python.org/mailman/listinfo/python-list
Re: generation of keyboard events
On 5 July, 17:12, Tim Harig wrote: > On 2009-07-05, RAM wrote: > > > I need to start an external program and pass the keyboard events like > > F1,Right arrow key etc to the program..I am trying to use the > > subprocess module to invoke the external program. I am able to invoke > > but not able to generate the keyboard events and pass them on to the > > catb.org/esr/faqs/smart-questions.html > > You have told us nothing about the environment where you are trying to > accomplish this. GUI, CLI, Unix, Windows, etc? So I suggest that you > checkout the curses getch functions. You can find them in the standard > library documentation athttp://docs.python.org. You should also reference > documentation for the C version in your systems man pages. Hi Tim, I am trying to do this on windows. My program(executable) has been written in VC++ and when I run this program, I need to click on one button on the program GUI i,e just I am entering "Enter key" on the key board. But this needs manual process. So i need to write a python script which invokes my program and pass "Enter key" event to my program so that it runs without manual intervention. Thank in advance for the help. regards Sreerama V -- http://mail.python.org/mailman/listinfo/python-list
generation of keyboard events
Hi, I need to start an external program and pass the keyboard events like F1,Right arrow key etc to the program..I am trying to use the subprocess module to invoke the external program. I am able to invoke but not able to generate the keyboard events and pass them on to the external progam. Please help me in this because I am a beginner. regards Sreerama V -- http://mail.python.org/mailman/listinfo/python-list
Best idiom to unpack a variable-size sequence
Here's a little issue I run into more than I like: I often need to unpack a sequence that may be too short or too long into a fixed-size set of items: a, b, c = seq # when seq = (1, 2, 3, 4, ...) or seq = (1, 2) What I usually do is something like this: a, b, c = (list(seq) + [None, None, None])[:3] but that just feels rather ugly to me -- is there a good Pythonic idiom for this? Thx, Rick -- http://mail.python.org/mailman/listinfo/python-list
Unpacking sequences and keywords in one function call
Stupid question #983098403: I can't seem to pass an unpacked sequence and keyword arguments to a function at the same time. What am I doing wrong? def f(*args, **kw): for a in args: print 'arg:', a for (k,v) in kw.iteritems(): print k, '=', v >>> f(1,2) arg: 1 arg: 2 >>> f(*[1,2]) arg: 1 arg: 2 >>> f(1,2, a=1) arg: 1 arg: 2 a = 1 >>> f(*[1,2], a=1) File "", line 1 f(*[1,2], a=1) ^ SyntaxError: invalid syntax Thanks, Rick -- http://mail.python.org/mailman/listinfo/python-list
help needed :-pgdb givig error
Dear All I am very new to python . i would appreciate any help from you all on this problem which i am facing. I am trying to connect to postgres from python.for this i am using something like " import pgdb". i am able to connect to postgres and fetch data , if i execute the python file directly in unix prompt. However when i try to do thsi through broeser iam getting the following error.. Traceback (most recent call last): File "/opt/tools/cvs/htdocs/viewcvs/cgi/test.cgi", line 5, in ? import sys,string,os,pgdb File "/usr/local/lib/python2.3/site-packages/pgdb.py", line 62, in ? from _pg import * ImportError: ld.so.1: /usr/local/bin/python: fatal: libpq.so.3: open failed: No such file or directory premature end of script headers... I have python2.3 and 2.4 installed , of which pgdb.py and pg.py is installed in /usr/local/lib/python2.3/site-packages . Please help me out how to solve this when i give $python it is going to python 2.3.3. I also have the shared library _pg.so in the same directory. Luv Ram -- http://mail.python.org/mailman/listinfo/python-list